Add trace_config.proto. (#80)

* Add trace_config.proto

* Combine AlwaysSampler and NeverSampler.

* Make trace_config_proto a separate library.
pull/83/head
Yang Song 6 years ago committed by GitHub
parent 0857a45d8e
commit ed45831684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      opencensus/proto/trace/BUILD.bazel
  2. 61
      opencensus/proto/trace/trace_config.proto

@ -23,12 +23,27 @@ proto_library(
],
)
proto_library(
name = "trace_config_proto",
srcs = ["trace_config.proto"],
)
cc_proto_library(
name = "trace_proto_cc",
deps = [":trace_proto"],
)
cc_proto_library(
name = "trace_config_proto_cc",
deps = [":trace_config_proto"],
)
java_proto_library(
name = "trace_proto_java",
deps = [":trace_proto"],
)
java_proto_library(
name = "trace_config_proto_java",
deps = [":trace_config_proto"],
)

@ -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…
Cancel
Save