Search in sources :

Example 1 with JaegerTracingManager

use of org.apache.synapse.aspects.flow.statistics.opentracing.management.JaegerTracingManager in project wso2-synapse by wso2.

the class OpenTracingManagerHolder method loadJaegerConfigurations.

/**
 * Loads Jaeger configurations required for the OpenTracingManager.
 *
 * @param samplerManagerHostPort    Jaeger sampler host and port.
 * @param senderAgentHost           Jaeger sender agent host.
 * @param senderAgentPort           Jaeger sender agent port.
 * @param logSpans                  Log spans in Jaeger reporter or not.
 * @param reporterMaxQueueSize      Max queue size of the Jaeger reporter.
 * @param reporterFlushInterval     Flush interval of the Jaeger reporter.
 */
public static void loadJaegerConfigurations(String samplerManagerHostPort, String senderAgentHost, int senderAgentPort, boolean logSpans, int reporterMaxQueueSize, int reporterFlushInterval) {
    Configuration.SamplerConfiguration sampler = new Configuration.SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1).withManagerHostPort(samplerManagerHostPort);
    Configuration.SenderConfiguration sender = new Configuration.SenderConfiguration().withAgentHost(senderAgentHost).withAgentPort(senderAgentPort);
    Configuration.ReporterConfiguration reporter = new Configuration.ReporterConfiguration().withLogSpans(logSpans).withSender(sender).withMaxQueueSize(reporterMaxQueueSize).withFlushInterval(reporterFlushInterval);
    openTracingManager = new JaegerTracingManager(sampler, reporter);
}
Also used : JaegerTracingManager(org.apache.synapse.aspects.flow.statistics.opentracing.management.JaegerTracingManager) Configuration(io.jaegertracing.Configuration)

Example 2 with JaegerTracingManager

use of org.apache.synapse.aspects.flow.statistics.opentracing.management.JaegerTracingManager in project wso2-synapse by wso2.

the class OpenTracingManagerHolder method loadZipkinConfigurations.

/**
 * Loads Zipkin configurations required for the OpenTracingManager.
 *
 * @param zipkinBackendURL
 */
public static void loadZipkinConfigurations(String zipkinBackendURL) {
    ZipkinV2ReporterFactory factory = new ZipkinV2ReporterFactory(zipkinBackendURL);
    ConstSampler sampler = new ConstSampler(true);
    openTracingManager = new JaegerTracingManager(sampler, factory.getReporter());
}
Also used : JaegerTracingManager(org.apache.synapse.aspects.flow.statistics.opentracing.management.JaegerTracingManager) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ZipkinV2ReporterFactory(org.apache.synapse.aspects.flow.statistics.opentracing.management.helpers.zipkin.ZipkinV2ReporterFactory)

Aggregations

JaegerTracingManager (org.apache.synapse.aspects.flow.statistics.opentracing.management.JaegerTracingManager)2 Configuration (io.jaegertracing.Configuration)1 ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)1 ZipkinV2ReporterFactory (org.apache.synapse.aspects.flow.statistics.opentracing.management.helpers.zipkin.ZipkinV2ReporterFactory)1