Closed chrismanning closed 2 years ago
Could you instead add another struct field for the span fields with #[serde(flatten)]
? This way, we can avoid some allocations.
Could you instead add another struct field for the span fields with
#[serde(flatten)]
? This way, we can avoid some allocations.
Good call. Done that now.
I did also have a question: what's the purpose of having both labels and extra_fields in the Layer? It was my understanding that you would define labels as application-level attributes, then define fields in spans or directly in events. What would you use the extra_fields in Layer for?
Thanks!
I did also have a question: what's the purpose of having both labels and extra_fields in the Layer? It was my understanding that you would define labels as application-level attributes, then define fields in spans or directly in events. What would you use the extra_fields in Layer for?
The idea is that labels should only be used for attributes that have a small amount of values, according to the Loki documentation. For stuff like a randomly generated run ID or a CI run number, this is inadequate because they have an infinite amount of possible values.
Do you need a new release with this commit?
Thanks!
I did also have a question: what's the purpose of having both labels and extra_fields in the Layer? It was my understanding that you would define labels as application-level attributes, then define fields in spans or directly in events. What would you use the extra_fields in Layer for?
The idea is that labels should only be used for attributes that have a small amount of values, according to the Loki documentation. For stuff like a randomly generated run ID or a CI run number, this is inadequate because they have an infinite amount of possible values.
Understood, thanks for the response.
Do you need a new release with this commit?
Yes please. It's not urgent though as I can point at the git repo directly in the mean time.
Released a new version tracing-loki 0.2.0
on crates.io. Sorry for the delay, when I tried publishing it last I got sidetracked looking up how to write a proper changelog.
I noticed that the fields on spans weren't appearing in Loki when I could see them in the console output while testing. Had a look in the code and saw that the span fields were being accumulated but were not sent along with the rest of the event data.