Skip to content

Instantly share code, notes, and snippets.

@nathanleclaire

nathanleclaire/osso11y.md

Last active Jan 23, 2020
Embed
What would you like to do?

prom metrics -

class YourClass {
    static final Counter requests = Counter.build()
     .name("http_requests_total")
     .help("Total requests.")
     .labelNames(
         Arrays.asList(
         "http_status",
         "http_method"
     ))
     .register();

    void processGetRequest() {
        requests.labels("200", "GET").inc();
    }
}

jaeger stuffs -

cfg := jaegercfg.Configuration{}
jLogger := jaegerlog.StdLogger{}
jMetricsFactory := metrics.NullFactory{}
tracer, err := cfg.InitGlobalTracer(
    "serviceName",
    jaegercfg.Logger(jLogger),
    jaegercfg.Metrics(jMetricsFactory),
)
if err != nil {
    log.Printf(
       "Could not initialize jaeger tracer: %s",
       err.Error(),
    )
    return
}
opentracing.SetGlobalTracer(tracer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment