public static void createAndRegister ( DatadogTraceConfiguration configuration ) throws MalformedURLException { synchronized ( monitor ) { checkState ( handler == null , "Datadog exporter is already registered." ) ; String agentEndpoint = configuration . getAgentEndpoint ( ) ; String service = configuration . getService ( ) ; String type = configuration . getType ( ) ; final DatadogExporterHandler exporterHandler = new DatadogExporterHandler ( agentEndpoint , service , type ) ; handler = exporterHandler ; Tracing . getExportComponent ( ) . getSpanExporter ( ) . registerHandler ( REGISTER_NAME , exporterHandler ) ; } }
Creates and registers the Datadog Trace exporter to the OpenCensus library . Only one Datadog exporter can be registered at any point .