fix(observability): use schemaless resource attrs to avoid schema URL conflict
SetupTracing merged resource.Default() (schema 1.43.0 under otel 1.45.0) with semconv/v1.24.0's schema URL, so resource.Merge errored with 'conflicting Schema URL' and the backend exited at startup whenever an OTLP endpoint was configured. resource.NewSchemaless keeps service.name without pinning a schema, surviving otel major bumps.
This commit is contained in:
@@ -77,10 +77,12 @@ func SetupTracing(ctx context.Context, cfg Config) (func(context.Context) error,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Schemaless: a non-empty but different schema URL here (from an older
|
||||
// semconv pin) makes resource.Merge fail as soon as the SDK's
|
||||
// resource.Default() schema URL changes across otel upgrades.
|
||||
res, err := resource.Merge(
|
||||
resource.Default(),
|
||||
resource.NewWithAttributes(
|
||||
semconv.SchemaURL,
|
||||
resource.NewSchemaless(
|
||||
semconv.ServiceName(name),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user