Search in sources :

Example 1 with CustomTracingPortUnificationHandler

use of com.wavefront.agent.listeners.tracing.CustomTracingPortUnificationHandler in project java by wavefrontHQ.

the class PushAgent method startCustomTracingListener.

@VisibleForTesting
protected void startCustomTracingListener(final String strPort, ReportableEntityHandlerFactory handlerFactory, @Nullable WavefrontSender wfSender, SpanSampler sampler) {
    final int port = Integer.parseInt(strPort);
    registerPrefixFilter(strPort);
    registerTimestampFilter(strPort);
    if (proxyConfig.isHttpHealthCheckAllPorts())
        healthCheckManager.enableHealthcheck(port);
    WavefrontInternalReporter wfInternalReporter = null;
    if (wfSender != null) {
        wfInternalReporter = new WavefrontInternalReporter.Builder().prefixedWith("tracing.derived").withSource("custom_tracing").reportMinuteDistribution().build(wfSender);
        // Start the reporter
        wfInternalReporter.start(1, TimeUnit.MINUTES);
    }
    ChannelHandler channelHandler = new CustomTracingPortUnificationHandler(strPort, tokenAuthenticator, healthCheckManager, new SpanDecoder("unknown"), new SpanLogsDecoder(), preprocessors.get(strPort), handlerFactory, sampler, () -> entityProps.get(ReportableEntityType.TRACE).isFeatureDisabled(), () -> entityProps.get(ReportableEntityType.TRACE_SPAN_LOGS).isFeatureDisabled(), wfSender, wfInternalReporter, proxyConfig.getTraceDerivedCustomTagKeys(), proxyConfig.getCustomTracingApplicationName(), proxyConfig.getCustomTracingServiceName());
    startAsManagedThread(port, new TcpIngester(createInitializer(channelHandler, port, proxyConfig.getTraceListenerMaxReceivedLength(), proxyConfig.getTraceListenerHttpBufferSize(), proxyConfig.getListenerIdleConnectionTimeout(), getSslContext(strPort), getCorsConfig(strPort)), port).withChildChannelOptions(childChannelOptions), "listener-custom-trace-" + port);
    logger.info("listening on port: " + strPort + " for custom trace data");
}
Also used : SpanLogsDecoder(com.wavefront.ingester.SpanLogsDecoder) SpanDecoder(com.wavefront.ingester.SpanDecoder) WavefrontInternalReporter(com.wavefront.internal.reporter.WavefrontInternalReporter) ChannelHandler(io.netty.channel.ChannelHandler) CustomTracingPortUnificationHandler(com.wavefront.agent.listeners.tracing.CustomTracingPortUnificationHandler) ReportPoint(wavefront.report.ReportPoint) TcpIngester(com.wavefront.ingester.TcpIngester) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 CustomTracingPortUnificationHandler (com.wavefront.agent.listeners.tracing.CustomTracingPortUnificationHandler)1 SpanDecoder (com.wavefront.ingester.SpanDecoder)1 SpanLogsDecoder (com.wavefront.ingester.SpanLogsDecoder)1 TcpIngester (com.wavefront.ingester.TcpIngester)1 WavefrontInternalReporter (com.wavefront.internal.reporter.WavefrontInternalReporter)1 ChannelHandler (io.netty.channel.ChannelHandler)1 ReportPoint (wavefront.report.ReportPoint)1