|
| 1 | +// Copyright 2018, OpenCensus Authors |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package opencensus.proto.trace; |
| 18 | + |
| 19 | +option java_multiple_files = true; |
| 20 | +option java_package = "io.opencensus.proto.trace"; |
| 21 | +option java_outer_classname = "TraceConfigProto"; |
| 22 | + |
| 23 | +option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/traceconfigproto"; |
| 24 | + |
| 25 | +// Global configuration of the trace service. |
| 26 | +message TraceConfig { |
| 27 | + |
| 28 | + // The global default sampler used to make decisions on span sampling. |
| 29 | + oneof sampler { |
| 30 | + ProbabilitySampler probability_sampler = 1; |
| 31 | + |
| 32 | + ConstantSampler constant_sampler = 2; |
| 33 | + |
| 34 | + RateLimitingSampler rate_limiting_sampler = 3; |
| 35 | + } |
| 36 | + |
| 37 | + // TODO(songya): add more fields. |
| 38 | +} |
| 39 | + |
| 40 | +// Sampler that tries to uniformly sample traces with a given probability. |
| 41 | +// The probability of sampling a trace is equal to that of the specified probability. |
| 42 | +message ProbabilitySampler { |
| 43 | + |
| 44 | + // The desired probability of sampling. Must be within [0.0, 1.0]. |
| 45 | + double samplingProbability = 1; |
| 46 | +} |
| 47 | + |
| 48 | +// Sampler that makes a constant decision (either always "yes" or always "no") |
| 49 | +// on span sampling. |
| 50 | +message ConstantSampler { |
| 51 | + |
| 52 | + // Whether spans should be always sampled, or never sampled. |
| 53 | + bool decision = 1; |
| 54 | +} |
| 55 | + |
| 56 | +// Sampler that tries to sample with a rate per time window. |
| 57 | +message RateLimitingSampler { |
| 58 | + |
| 59 | + // Rate per second. |
| 60 | + int64 qps = 1; |
| 61 | +} |
0 commit comments