Skip to content

Commit

Permalink
Rename "labels" to "attributes" OTEP 0152 (open-telemetry#181)
Browse files Browse the repository at this point in the history
Fixes open-telemetry#1989

OTEP 0152 predates renaming of labels to attributes in the spec. Unfortunately
the schema file format still uses the term "label" in the metrics section this way:
```yaml
    metrics:
      changes:
        - rename_labels:
            label_map:
              # map of key/values. The keys are the old label name used
              # in the previous version, the values are the new label name
              # starting from this version.

            apply_to_metrics:
              # Optional. If it is missing the transformation is applied
              # to all metrics. If it is present the transformation is applied
              # only to the metrics with the name that is found in the sequence
              # specified below.
```

We don't want the word `label` in the schema files, instead we want the word
`attribute` to be used instead.

Discussed in spec meeting, decided:
- OTEPs which are not part of the spec repo are not considered to be final,
  or be an actual part of stable spec (OTEPs are not labeled "stable" in any way).
- Modify the OTEP, rename `label` to `attribute` (this commit).
- Merge the OTEP with the spec.
  • Loading branch information
tigrannajaryan authored and carlosalberto committed Oct 7, 2021
1 parent 4711ccc commit a8dead6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions text/0152-telemetry-schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* [rename_attributes Transformation](#rename_attributes-transformation-1)
* [metrics Section](#metrics-section)
* [rename_metrics Transformation](#rename_metrics-transformation)
* [rename_labels Transformation](#rename_labels-transformation)
* [rename_attributes Transformation](#rename_attributes-transformation)
* [logs Section](#logs-section)
* [rename_attributes Transformation](#rename_attributes-transformation-2)
* [Order of Transformations](#order-of-transformations)
Expand All @@ -44,8 +44,8 @@
Telemetry sources such as instrumented applications and consumers of telemetry
such as observability backends sometimes make implicit assumptions about the
emitted telemetry. They assume that the telemetry will contain certain
attributes or labels or otherwise have a certain shape and composition of data
(this is referred to as "telemetry schema" throughout this document).
attributes or otherwise have a certain shape and composition of data (this is
referred to as "telemetry schema" throughout this document).

This makes it difficult or impossible to change the composition of the emitted
telemetry data without breaking the consumers. For example changing the name of
Expand Down Expand Up @@ -334,7 +334,7 @@ the new name of the attribute starting from this version. Here is the structure:

The transformations in section "all" apply to the following telemetry data:
resource attributes, span attributes, span event attributes, log attributes,
metric labels.
metric attributes.

Important: when converting from the previous version to the current version the
transformation sequence in section "all" is performed first. After that the
Expand Down Expand Up @@ -448,7 +448,7 @@ defines a sequence of actions to be applied to convert metrics from the previous
version to this version.

Two transformations are supported for section "metrics": "rename_metrics" and
"rename_labels".
"rename_attributes".

#### rename_metrics Transformation

Expand All @@ -464,18 +464,18 @@ Here is the structure:
# starting from this version.
```

#### rename_labels Transformation
#### rename_attributes Transformation

This is similar to the "rename_attributes" transformation supported in "span"
sections. Here is the structure:

```yaml
metrics:
changes:
- rename_labels:
label_map:
# map of key/values. The keys are the old label name used
# in the previous version, the values are the new label name
- rename_attributes:
attribute_map:
# map of key/values. The keys are the old attribute name used
# in the previous version, the values are the new attribute name
# starting from this version.

apply_to_metrics:
Expand Down Expand Up @@ -842,7 +842,7 @@ The benchmark does the following:
conventions were renamed.
- Uses data composed of batches of 100 spans each with 10 attributes or 100
metric data points (Int64 Gauge type) with 2 labels per data point. Each batch
metric data points (Int64 Gauge type) with 2 attributes per data point. Each batch
is associated with one resource that has 20 attributes.
Here are the benchmark results:
Expand Down Expand Up @@ -1151,8 +1151,8 @@ versions:
container.cpu.usage.total: cpu.usage.total
container.memory.usage.max: memory.usage.max

- rename_labels:
label_map:
- rename_attributes:
attribute_map:
status: state
apply_to_metrics:
# Optional. If it is missing the transformation is applied
Expand Down

0 comments on commit a8dead6

Please sign in to comment.