You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[processor/transform] Add new configuration styles documentation (#37753)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
#29017
<!--Please delete paragraphs that you did not use before submitting.-->
---------
Co-authored-by: Evan Bradley <[email protected]>
Copy file name to clipboardExpand all lines: pkg/ottl/LANGUAGE.md
+8-6
Original file line number
Diff line number
Diff line change
@@ -118,22 +118,24 @@ Values are passed as function parameters or are used in a Boolean Expression. Va
118
118
119
119
### Paths
120
120
121
-
A Path Value is a reference to a telemetry field. Paths are made up of lowercase identifiers, dots (`.`), and square brackets combined with a string key (`["key"]`) or int key (`[0]`). **The interpretation of a Path is NOT implemented by OTTL.** Instead, the user must provide a `PathExpressionParser` that OTTL can use to interpret paths. As a result, how the Path parts are used is up to the user. However, it is recommended that the parts be used like so:
121
+
A Path Value is a reference to a telemetry field. Paths are composed of lowercase identifiers, dots (`.`), and square brackets containing either a string key (`["key"]`), an integer key (`[0]`), or an expression that might be a [Converter](#converters) or another Path.
122
+
**The interpretation of a Path is NOT implemented by OTTL**. Instead, users must provide a `PathExpressionParser` that OTTL can use to interpret paths.
123
+
As a result, the usage of Path segments is determined by the user. However, it is recommended to use them as follows:
122
124
123
125
- Identifiers are used to map to a telemetry field.
124
-
- Dots (`.`) are used to separate nested fields.
126
+
- Dots (`.`) are used to separate nested fields, please note that the first path segment is interpreted by OTTL as the context identifier.
125
127
- Square brackets and keys (`["key"]`) are used to access values within maps.
126
128
127
129
When accessing a map's value, if the given key does not exist, `nil` will be returned.
128
130
This can be used to check for the presence of a key within a map within a [Boolean Expression](#boolean-expressions).
Copy file name to clipboardExpand all lines: pkg/ottl/contexts/ottllog/README.md
+23-20
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# Log Context
2
2
3
+
> [!NOTE]
4
+
> This documentation applies only to version `0.120.0` and later. For information on earlier versions, please refer to the previous [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/release/0.119.x/pkg/ottl/contexts/ottllog/README.md).
5
+
3
6
The Log Context is a Context implementation for [pdata Logs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/pdata/plog), the collector's internal representation for OTLP log data. This Context should be used when interacted with OTLP logs.
4
7
5
8
## Paths
@@ -11,8 +14,8 @@ The following paths are supported.
| cache| the value of the current transform context's temporary cache. cache can be used as a temporary placeholder for data during complex transformations | pcommon.Map |
15
-
| cache\[""\]| the value of an item in cache. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
17
+
|log.cache | the value of the current transform context's temporary cache. cache can be used as a temporary placeholder for data during complex transformations | pcommon.Map |
18
+
|log.cache\[""\]| the value of an item in cache. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
16
19
| resource | resource of the log being processed | pcommon.Resource |
17
20
| resource.attributes | resource attributes of the log being processed | pcommon.Map |
18
21
| resource.attributes\[""\]| the value of the resource attribute of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
@@ -23,24 +26,24 @@ The following paths are supported.
23
26
| instrumentation_scope.dropped_attributes_count | number of dropped attributes of the instrumentation scope of the log being processed | int64 |
24
27
| instrumentation_scope.attributes | instrumentation scope attributes of the data point being processed | pcommon.Map |
25
28
| instrumentation_scope.attributes\[""\]| the value of the instrumentation scope attribute of the data point being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
26
-
| attributes| attributes of the log being processed | pcommon.Map |
27
-
| attributes\[""\]| the value of the attribute of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
28
-
| trace_id| a byte slice representation of the trace id | pcommon.TraceID |
29
-
| trace_id.string| a string representation of the trace id | string |
30
-
| span_id| a byte slice representation of the span id | pcommon.SpanID |
31
-
| span_id.string| a string representation of the span id | string |
32
-
| time_unix_nano| the time in unix nano of the log being processed | int64 |
33
-
| observed_time_unix_nano| the observed time in unix nano of the log being processed | int64 |
34
-
| time| the time in `time.Time` of the log being processed |`time.Time`|
35
-
| observed_time| the observed time in `time.Time` of the log being processed |`time.Time`|
36
-
| severity_number | the severity numbner of the log being processed | int64 |
37
-
| severity_text| the severity text of the log being processed | string |
38
-
| body| the body of the log being processed | any |
39
-
| body\[""\]| a value in a map body of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
40
-
| body\[\]| a value in a slice body of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
41
-
| body.string| the body of the log being processed represented as a string. When setting must pass a string. | string |
42
-
| dropped_attributes_count| the number of dropped attributes of the log being processed | int64 |
43
-
| flags| the flags of the log being processed | int64 |
29
+
|log.attributes | attributes of the log being processed | pcommon.Map |
30
+
|log.attributes\[""\]| the value of the attribute of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
31
+
|log.trace_id | a byte slice representation of the trace id | pcommon.TraceID |
32
+
|log.trace_id.string | a string representation of the trace id | string |
33
+
|log.span_id | a byte slice representation of the span id | pcommon.SpanID |
34
+
|log.span_id.string | a string representation of the span id | string |
35
+
|log.time_unix_nano | the time in unix nano of the log being processed | int64 |
36
+
|log.observed_time_unix_nano | the observed time in unix nano of the log being processed | int64 |
37
+
|log.time | the time in `time.Time` of the log being processed |`time.Time`|
38
+
|log.observed_time | the observed time in `time.Time` of the log being processed |`time.Time`|
39
+
|log.severity_number | the severity number of the log being processed| int64 |
40
+
|log.severity_text | the severity text of the log being processed | string |
41
+
|log.body | the body of the log being processed | any |
42
+
|log.body\[""\]| a value in a map body of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
43
+
|log.body\[\]| a value in a slice body of the log being processed. Supports multiple indexes to access nested fields. | string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil |
44
+
|log.body.string | the body of the log being processed represented as a string. When setting must pass a string. | string |
45
+
|log.dropped_attributes_count | the number of dropped attributes of the log being processed | int64 |
46
+
|log.flags | the flags of the log being processed | int64 |
0 commit comments