tracing icon indicating copy to clipboard operation
tracing copied to clipboard

JSON output: spans as object instead of array

Open jakajancar opened this issue 2 years ago • 0 comments

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:

  1. you can not have nested spans with the same name, and
  2. 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.

jakajancar avatar Jul 01 '22 19:07 jakajancar