Search in sources :

Example 1 with HoneycombTracePlugin

use of org.commonjava.o11yphant.honeycomb.HoneycombTracePlugin in project indy by Commonjava.

the class TraceManagerProducer method init.

@PostConstruct
public void init() {
    O11yphantTracePlugin<?> plugin;
    if (config.getTracer() == TracerPlugin.opentelemetry) {
        logger.info("Initializing Opentelemetry trace plugin");
        plugin = new OtelTracePlugin(config, config);
    } else {
        logger.info("Initializing Honeycomb trace plugin");
        if (config.isEnabled()) {
            try {
                config.validateForHoneycomb();
            } catch (ConfigurationException e) {
                logger.error("Invalid Honeycomb configuration detected!");
                throw new RuntimeException(e);
            }
        }
        plugin = new HoneycombTracePlugin(config, config, Optional.of(trafficClassifier));
    }
    traceManager = new TraceManager<>(plugin, new SpanFieldsDecorator(getRootSpanFields()), config);
    traceThreadContextualizer = traceManager.getTraceThreadContextualizer();
}
Also used : HoneycombTracePlugin(org.commonjava.o11yphant.honeycomb.HoneycombTracePlugin) ConfigurationException(org.commonjava.propulsor.config.ConfigurationException) OtelTracePlugin(org.commonjava.o11yphant.otel.OtelTracePlugin) SpanFieldsDecorator(org.commonjava.o11yphant.trace.SpanFieldsDecorator) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 HoneycombTracePlugin (org.commonjava.o11yphant.honeycomb.HoneycombTracePlugin)1 OtelTracePlugin (org.commonjava.o11yphant.otel.OtelTracePlugin)1 SpanFieldsDecorator (org.commonjava.o11yphant.trace.SpanFieldsDecorator)1 ConfigurationException (org.commonjava.propulsor.config.ConfigurationException)1