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

Add docs for sampling #88

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions proto/api_v2/sampling.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,53 @@ enum SamplingStrategyType {
RATE_LIMITING = 1;
};

// ProbabilisticSamplingStrategy defines TraceIdRatioBased sampler configuration.
message ProbabilisticSamplingStrategy {
// // Sampling rate between [0-1].
double samplingRate = 1;
}

// RateLimitingSamplingStrategy defines RateLimiting sampling configuration.
message RateLimitingSamplingStrategy {
// Traces per second.
int32 maxTracesPerSecond = 1;
}

// OperationSamplingStrategy defines sampling configuration for a given operation/span name.
message OperationSamplingStrategy {
// Operation name is a span name.
string operation = 1;
// Probabilistic sampler configuration.
ProbabilisticSamplingStrategy probabilisticSampling = 2;
}

// PerOperationSamplingStrategies defines sampling configuration for operations/span (names).
message PerOperationSamplingStrategies {
// Default sampling probability for TraceIdRatioBased sampler.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yurishkuro I think comments in this type need more explanation.

The per-operation config is clear - it is used if names match, if name does not match does it fallback to the probabilistic and rate limiting sampler? Is the rate limiting sampler used first until a specified throughput is satisfied and then it is switched to probabilistic?

double defaultSamplingProbability = 1;
// Default lower bound for RateLimiting sampler.
double defaultLowerBoundTracesPerSecond = 2;
// Per operation/span (name) sampling configuration.
repeated OperationSamplingStrategy perOperationStrategies = 3;
// Default upper bound for rate limiting sampler.
double defaultUpperBoundTracesPerSecond = 4;
}

// SamplingStrategyResponse defines sampling configuration for a service.
message SamplingStrategyResponse {
SamplingStrategyType strategyType = 1;
ProbabilisticSamplingStrategy probabilisticSampling = 2;
RateLimitingSamplingStrategy rateLimitingSampling = 3;
PerOperationSamplingStrategies operationSampling =4;
}

// SamplingStrategyParameters defines request parameters for remote sampler.
message SamplingStrategyParameters {
// Service name.
string serviceName = 1;
}

// SamplingManager defines service for the remote sampler.
service SamplingManager {
rpc GetSamplingStrategy(SamplingStrategyParameters) returns (SamplingStrategyResponse) {
option (google.api.http) = {
Expand Down