Skip to content
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

Prototype of an adaptive sampler based on peer.service #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlosalberto
Copy link
Owner

Prototype of an adaptive sampler, which uses the upstream service information stored in TraceState (us entry filled with service.name), in order to keep proportional samples for each calling service, trying too reduce under-representation. Non-optimized (i.e. uses a single gigantic lock), but presented here to validate (or not) how helpful propagating upstream service can be.

This takes a little inspiration from this Software Runtime Monitoring with Adaptive Sampling paper, and doing the following:

  1. Use a general sampling ratio to do the general sampling (using TraceIdRatioSampler for simplicity purposes).
  2. Define a specific time cycle, during which the total and per-service requests and samples are counted. Every time the cycle is elapsed, the counts are reset.
  3. We use the counts from 2) to check whether we have enough representation for the currently processed trace's service, and it not, and if the sample decision is RECORD_AND_SAMPLE (from 1), go ahead and do sample the trace, and else drop it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant