Skip to content

Commit 03bd338

Browse files
authored
OTTL blog: prettier-directives tidy up (#6385)
1 parent ea78cf8 commit 03bd338

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

content/en/blog/2025/ottl-contexts-just-got-easier.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ benefits of context inference while providing granular control over statement
8383
configurations, such as `error_mode` and `conditions`. For example, consider the
8484
following configuration:
8585

86-
<!-- prettier-ignore-start -->
8786
```yaml
8887
metric_statements:
8988
- context: datapoint
@@ -92,35 +91,31 @@ metric_statements:
9291
statements:
9392
- set(metric.description, "counter") where attributes["my.attr"] == "some"
9493
```
95-
<!-- prettier-ignore-end -->
9694

9795
The above can now be written as:
9896

99-
<!-- prettier-ignore-start -->
97+
<!-- prettier-ignore -->
10098
```yaml
10199
metric_statements:
102100
- conditions:
103101
- resource.attributes["service.name"] == "my.service"
104102
statements:
105103
- set(metric.description, "counter") where datapoint.attributes["my.attr"] == "some"
106104
```
107-
<!-- prettier-ignore-end -->
108105

109106
In this example, the `context` value is omitted and is automatically inferred to
110107
`datapoint`, as it is the only OTTL context present in the statements that
111108
supports parsing both `datapoint` and `metric` data.
112109

113110
If we update the above configuration removing the `datapoint` usage:
114111

115-
<!-- prettier-ignore-start -->
116112
```yaml
117113
metric_statements:
118114
- conditions:
119115
- resource.attributes["service.name"] == "my.service"
120116
statements:
121117
- set(metric.description, "counter")
122118
```
123-
<!-- prettier-ignore-end -->
124119

125120
The context inferrer would select the `metric` OTTL context instead, since no
126121
data points are accessed. Although it would be possible to run the statements

0 commit comments

Comments
 (0)