tracing
tracing copied to clipboard
JSON output: spans as object instead of array
Feature Request
A setting that changes the JSON output from:
spans: [ {"name":"foo", ...}, {"name":"bar", ...} ]
to:
spans: { "foo": {...}, "bar": {...} }
Crates
tracing-subscriber
Motivation
Being able to access all the fields ($.spans.foo.my_field
) and filter by them in tools like CloudWatch Logs.
I realize this has two limitations:
- you can not have nested spans with the same name, and
- you do not care about the order of the spans OR you have a JSON implementation that guarantees element order in objects.
Alternatives
- Dumb string match when searching for logs 🫢
- Use single level of spans.