Merge branch 'hotfix/v0.1.3-otel-schema'
Fix OTel schema URL conflict that crashed the v0.1.3 backend at startup when an OTLP endpoint is configured (resource.Merge merged resource.Default() schema 1.43.0 with semconv/v1.24.0's schema URL). Use resource.NewSchemaless for the service.name attribute.
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