forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Create a topK table and do sampling based on the number of requests. #14
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
31 commits
Select commit
Hold shift + click to select a range
836680d
add stream_summary with space saving algorithm
samohte ccc5812
add simple getSamplingKey() method
samohte 3e852c1
fix initialization: remove (unintentionally) duplicated line
samohte f817c13
add timer to query topK()
samohte a1d5a77
add initial unit test
samohte 927e026
extend checks in validate(), extend unit test
samohte 507c8ed
Add Sampling controller (currently not funcitonal)
samohte c489c0a
add initial unit test, minor cleanup
samohte 41e283c
fix calling shouldSample().
samohte 92c8bc7
Use calculated sampling exponent for sampling
samohte b956bff
set pathInfo in tracestate (only root path random set)
samohte 612835b
FW4Tag handling: change parsing, rename variable, add unit tests
samohte e3abd62
add required synchronization (via mutex)
samohte 3533704
extend test
samohte 6f79690
move creation of SamplerConfigFetcher out of DynatraceSampler to allow
samohte 3793a67
SamplerConfig: reset to default value as fallback if no value was
samohte eb3b1e4
extend test
samohte 4c736e8
add test cases
samohte 0af49f4
change Locking, add unit test, introduce constant for streamSummary size
samohte 875e35c
introduce MAX_SAMPLING_EXPONENT
samohte 815f363
add debug log
samohte 3585ce1
move getSamplingKey() to SamplingController, add unit test
samohte 0b7c239
split sampling_controller into .h and .cc file
samohte 2298fee
move stream_summary from DynaTraceSampler to SamplingController
samohte e9c9841
calculate exponent as fallback to handle warmup phase
samohte 996aa44
cleanup unit test
samohte ecd8336
remove tenant_id_ and cluster_id_ (unintentionally re-added during re…
samohte 9f4fd46
add calculateTenantId() to allow to set tenant instead of tenant_id in
samohte ca06322
rename tenant_id -> tenant
samohte 1c33d1f
extract tenant id calculation to allow unit testing
samohte 2b883a0
implement review feedback, move class DynatraceTag from header to cc …
samohte 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
28 changes: 28 additions & 0 deletions
28
source/extensions/tracers/opentelemetry/samplers/dynatrace/sampler_config.cc
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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #include <utility> | ||
|
|
||
| #include "source/common/json/json_loader.h" | ||
| #include "source/extensions/tracers/opentelemetry/samplers/dynatrace/sampler_config_fetcher.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace Tracers { | ||
| namespace OpenTelemetry { | ||
|
|
||
| void SamplerConfig::parse(const std::string& json) { | ||
| const auto result = Envoy::Json::Factory::loadFromStringNoThrow(json); | ||
| if (result.ok()) { | ||
| const auto& obj = result.value(); | ||
| if (obj->hasObject("rootSpansPerMinute")) { | ||
| const auto value = obj->getInteger("rootSpansPerMinute", ROOT_SPANS_PER_MINUTE_DEFAULT); | ||
| root_spans_per_minute_.store(value); | ||
|
samohte marked this conversation as resolved.
|
||
| return; | ||
| } | ||
| } | ||
| // didn't get a value, reset to default | ||
| root_spans_per_minute_.store(ROOT_SPANS_PER_MINUTE_DEFAULT); | ||
| } | ||
|
|
||
| } // namespace OpenTelemetry | ||
| } // namespace Tracers | ||
| } // namespace Extensions | ||
| } // namespace Envoy | ||
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
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.