Component(s)
pkg/ottl
What happened?
Description
Resource and scope each have their own schema URL, e.g. for logs see https://github.com/open-telemetry/opentelemetry-proto/blob/85e63b1ad6d0667e48707e8c0a88f366e79a68ce/opentelemetry/proto/logs/v1/logs.proto#L62-L64
ottlscope.NewTransformContextPtr takes a single ambiguous "schemaURLItem" without specifying if it's for the scope or resource. The same schema URL ends up being returned for both scope.schema_url and resource.schema_url paths:
|
// GetScopeSchemaURLItem returns the schema URL item for the scope from the TransformContext. |
|
func (tCtx *TransformContext) GetScopeSchemaURLItem() ctxcommon.SchemaURLItem { |
|
return tCtx.schemaURLItem |
|
} |
|
|
|
// GetResourceSchemaURLItem returns the schema URL item for the resource from the TransformContext. |
|
func (tCtx *TransformContext) GetResourceSchemaURLItem() ctxcommon.SchemaURLItem { |
|
return tCtx.schemaURLItem |
|
} |
Collector version
main
Environment information
Environment
N/A
OpenTelemetry Collector configuration
Log output
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Component(s)
pkg/ottl
What happened?
Description
Resource and scope each have their own schema URL, e.g. for logs see https://github.com/open-telemetry/opentelemetry-proto/blob/85e63b1ad6d0667e48707e8c0a88f366e79a68ce/opentelemetry/proto/logs/v1/logs.proto#L62-L64
ottlscope.NewTransformContextPtrtakes a single ambiguous "schemaURLItem" without specifying if it's for the scope or resource. The same schema URL ends up being returned for bothscope.schema_urlandresource.schema_urlpaths:opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope/scope.go
Lines 91 to 99 in 4682913
Collector version
main
Environment information
Environment
N/A
OpenTelemetry Collector configuration
Log output
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.