-
Notifications
You must be signed in to change notification settings - Fork 5k
tracing: Add trace sampling configuration to the route, to override the route level #6986
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a79bd03
tracing: Add trace sampling configuration to the route, to override t…
objectiser 31e4785
Fix format issues
objectiser 8adc41d
Add test check for route tracing config
objectiser 917a845
Fix test
objectiser af128ab
Include details in the version_history
objectiser c89a92f
Fix format
objectiser 69a0441
Change to use FractionalPercent
objectiser 2e19997
Use const ptr to avoid copy, add test for default sampling values and…
objectiser 9d582c3
Change random_sampling default to 100/100, and add TODO comment
objectiser 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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,12 +231,18 @@ HttpConnectionManagerConfig::HttpConnectionManagerConfig( | |
request_headers_for_tags.push_back(Http::LowerCaseString(header)); | ||
} | ||
|
||
uint64_t client_sampling{ | ||
PROTOBUF_PERCENT_TO_ROUNDED_INTEGER_OR_DEFAULT(tracing_config, client_sampling, 100, 100)}; | ||
uint64_t random_sampling{PROTOBUF_PERCENT_TO_ROUNDED_INTEGER_OR_DEFAULT( | ||
tracing_config, random_sampling, 10000, 10000)}; | ||
uint64_t overall_sampling{ | ||
PROTOBUF_PERCENT_TO_ROUNDED_INTEGER_OR_DEFAULT(tracing_config, overall_sampling, 100, 100)}; | ||
envoy::type::FractionalPercent client_sampling; | ||
client_sampling.set_numerator( | ||
tracing_config.has_client_sampling() ? tracing_config.client_sampling().value() : 100); | ||
envoy::type::FractionalPercent random_sampling; | ||
// TODO: Random sampling historically was an integer and default to out of 10,000. We should | ||
// deprecate that and move to a straight fractional percent config. | ||
random_sampling.set_numerator( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Can you add a small TODO/comment here that random sampling historically was an integer and default to out of 10,000 but we should deprecate that and move to a straight fractional percent config? The way we have this now is pretty confusing for historical reasons. |
||
tracing_config.has_random_sampling() ? tracing_config.random_sampling().value() : 10000); | ||
random_sampling.set_denominator(envoy::type::FractionalPercent::TEN_THOUSAND); | ||
envoy::type::FractionalPercent overall_sampling; | ||
overall_sampling.set_numerator( | ||
tracing_config.has_overall_sampling() ? tracing_config.overall_sampling().value() : 100); | ||
|
||
tracing_config_ = | ||
std::make_unique<Http::TracingConnectionManagerConfig>(Http::TracingConnectionManagerConfig{ | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.