MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / initResource

Function initResource

pkg/telemetry/tracing/tracing.go:31–47  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

29)
30
31func initResource(ctx context.Context) (*resource.Resource, error) {
32 rsc, err := resource.New(ctx,
33 resource.WithContainer(),
34 resource.WithProcess(),
35 resource.WithOS(),
36 resource.WithAttributes(
37 semconv.ServiceNameKey.String("ttn-lw-stack"),
38 semconv.ServiceVersionKey.String(version.String()),
39 ),
40 )
41 if err != nil {
42 return nil, err
43 }
44
45 // Fill empty values with defaults
46 return resource.Merge(resource.Default(), rsc)
47}
48
49// Initialize initializes the tracing package and returns the tracer provider.
50// If tracing is not enabled it returns a noop tracer provider instead.

Callers 1

InitializeFunction · 0.85

Calls 5

StringFunction · 0.92
NewMethod · 0.65
StringMethod · 0.65
WithAttributesMethod · 0.45
MergeMethod · 0.45

Tested by

no test coverage detected