Skip to content

Zh3Wang/go-micro-opentelemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-micro-opentelemetry

usage

url := "http://127.0.0.1:14268/api/traces"
exporter, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url)))
tp := tracesdk.NewTracerProvider(
    tracesdk.WithBatcher(exporter),
    tracesdk.WithResource(resource.NewWithAttributes(
        semconv.SchemaURL,
        semconv.ServiceNameKey.String(serviceName),
        attribute.String("environment", environment),
    )),
)

otel.SetTracerProvider(tp)
otel.SetTextMapPropagator(propagation.TraceContext{})


//add a wrapper
micro.WrapHandler(oteltracing.NewHandlerWrapper())

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages