-
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
Optionally record why a sample decision was made #503
Conversation
bbe58bb
to
4b5d31b
Compare
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.
Overall, looks good. I've left some minor feedback 👍🏻
What do you think about a consistent template for reason strings?
eg
"deterministic/always"
"deterministic/chance"
"totalthroughput/{key}"
"dynamic/{key}"
"emadynamic/{key}"
"rules/span/{rule_name}"
"rules/trace/no_rule"
"rules/invalid_scope/{rule_name}
config_complete.toml
Outdated
# AddRuleReasonToTrace causes traces that are sent to Honeycomb to include a field `meta.refinery.reason`, | ||
# which will contain text indicating which rule was evaluated that caused the trace to be included. |
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.
# AddRuleReasonToTrace causes traces that are sent to Honeycomb to include a field `meta.refinery.reason`, | |
# which will contain text indicating which rule was evaluated that caused the trace to be included. | |
# AddRuleReasonToTrace causes traces that are sent to Honeycomb to include the field `meta.refinery.reason`, | |
# that contains text indicating which rule was evaluated that caused the trace to be included. |
collect/collect.go
Outdated
@@ -456,7 +456,7 @@ func (i *InMemCollector) send(trace *types.Trace) { | |||
} | |||
|
|||
// make sampling decision and update the trace | |||
rate, shouldSend := sampler.GetSampleRate(trace) | |||
rate, shouldSend, why := sampler.GetSampleRate(trace) |
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.
nit: for consistency, could we also call the result parameter reason? (This would incur a few changes throughout the PR)
I like all of your suggestions. Thanks, will implement. |
92145de
to
b5965f0
Compare
## Which problem is this PR solving? - Fixes honeycombio#473 ## Short description of the changes - Adds a config flag, `AddRuleReasonToTrace` that adds a new field to traces called `meta.refinery.reason`, which is a string field that contains information about the sampler(s) that made a trace decision. If it was a rule-based sampler, it includes the rule name. - Also removes unnecessary build flags that were causing tests not to run. - Updates README and config file
Which problem is this PR solving?
Short description of the changes
AddRuleReasonToTrace
that adds a new field to traces calledmeta.refinery.reason
, which is a string field that contains information about the sampler(s) that made a trace decision. If it was a rule-based sampler, it includes the rule name.