-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[Unified Waterfall] Add support for coloring OTel spans with the 'kind' field #230836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
spanType?: string; | ||
kind?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if it would be possible to not have these two fields in the unified waterfall interface. By having both fields the waterfall now "knows" between otel and apm documents differences.
Do you think we could join these two fields in one? Maybe keeping only kind
becasue it's an otel field. We'd then color the waterfal based on the service.name or the kind (that could be both spanType (APM docs) or kind (Otel docs)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fields mean two different things. There is a proposal to add something more like span.type
to OpenTelemetry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this!
I was thinking about this before starting the work, I even considered just adding kind
to the spanType
to avoid making too many changes. But then I thought OTel users would probably prefer to see the data shown and named the way it really is.
That said, you’re right, the Waterfall shouldn’t really care where the data comes from. It should just build the UI based on the data it gets.
When we worked on the span failure/error display, we first handled it differently depending on the data source, but in the end we made it generic enough so the Waterfall didn’t need to know about that, it all came down to how we passed the data in.
I’ll be doing some changes to keep the Waterfall simple in the same way.
The only thing I’d like to keep is showing “Kind” or “Type” as the legend title, depending on what we’re showing. Using the same label for different things across APM and OTel could be confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cauemarcondes details about the changed approach explained here.
…span-kind-in-waterfall-legend-otel-only
…span-kind-in-waterfall-legend-otel-only
After this comment, I decided to go with a simpler approach and just use a To ensure the APM behavior hasn’t been negatively impacted, here are a few different use cases:
Regarding the legend title, I decided to keep just the "Type" label to avoid overcomplicating the logic. That said, if anyone strongly disagrees, I'm happy to revisit the solution and explore a dynamic alternative. However, that would likely require introducing a different kind of configuration for the legend, rather than relying on this new single Changes done in acf82c4 |
💔 Build Failed
Failed CI StepsHistory
cc @iblancof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Closes #228239
This PR improves the waterfall UI for non-processed OTel data in traces that belong to a single service by adding support for the
kind
field to determine item coloring. When there are multiple services, the legend and coloring continue to be based onservice.name
.For APM / processed OTel, if an item in the waterfall doesn’t have a
span.type
orspan.subtype
, we normally use theservice.name
in the legend, because transactions can miss these fields. However, for non-processed OTel tracing, every span always includes akind
field, so there’s no need to fall back toservice.name
in this case.How to test
trace.id
of any resulting trace and run another query to fetch any document with thattrace.id