You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-17 01:12:45 +02:00
Fix incorrect "all" and "resource" definition for Schema File (#3777)
The "all" and "resource" sections had incorrect definitions of "attribute_rename" transform. It was missing the subkey "attribute_map". This is a bug fix and makes the implementation compliant with the spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/schemas/file_format_v1.1.0.md#resources-section Related issue: https://github.com/open-telemetry/opentelemetry-specification/issues/3245 Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@ -51,6 +51,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
- Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743)
|
||||
- Data race issue in OTLP exporter retry mechanism. (#3756)
|
||||
- Fixes wrapping a nil error in some cases (#????)
|
||||
- Fix incorrect "all" and "resource" definition for Schema File (#3777)
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
@ -52,5 +52,5 @@ type Attributes struct {
|
||||
|
||||
// AttributeChange corresponds to a section representing attribute changes.
|
||||
type AttributeChange struct {
|
||||
RenameAttributes *AttributeMap `yaml:"rename_attributes"`
|
||||
RenameAttributes *RenameAttributes `yaml:"rename_attributes"`
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ func TestParseSchemaFile(t *testing.T) {
|
||||
All: ast.Attributes{
|
||||
Changes: []ast.AttributeChange{
|
||||
{
|
||||
RenameAttributes: &ast.AttributeMap{
|
||||
RenameAttributes: &ast.RenameAttributes{
|
||||
AttributeMap: ast.AttributeMap{
|
||||
"k8s.cluster.name": "kubernetes.cluster.name",
|
||||
"k8s.namespace.name": "kubernetes.namespace.name",
|
||||
"k8s.node.name": "kubernetes.node.name",
|
||||
@ -64,16 +65,19 @@ func TestParseSchemaFile(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Resources: ast.Attributes{
|
||||
Changes: []ast.AttributeChange{
|
||||
{
|
||||
RenameAttributes: &ast.AttributeMap{
|
||||
RenameAttributes: &ast.RenameAttributes{
|
||||
AttributeMap: ast.AttributeMap{
|
||||
"telemetry.auto.version": "telemetry.auto_instr.version",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Spans: ast.Spans{
|
||||
Changes: []ast.SpansChange{
|
||||
|
2
schema/v1.0/testdata/valid-example.yaml
vendored
2
schema/v1.0/testdata/valid-example.yaml
vendored
@ -18,6 +18,7 @@ versions:
|
||||
all:
|
||||
changes:
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
# Mapping of attribute names (label names for metrics). The key is the old name
|
||||
# used prior to this version, the value is the new name starting from this version.
|
||||
|
||||
@ -50,6 +51,7 @@ versions:
|
||||
resources:
|
||||
changes:
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
# Mapping of attribute names. The key is the old name
|
||||
# used prior to this version, the value is the new name starting from this version.
|
||||
telemetry.auto.version: telemetry.auto_instr.version
|
||||
|
@ -40,7 +40,8 @@ func TestParseSchemaFile(t *testing.T) {
|
||||
All: ast10.Attributes{
|
||||
Changes: []ast10.AttributeChange{
|
||||
{
|
||||
RenameAttributes: &ast10.AttributeMap{
|
||||
RenameAttributes: &ast10.RenameAttributes{
|
||||
AttributeMap: ast10.AttributeMap{
|
||||
"k8s.cluster.name": "kubernetes.cluster.name",
|
||||
"k8s.namespace.name": "kubernetes.namespace.name",
|
||||
"k8s.node.name": "kubernetes.node.name",
|
||||
@ -65,16 +66,19 @@ func TestParseSchemaFile(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Resources: ast10.Attributes{
|
||||
Changes: []ast10.AttributeChange{
|
||||
{
|
||||
RenameAttributes: &ast10.AttributeMap{
|
||||
RenameAttributes: &ast10.RenameAttributes{
|
||||
AttributeMap: ast10.AttributeMap{
|
||||
"telemetry.auto.version": "telemetry.auto_instr.version",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Spans: ast10.Spans{
|
||||
Changes: []ast10.SpansChange{
|
||||
|
@ -6,5 +6,6 @@ versions:
|
||||
all:
|
||||
changes:
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
k8s.cluster.name: kubernetes.cluster.name
|
||||
1.0.0:
|
||||
|
2
schema/v1.1/testdata/valid-example.yaml
vendored
2
schema/v1.1/testdata/valid-example.yaml
vendored
@ -18,6 +18,7 @@ versions:
|
||||
all:
|
||||
changes:
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
# Mapping of attribute names (label names for metrics). The key is the old name
|
||||
# used prior to this version, the value is the new name starting from this version.
|
||||
|
||||
@ -50,6 +51,7 @@ versions:
|
||||
resources:
|
||||
changes:
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
# Mapping of attribute names. The key is the old name
|
||||
# used prior to this version, the value is the new name starting from this version.
|
||||
telemetry.auto.version: telemetry.auto_instr.version
|
||||
|
Reference in New Issue
Block a user