1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-26 03:52:03 +02:00
opentelemetry-go/schema/v1.0/testdata/valid-example.yaml
Tigran Najaryan 36b444a589
Add missing apply_to_spans section support (#2301)
This bug was uncovered during spec review here:
https://github.com/open-telemetry/opentelemetry-specification/pull/2008#discussion_r731359448

apply_to_spans section was missing although it is implied to
be present in the description of how span changes section
is supposed to work.

This fixes the omission by adding apply_to_spans section.
This is not a new feature, just fixing a bug in file format description
and in the corresponding implementation.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-10-25 12:28:41 -04:00

130 lines
5.7 KiB
YAML

file_format: 1.0.0
schema_url: https://opentelemetry.io/schemas/1.1.0
versions:
1.1.0:
# Section "all" applies to attributes names for all data types: resources, spans, logs,
# span events, metric labels.
#
# The translations in "all" section are performed first (for each particular version).
# Only after that the translations in the specific section ("resources", "traces",
# "metrics" or "logs") that corresponds to the data type are applied.
#
# The only translation possible in section "all" is renaming of attributes in
# versions. For human readability versions are listed in reverse chronological
# order, however note that the translations are applied in the order defined by
# semver ordering.
all:
changes:
- rename_attributes:
# 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.
# Rename k8s.* to kubernetes.*
k8s.cluster.name: kubernetes.cluster.name
k8s.namespace.name: kubernetes.namespace.name
k8s.node.name: kubernetes.node.name
k8s.node.uid: kubernetes.node.uid
k8s.pod.name: kubernetes.pod.name
k8s.pod.uid: kubernetes.pod.uid
k8s.container.name: kubernetes.container.name
k8s.replicaset.name: kubernetes.replicaset.name
k8s.replicaset.uid: kubernetes.replicaset.uid
k8s.cronjob.name: kubernetes.cronjob.name
k8s.cronjob.uid: kubernetes.cronjob.uid
k8s.job.name: kubernetes.job.name
k8s.job.uid: kubernetes.job.uid
k8s.statefulset.name: kubernetes.statefulset.name
k8s.statefulset.uid: kubernetes.statefulset.uid
k8s.daemonset.name: kubernetes.daemonset.name
k8s.daemonset.uid: kubernetes.daemonset.uid
k8s.deployment.name: kubernetes.deployment.name
k8s.deployment.uid: kubernetes.deployment.uid
service.namespace: service.namespace.name
# Like "all" the "resources" section may contain only attribute renaming translations.
# The only translation possible in this section is renaming of attributes in
# versions.
resources:
changes:
- rename_attributes:
# 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
spans:
changes:
# Sequence of translations to apply to convert the schema from a prior version
# to this version. The order in this sequence is important. Translations are
# applied from top to bottom in the listed order.
- rename_attributes:
# Rename attributes of all spans, regardless of span name.
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
attribute_map:
peer.service: peer.service.name
apply_to_spans:
# apply only to spans named "HTTP GET"
- "HTTP GET"
span_events:
changes:
# Sequence of translations to apply to convert the schema from a prior version
# to this version. The order in this sequence is important. Translations are
# applied from top to bottom in the listed order.
- rename_events:
# Rename events. The keys are old event names, the values are the new event names.
name_map: {exception.stacktrace: exception.stack_trace}
- rename_attributes:
# Rename attributes of events.
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
attribute_map:
peer.service: peer.service.name
apply_to_events:
# Optional event names to apply to. If empty applies to all events.
# Conditions in apply_to_spans and apply_to_events are logical AND-ed,
# both should match for transformation to be applied.
- exception.stack_trace
metrics:
changes:
# Sequence of translations to apply to convert the schema from a prior version
# to this version. The order in this sequence is important. Translations are
# applied from top to bottom in the listed order.
- rename_attributes:
# Rename attributes of all metrics, regardless of metric name.
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
attribute_map:
http.status_code: http.response_status_code
- rename_metrics:
# Rename metrics. The keys are old metric names, the values are the new metric names.
container.cpu.usage.total: cpu.usage.total
container.memory.usage.max: memory.usage.max
- rename_attributes:
apply_to_metrics:
# Name of the metric to apply this rule to. If empty the rule applies to all metrics.
- system.cpu.utilization
- system.memory.usage
- system.memory.utilization
- system.paging.usage
attribute_map:
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
status: state
logs:
changes:
- rename_attributes:
attribute_map:
process.executable_name: process.executable.name
1.0.0: