Al
04/02/2024, 12:14 AMtransform:
trace_statements:
- context: span
statements:
- replace_pattern(events.attributes["exception.message"], "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", "{UUID}")
An example span in clickhouse events column contains:
┬─events─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬
['{
"name": "exception",
"timeUnixNano": 1712015182708514000,
"attributeMap": {
"exception.message": "Error occured: key NotFound for object f777277a-694f-4444-a3f0-5e60386c01c7",
"exception.stacktrace": "System.Exception: Error occured key notfound NotFound for object f777277a-694f-4444-a3f0-5e60386c01c7",
"exception.type": "System.Exception"
},
"isError": true
}']
I'm unsure if the complexity of the regex is not supported, or the way I'm attempting to locate the exception message events.attributes["exception.message"]
is wrong. Thanks for any help.Al
04/20/2024, 3:03 AMevents.attributes
type is `ptrace.SpanEventSlice`and the replace functions of transform expect pcommon.Map
In order to transform events.attributes
, you must use trace_statements.context: spanevent
and replace on attributes
.