@@ -130,3 +130,24 @@ metrics:
130
130
traces:
131
131
set(attributes["test-passed"], true) where attributes["target-attribute"] != nil
132
132
```
133
+
134
+ ## Troubleshooting
135
+
136
+ When using OTTL you can enable debug logging in the collector to print out useful information,
137
+ such as the current Statement/Condition and the current TransformContext, to help you troubleshoot
138
+ why a statement is not behaving as you expect. This feature is very verbose, but provides you an accurate
139
+ view into how OTTL views the underlying data.
140
+
141
+ ``` yaml
142
+ service :
143
+ telemetry :
144
+ logs :
145
+ level : debug
146
+ ` ` `
147
+
148
+ ` ` `
149
+ 2024-05-29T16:38:09.600-0600 debug [email protected] /parser.go:265 initial TransformContext {"kind" :
" processor" , "name": "transform", "pipeline": "logs", "TransformContext": {"resource": {"attributes": {}, "dropped_attribute_count": 0}, "scope": {"attributes": {}, "dropped_attribute_count": 0, "name": "", "version": ""}, "log_record": {"attributes": {"log.file.name": "test.log"}, "body": "test", "dropped_attribute_count": 0, "flags": 0, "observed_time_unix_nano": 1717022289500721000, "severity_number": 0, "severity_text": "", "span_id": "", "time_unix_nano": 0, "trace_id": ""}, "cache": {}}}
150
+ 2024-05-29T16:38:09.600-0600 debug [email protected] /parser.go:268 TransformContext after statement execution {"kind" :
" processor" , "name": "transform", "pipeline": "logs", "statement": "set(resource.attributes[\"test\"], \"pass\")", "condition matched": true, "TransformContext": {"resource": {"attributes": {"test": "pass"}, "dropped_attribute_count": 0}, "scope": {"attributes": {}, "dropped_attribute_count": 0, "name": "", "version": ""}, "log_record": {"attributes": {"log.file.name": "test.log"}, "body": "test", "dropped_attribute_count": 0, "flags": 0, "observed_time_unix_nano": 1717022289500721000, "severity_number": 0, "severity_text": "", "span_id": "", "time_unix_nano": 0, "trace_id": ""}, "cache": {}}}
151
+ 2024-05-29T16:38:09.600-0600 debug [email protected] /parser.go:268 TransformContext after statement execution {"kind" :
" processor" , "name": "transform", "pipeline": "logs", "statement": "set(instrumentation_scope.attributes[\"test\"], [\"pass\"])", "condition matched": true, "TransformContext": {"resource": {"attributes": {"test": "pass"}, "dropped_attribute_count": 0}, "scope": {"attributes": {"test": ["pass"]}, "dropped_attribute_count": 0, "name": "", "version": ""}, "log_record": {"attributes": {"log.file.name": "test.log"}, "body": "test", "dropped_attribute_count": 0, "flags": 0, "observed_time_unix_nano": 1717022289500721000, "severity_number": 0, "severity_text": "", "span_id": "", "time_unix_nano": 0, "trace_id": ""}, "cache": {}}}
152
+ 2024-05-29T16:38:09.601-0600 debug [email protected] /parser.go:268 TransformContext after statement execution {"kind" :
" processor" , "name": "transform", "pipeline": "logs", "statement": "set(attributes[\"test\"], true)", "condition matched": true, "TransformContext": {"resource": {"attributes": {"test": "pass"}, "dropped_attribute_count": 0}, "scope": {"attributes": {"test": ["pass"]}, "dropped_attribute_count": 0, "name": "", "version": ""}, "log_record": {"attributes": {"log.file.name": "test.log", "test": true}, "body": "test", "dropped_attribute_count": 0, "flags": 0, "observed_time_unix_nano": 1717022289500721000, "severity_number": 0, "severity_text": "", "span_id": "", "time_unix_nano": 0, "trace_id": ""}, "cache": {}}}
153
+ ` ` `
0 commit comments