-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Namespace prebuild tracing tags #8648
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Project, for example, is a first class domain property which exists in other features. It feels odd to namespace it with
prebuild
. This effectively prevents tracing across services and features.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.
@easyCZ I agree. But it's hard to get this right if you want to follow the "separate by domain" pattern. Like, in this case that would give:
But:
IMO it's easier to follow the "namespace by span/function" pattern, except for very generic use cases (we do that for Owner/Workspace/Instance in GitpodServerImpl, for instance). Lookup works surprisingly well - you have the code open for that mostly anyways.
BTW, here's a document started by @mads-hartmann on the topic of naming convetions. I bet he has an opinion on this as well 😉
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.
How to namespace your attributes depends on how you'd like to query for it.
COUNT where user.id = "foobar" group by name
. A query like that is only possible if we useuser.id
for the user id everywhere.startPrebuild.cloneURL
. When you write your Honeycomb query you can then doCOUNT where name = startPrebuild, startPrebuild.<autocomplete>
and it will show all the attributes that it has ever seen for that span. If we didn't namespace it then you'd have to know attributes might be available on the span, e.g. thatcontext.cloneURL
happens to be a valid attribute for that spanSo for this PR I would use the
startPrebuild
namespace for all the attributes (so renameprebuild
tostartPrebuild
). If you believe the use-case (1) is valid for any of the attributes then just add those as well. A bit of duplication is fine, we pay per event, not by the number of attributes.If you do add a new top-level namespace please do update the document though!☺️
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.
From my experience, I'd actually expect both to work. Let me elaborate:
I would indeed expect to be able to find all interactions by a given user, or everything related to a given workspace. Here I'd use the
user.id
orworkspace.id
fields.But I'd also expect to be able to drill deeper and get all prebuild (startPrebuild) traces and do operations on them which aggregate over (or away) the
user.id
orworkspace.id
fields. I'd expect to query this with a more specific tag -component: prebuild
or something along the lines. This would be yet another field which helps me go deeper. Each span could then also have very custom attributes of course but those would be required to be namespaced as I wouldn't expect these to be cross-cutting, or have semantics outside of a givencomponent: prebuild
trace.I'm happy to follow whichever guidence you provide as I don't yet have enough context but it feels we're preventing ourselves from leveraging some features of distributed tracing.
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.
We are not, it's a trade-off. If you want to get discoverability of what attributes are available on a specific span as you write your query for that specific span, then have to go with (2).
If you want to find all spans for a specific entity go with (1).
If you need both, go with (1) and (2).
In my experience, when you're debugging you're mostly trying to figure out why a specific operation (span) is slow. For that you want to run some aggregates over all of those spans and do some grouping on the attributes to help you drill down. So providing a good experience when writing queries of the form
<AGGREGATE> WHERE name = startPrebuild GROUP BY startPrebuild.XXX <CODE COMPLETE>
is a worthwhile thing to optimise for.And as I said, you can just add both startPrebuild.context.id and context.id. A bit of duplication doesn't hurt.☺️