Skip to content

Commit

Permalink
Port client types to protobuf for future development
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Hier <isaachier@gmail.com>
  • Loading branch information
isaachier committed Nov 23, 2017
1 parent 3ddea89 commit 89cbcb8
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 0 deletions.
22 changes: 22 additions & 0 deletions protobuf/agent.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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 jaegertracing.protobuf.agent;

import "jaeger.proto";

service Agent {
rpc EmitBatch(stream Batch) returns (Empty);
}
32 changes: 32 additions & 0 deletions protobuf/baggage.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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 jaegertracing.protobuf.baggage;

import "jaeger.proto";

message BaggageRestriction {
string baggage_key = 1;
int32 max_value_length = 2;
}

message BaggageRestrictionResponse {
repeated BaggageRestriction restrictions = 1;
}

service BaggageRestrictionManager {
rpc GetBaggageRestrictions (ServiceRequest) returns
(BaggageRestrictionResponse);
}
62 changes: 62 additions & 0 deletions protobuf/crossdock/tracetest.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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 jaegertracing.protobuf.crossdock;

enum Transport {
HTTP = 0;
TCHANNEL = 1;
DUMMY = 2;
}

message Downstream {
string service_name = 1;
string server_role = 2;
string host = 3;
string port = 4;
Transport transport = 5;
}

message StartTraceRequest {
string server_role = 1;
bool sampled = 2;
string baggage = 3;
repeated Downstream downstream = 4;
}

message JoinTraceRequest {
string server_role = 1;
repeated Downstream downstream = 2;
}

message ObservedSpan {
string trace_id = 1;
bool sampled = 2;
string baggage = 3;
}

message DownstreamResponse {
ObservedSpan observed_span = 1;
string not_implemented_error = 2;
}

message TraceResponse {
repeated DownstreamResponse responses = 1;
}

service TracedService {
rpc StartTrace (StartTraceRequest) returns (TraceResponse);
rpc JoinTrace (JoinTraceRequest) returns (TraceResponse);
}
81 changes: 81 additions & 0 deletions protobuf/jaeger.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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 jaegertracing.protobuf;

message Empty {};

message ServiceRequest {
string service_name = 1;
}

message Tag {
string key = 1;
oneof value {
string str_value = 2;
double double_value = 3;
bool bool_value = 4;
int64 long_value = 5;
bytes binary_value = 6;
}
}

message Log {
int64 timestamp = 1;
repeated Tag fields = 2;
}

message SpanRef {
enum Type {
CHILD_OF = 0;
FOLLOWS_FROM = 1;
}
Type type = 1;
uint64 trace_id_high = 2;
uint64 trace_id_low = 3;
uint64 span_id = 4;
}

message Span {
uint64 trace_id_high = 1;
uint64 trace_id_low = 2;
uint64 span_id = 3;
uint64 parent_span_id = 4;
string operation_name = 5;
repeated SpanRef references = 6;
int32 flags = 7;
int64 start_time = 8;
int64 duration = 9;
repeated Tag tags = 10;
repeated Log logs = 11;
}

message Process {
string service_name = 1;
repeated Tag tags = 2;
}

message Batch {
Process process = 1;
repeated Span spans = 2;
}

message BatchResponse {
bool ok = 1;
};

service Collector {
rpc SubmitBatches (stream Batch) returns (stream BatchResponse);
}
57 changes: 57 additions & 0 deletions protobuf/sampling.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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 jaegertracing.protobuf.sampling_manager;

import "jaeger.proto";

message ProbabilisticSamplingStrategy {
double sampling_rate = 1;
}

message RateLimitingSamplingStrategy {
int32 max_traces_per_seconds = 1;
}

message SamplingStrategy {
oneof strategy {
ProbabilisticSamplingStrategy probabilistic = 1;
RateLimitingSamplingStrategy rate_limiting = 2;
}
}

message OperationSamplingStrategy {
string operation = 1;
SamplingStrategy strategy = 2;
}

message PerOperationSamplingStrategy {
double default_sampling_probability = 1;
double default_lower_bound_traces_per_second = 2;
repeated OperationSamplingStrategy per_operation_strategy = 3;
double default_upper_bound_traces_per_second = 4;
}

message SamplingStrategyResponse {
oneof strategy {
ProbabilisticSamplingStrategy probabilistic = 1;
RateLimitingSamplingStrategy rate_limiting = 2;
PerOperationSamplingStrategy per_operation = 3;
}
}

service SamplingManager {
rpc GetSamplingStrategy (ServiceRequest) returns (SamplingStrategyResponse);
}

0 comments on commit 89cbcb8

Please sign in to comment.