How to use the jaeger-client.PrometheusMetricsFactory function in jaeger-client

To help you get started, we’ve selected a few jaeger-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linksmart / border-gateway / tracer / trace.js View on Github external
sampler: {
                type: "const",
                param: 1,
            },
            reporter: {
                // Provide the traces endpoint; this forces the client to connect directly to the Collector and send
                // spans over HTTP
                collectorEndpoint: 'http://jaeger:14268/api/traces',
                logSpans: true
                // Provide username and password if authentication is enabled in the Collector
                // username: '',
                // password: '',
            },
        };
        let namespace = config.serviceName.replace('-','_');
        let metrics = new PrometheusMetricsFactory(promClient, namespace);
        let options = {
            tags: {
                version: '1.1.2',
           },
           //metrics: metrics,
            logger: logger
        };
        let tracer = initTracer(config, options);
        return tracer;
    }
    else
    {
        const tracer = new opentracing.Tracer();
        return tracer;
    }
github DefinitelyTyped / DefinitelyTyped / types / jaeger-client / jaeger-client-tests.ts View on Github external
import * as jaegerClient from "jaeger-client";
import * as promClient from "prom-client";
import * as opentracing from "opentracing";

const tracingConfig: jaegerClient.TracingConfig = {};
const tracingOptions: jaegerClient.TracingOptions = {};

const tracer = jaegerClient.initTracer(tracingConfig, tracingOptions);
jaegerClient.initTracerFromEnv(tracingConfig, tracingOptions);

const metrics = new jaegerClient.PrometheusMetricsFactory(promClient, "foo");

const textCodec = new jaegerClient.TextMapCodec({
    contextKey: 'trace-id',
    baggagePrefix: 'baggage-',
    urlEncoding: false,
});
tracer.registerInjector(opentracing.FORMAT_TEXT_MAP, textCodec);
tracer.registerExtractor(opentracing.FORMAT_TEXT_MAP, textCodec);

const zipkinB3TextMapCodec = new jaegerClient.ZipkinB3TextMapCodec({
    baggagePrefix: 'baggage-',
    urlEncoding: false,
});
tracer.registerInjector(opentracing.FORMAT_HTTP_HEADERS, zipkinB3TextMapCodec);
tracer.registerExtractor(opentracing.FORMAT_HTTP_HEADERS, zipkinB3TextMapCodec);
github moorara / microservices-demo / services / site / util / tracer.js View on Github external
constructor (serviceName, options) {
    options = options || {}
    this.namespace = this.sanitizeName(serviceName)
    this.factory = options.factory || new PrometheusMetricsFactory(promClient, this.namespace)
  }