Debian Codegraph @

schema/v1.1/testdata/valid-example.yaml

raw
1 file_format: 1.1.0
2
3 schema_url: https://opentelemetry.io/schemas/1.1.0
4
5 versions:
6 1.1.0:
7 # Section "all" applies to attribute names for all data types: resources, spans, logs,
8 # span events, metric labels.
9 #
10 # The translations in "all" section are performed first (for each particular version).
11 # Only after that the translations in the specific section ("resources", "traces",
12 # "metrics" or "logs") that corresponds to the data type are applied.
13 #
14 # The only translation possible in section "all" is renaming of attributes in
15 # versions. For human readability versions are listed in reverse chronological
16 # order, however note that the translations are applied in the order defined by
17 # semver ordering.
18 all:
19 changes:
20 - rename_attributes:
21 attribute_map:
22 # Mapping of attribute names (label names for metrics). The key is the old name
23 # used prior to this version, the value is the new name starting from this version.
24
25 # Rename k8s.* to kubernetes.*
26 k8s.cluster.name: kubernetes.cluster.name
27 k8s.namespace.name: kubernetes.namespace.name
28 k8s.node.name: kubernetes.node.name
29 k8s.node.uid: kubernetes.node.uid
30 k8s.pod.name: kubernetes.pod.name
31 k8s.pod.uid: kubernetes.pod.uid
32 k8s.container.name: kubernetes.container.name
33 k8s.replicaset.name: kubernetes.replicaset.name
34 k8s.replicaset.uid: kubernetes.replicaset.uid
35 k8s.cronjob.name: kubernetes.cronjob.name
36 k8s.cronjob.uid: kubernetes.cronjob.uid
37 k8s.job.name: kubernetes.job.name
38 k8s.job.uid: kubernetes.job.uid
39 k8s.statefulset.name: kubernetes.statefulset.name
40 k8s.statefulset.uid: kubernetes.statefulset.uid
41 k8s.daemonset.name: kubernetes.daemonset.name
42 k8s.daemonset.uid: kubernetes.daemonset.uid
43 k8s.deployment.name: kubernetes.deployment.name
44 k8s.deployment.uid: kubernetes.deployment.uid
45
46 service.namespace: service.namespace.name
47
48 # Like "all" the "resources" section may contain only attribute renaming translations.
49 # The only translation possible in this section is renaming of attributes in
50 # versions.
51 resources:
52 changes:
53 - rename_attributes:
54 attribute_map:
55 # Mapping of attribute names. The key is the old name
56 # used prior to this version, the value is the new name starting from this version.
57 telemetry.auto.version: telemetry.auto_instr.version
58
59 spans:
60 changes:
61 # Sequence of translations to apply to convert the schema from a prior version
62 # to this version. The order in this sequence is important. Translations are
63 # applied from top to bottom in the listed order.
64 - rename_attributes:
65 # Rename attributes of all spans, regardless of span name.
66 # The keys are the old attribute name used prior to this version, the values are
67 # the new attribute name starting from this version.
68 attribute_map:
69 peer.service: peer.service.name
70 apply_to_spans:
71 # apply only to spans named "HTTP GET"
72 - "HTTP GET"
73 span_events:
74 changes:
75 # Sequence of translations to apply to convert the schema from a prior version
76 # to this version. The order in this sequence is important. Translations are
77 # applied from top to bottom in the listed order.
78 - rename_events:
79 # Rename events. The keys are old event names, the values are the new event names.
80 name_map: {exception.stacktrace: exception.stack_trace}
81
82 - rename_attributes:
83 # Rename attributes of events.
84 # The keys are the old attribute name used prior to this version, the values are
85 # the new attribute name starting from this version.
86 attribute_map:
87 peer.service: peer.service.name
88
89 apply_to_events:
90 # Optional event names to apply to. If empty applies to all events.
91 # Conditions in apply_to_spans and apply_to_events are logical AND-ed,
92 # both should match for transformation to be applied.
93 - exception.stack_trace
94
95 metrics:
96 changes:
97 # Sequence of translations to apply to convert the schema from a prior version
98 # to this version. The order in this sequence is important. Translations are
99 # applied from top to bottom in the listed order.
100
101 - rename_attributes:
102 # Rename attributes of all metrics, regardless of metric name.
103 # The keys are the old attribute name used prior to this version, the values are
104 # the new attribute name starting from this version.
105 attribute_map:
106 http.status_code: http.response_status_code
107
108 - rename_metrics:
109 # Rename metrics. The keys are old metric names, the values are the new metric names.
110 container.cpu.usage.total: cpu.usage.total
111 container.memory.usage.max: memory.usage.max
112
113 - rename_attributes:
114 apply_to_metrics:
115 # Name of the metric to apply this rule to. If empty the rule applies to all metrics.
116 - system.cpu.utilization
117 - system.memory.usage
118 - system.memory.utilization
119 - system.paging.usage
120 attribute_map:
121 # The keys are the old attribute name used prior to this version, the values are
122 # the new attribute name starting from this version.
123 status: state
124
125 - split:
126 # Rules to split a metric into several metrics using an attribute for split.
127 # This example rule implements the change done by
128 # https://github.com/open-telemetry/opentelemetry-specification/pull/2617
129 # Name of old metric to split.
130 apply_to_metric: system.paging.operations
131 # Name of attribute in the old metric to use for splitting. The attribute will be
132 # eliminated, the new metric will not have it.
133 by_attribute: direction
134 # Names of new metrics to create, one for each possible value of the attribute.
135 metrics_from_attributes:
136 # If "direction" attribute equals "in" create a new metric called "system.paging.operations.in".
137 system.paging.operations.in: in
138 system.paging.operations.out: out
139
140 logs:
141 changes:
142 - rename_attributes:
143 attribute_map:
144 process.executable_name: process.executable.name
145
146 1.0.0: