Add trace_config.proto. (#80)
* Add trace_config.proto * Combine AlwaysSampler and NeverSampler. * Make trace_config_proto a separate library.pull/83/head
parent
0857a45d8e
commit
ed45831684
2 changed files with 76 additions and 0 deletions
@ -0,0 +1,61 @@ |
||||
// Copyright 2018, OpenCensus Authors |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package opencensus.proto.trace; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_package = "io.opencensus.proto.trace"; |
||||
option java_outer_classname = "TraceConfigProto"; |
||||
|
||||
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/traceconfigproto"; |
||||
|
||||
// Global configuration of the trace service. |
||||
message TraceConfig { |
||||
|
||||
// The global default sampler used to make decisions on span sampling. |
||||
oneof sampler { |
||||
ProbabilitySampler probability_sampler = 1; |
||||
|
||||
ConstantSampler constant_sampler = 2; |
||||
|
||||
RateLimitingSampler rate_limiting_sampler = 3; |
||||
} |
||||
|
||||
// TODO(songya): add more fields. |
||||
} |
||||
|
||||
// Sampler that tries to uniformly sample traces with a given probability. |
||||
// The probability of sampling a trace is equal to that of the specified probability. |
||||
message ProbabilitySampler { |
||||
|
||||
// The desired probability of sampling. Must be within [0.0, 1.0]. |
||||
double samplingProbability = 1; |
||||
} |
||||
|
||||
// Sampler that makes a constant decision (either always "yes" or always "no") |
||||
// on span sampling. |
||||
message ConstantSampler { |
||||
|
||||
// Whether spans should be always sampled, or never sampled. |
||||
bool decision = 1; |
||||
} |
||||
|
||||
// Sampler that tries to sample with a rate per time window. |
||||
message RateLimitingSampler { |
||||
|
||||
// Rate per second. |
||||
int64 qps = 1; |
||||
} |
Loading…
Reference in new issue