(ctx context.Context)
| 29 | ) |
| 30 | |
| 31 | func 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. |
no test coverage detected