Search in sources :

Example 1 with ReportPointDecoderWrapper

use of com.wavefront.ingester.ReportPointDecoderWrapper in project java by wavefrontHQ.

the class InteractivePreprocessorTester method interactiveTest.

@Override
public boolean interactiveTest() {
    String line = stdin.nextLine();
    if (entityType == ReportableEntityType.TRACE) {
        ReportableEntityHandler<Span, String> handler = factory.getHandler(entityType, port);
        SpanUtils.preprocessAndHandleSpan(line, SPAN_DECODER, handler, handler::report, preprocessorSupplier, null, x -> true);
    } else {
        ReportableEntityHandler<ReportPoint, String> handler = factory.getHandler(entityType, port);
        ReportableEntityDecoder<String, ReportPoint> decoder;
        if (DataFormat.autodetect(line) == DataFormat.HISTOGRAM) {
            decoder = new ReportPointDecoderWrapper(new HistogramDecoder());
        } else {
            decoder = new ReportPointDecoder(() -> "unknown", customSourceTags);
        }
        WavefrontPortUnificationHandler.preprocessAndHandlePoint(line, decoder, handler, preprocessorSupplier, null, "");
    }
    return stdin.hasNext();
}
Also used : ReportPointDecoder(com.wavefront.ingester.ReportPointDecoder) ReportPointDecoderWrapper(com.wavefront.ingester.ReportPointDecoderWrapper) HistogramDecoder(com.wavefront.ingester.HistogramDecoder) Span(wavefront.report.Span) ReportPoint(wavefront.report.ReportPoint)

Example 2 with ReportPointDecoderWrapper

use of com.wavefront.ingester.ReportPointDecoderWrapper in project java by wavefrontHQ.

the class PushAgent method startOpenTsdbListener.

protected void startOpenTsdbListener(final String strPort, ReportableEntityHandlerFactory handlerFactory) {
    int port = Integer.parseInt(strPort);
    registerPrefixFilter(strPort);
    registerTimestampFilter(strPort);
    if (proxyConfig.isHttpHealthCheckAllPorts())
        healthCheckManager.enableHealthcheck(port);
    ReportableEntityDecoder<String, ReportPoint> openTSDBDecoder = new ReportPointDecoderWrapper(new OpenTSDBDecoder("unknown", proxyConfig.getCustomSourceTags()));
    ChannelHandler channelHandler = new OpenTSDBPortUnificationHandler(strPort, tokenAuthenticator, healthCheckManager, openTSDBDecoder, handlerFactory, preprocessors.get(strPort), hostnameResolver);
    startAsManagedThread(port, new TcpIngester(createInitializer(channelHandler, port, proxyConfig.getPushListenerMaxReceivedLength(), proxyConfig.getPushListenerHttpBufferSize(), proxyConfig.getListenerIdleConnectionTimeout(), getSslContext(strPort), getCorsConfig(strPort)), port).withChildChannelOptions(childChannelOptions), "listener-plaintext-opentsdb-" + port);
    logger.info("listening on port: " + strPort + " for OpenTSDB metrics");
}
Also used : ReportPointDecoderWrapper(com.wavefront.ingester.ReportPointDecoderWrapper) OpenTSDBPortUnificationHandler(com.wavefront.agent.listeners.OpenTSDBPortUnificationHandler) ChannelHandler(io.netty.channel.ChannelHandler) ReportPoint(wavefront.report.ReportPoint) ReportPoint(wavefront.report.ReportPoint) OpenTSDBDecoder(com.wavefront.ingester.OpenTSDBDecoder) TcpIngester(com.wavefront.ingester.TcpIngester)

Aggregations

ReportPointDecoderWrapper (com.wavefront.ingester.ReportPointDecoderWrapper)2 ReportPoint (wavefront.report.ReportPoint)2 OpenTSDBPortUnificationHandler (com.wavefront.agent.listeners.OpenTSDBPortUnificationHandler)1 HistogramDecoder (com.wavefront.ingester.HistogramDecoder)1 OpenTSDBDecoder (com.wavefront.ingester.OpenTSDBDecoder)1 ReportPointDecoder (com.wavefront.ingester.ReportPointDecoder)1 TcpIngester (com.wavefront.ingester.TcpIngester)1 ChannelHandler (io.netty.channel.ChannelHandler)1 Span (wavefront.report.Span)1