-
Notifications
You must be signed in to change notification settings - Fork 95
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
Track span count and optionally add it to root #532
Merged
Merged
Conversation
This file contains 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
kentquirk
force-pushed
the
kent.add_span_count
branch
from
October 3, 2022 18:53
a319e19
to
77a31ed
Compare
kentquirk
added
type: enhancement
New feature or request
version: bump minor
A PR that adds behavior, but is backwards-compatible.
labels
Oct 5, 2022
TylerHelmuth
reviewed
Oct 5, 2022
@kentquirk looks like there are some build issues. Rerunning them didn't work. |
TylerHelmuth
reviewed
Oct 6, 2022
TylerHelmuth
approved these changes
Oct 6, 2022
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
seh
reviewed
Nov 7, 2022
@@ -68,6 +68,11 @@ func (t *Trace) GetSpans() []*Span { | |||
return t.spans | |||
} | |||
|
|||
// SpanCount gets the number of spans currently in this trace as int64 | |||
func (t *Trace) SpanCount() int64 { | |||
return int64(len(t.spans)) |
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.
See #555 for correcting the reported value.
ghost
pushed a commit
to opsramp/tracing-proxy
that referenced
this pull request
Jul 5, 2024
## Which problem is this PR solving? Adds the ability to add the trace's span count to the root span of the trace, and does it in a way that allows the rules engine to query it as `meta.span_count`. This would allow rules that depend on span count -- for example, a rule that adjusts sample rate so that larger traces are kept less often. Note that this value is not available if the root span hasn't arrived when the TraceTimeout completes; at this point, the rules will be evaluated without a `span_count` because there is no root span to put it on. If the root span arrives late, it will be updated with the total number of spans that have arrived at that point, so that the value stored in Honeycomb is close to correct. If more spans arrive later, they will not update the value in the root span. Closes honeycombio#524 Closes honeycombio#483
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: enhancement
New feature or request
version: bump minor
A PR that adds behavior, but is backwards-compatible.
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.
Which problem is this PR solving?
Adds the ability to add the trace's span count to the root span of the trace, and does it in a way that allows the rules engine to query it as
meta.span_count
. This would allow rules that depend on span count -- for example, a rule that adjusts sample rate so that larger traces are kept less often.Note that this value is not available if the root span hasn't arrived when the TraceTimeout completes; at this point, the rules will be evaluated without a
span_count
because there is no root span to put it on.If the root span arrives late, it will be updated with the total number of spans that have arrived at that point, so that the value stored in Honeycomb is close to correct. If more spans arrive later, they will not update the value in the root span.
Closes #524
Closes #483