Skip to content

v4.3.1

Compare
Choose a tag to compare
@Baliedge Baliedge released this 14 Jul 15:07
· 120 commits to master since this release
ec94423

What's Changed

  • Simplify most common use case of OTel initialization using tracing.NewResource().

before:

res, err := resource.Merge(
       resource.Default(),
       resource.NewWithAttributes(
               semconv.SchemaURL,
               semconv.ServiceNameKey.String("My service"),
               semconv.ServiceVersionKey.String("v1.0.0"),
       ),
)
ctx, tracer, err := tracing.InitTracing(ctx, "github.com/myrepo/myservice", sdktrace.WithResource(res))

after:

res, err := tracing.NewResource("My service", "v1.0.0")
ctx, tracer, err := tracing.InitTracing(ctx, "github.com/myrepo/myservice", sdktrace.WithResource(res))