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
15syntax = "proto3";
16
17// NOTE: This proto is experimental and is subject to change at this point.
18// Please do not use it at the moment.
19
20package opencensus.proto.agent.trace.v1;
21
22import "opencensus/proto/agent/common/v1/common.proto";
23import "opencensus/proto/resource/v1/resource.proto";
24import "opencensus/proto/trace/v1/trace.proto";
25import "opencensus/proto/trace/v1/trace_config.proto";
26
27option java_multiple_files = true;
28option java_package = "io.opencensus.proto.agent.trace.v1";
29option java_outer_classname = "TraceServiceProto";
30
31option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1";
32
33option ruby_package = "OpenCensus.Proto.Agent.Trace.V1";
34
35// Service that can be used to push spans and configs between one Application
36// instrumented with OpenCensus and an agent, or between an agent and a
37// central collector or config service (in this case spans and configs are
38// sent/received to/from multiple Applications).
39service TraceService {
40  // After initialization, this RPC must be kept alive for the entire life of
41  // the application. The agent pushes configs down to applications via a
42  // stream.
43  rpc Config(stream CurrentLibraryConfig) returns (stream UpdatedLibraryConfig) {}
44
45  // For performance reasons, it is recommended to keep this RPC
46  // alive for the entire life of the application.
47  rpc Export(stream ExportTraceServiceRequest) returns (stream ExportTraceServiceResponse) {}
48}
49
50message CurrentLibraryConfig {
51  // This is required only in the first message on the stream or if the
52  // previous sent CurrentLibraryConfig message has a different Node (e.g.
53  // when the same RPC is used to configure multiple Applications).
54  opencensus.proto.agent.common.v1.Node node = 1;
55
56  // Current configuration.
57  opencensus.proto.trace.v1.TraceConfig config = 2;
58}
59
60message UpdatedLibraryConfig {
61  // This field is ignored when the RPC is used to configure only one Application.
62  // This is required only in the first message on the stream or if the
63  // previous sent UpdatedLibraryConfig message has a different Node.
64  opencensus.proto.agent.common.v1.Node node = 1;
65
66  // Requested updated configuration.
67  opencensus.proto.trace.v1.TraceConfig config = 2;
68}
69
70message ExportTraceServiceRequest {
71  // This is required only in the first message on the stream or if the
72  // previous sent ExportTraceServiceRequest message has a different Node (e.g.
73  // when the same RPC is used to send Spans from multiple Applications).
74  opencensus.proto.agent.common.v1.Node node = 1;
75
76  // A list of Spans that belong to the last received Node.
77  repeated opencensus.proto.trace.v1.Span spans = 2;
78
79  // The resource for the spans in this message that do not have an explicit
80  // resource set.
81  // If unset, the most recently set resource in the RPC stream applies. It is
82  // valid to never be set within a stream, e.g. when no resource info is known.
83  opencensus.proto.resource.v1.Resource resource = 3;
84}
85
86message ExportTraceServiceResponse {
87}
88