-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add protobuf via gRPC exporting support for Jaeger (#1471)
- Loading branch information
1 parent
8ebd6c8
commit bd8db6e
Showing
26 changed files
with
5,308 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
exporter/opentelemetry-exporter-jaeger/proto/api_v2/collector.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) 2019 The Jaeger Authors. | ||
// Copyright (c) 2018 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 jaeger.api_v2; | ||
|
||
import "model.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "protoc-gen-swagger/options/annotations.proto"; | ||
|
||
option go_package = "api_v2"; | ||
option java_package = "io.jaegertracing.api_v2"; | ||
|
||
// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). | ||
// Enable custom Marshal method. | ||
option (gogoproto.marshaler_all) = true; | ||
// Enable custom Unmarshal method. | ||
option (gogoproto.unmarshaler_all) = true; | ||
// Enable custom Size method (Required by Marshal and Unmarshal). | ||
option (gogoproto.sizer_all) = true; | ||
// Enable registration with golang/protobuf for the grpc-gateway. | ||
option (gogoproto.goproto_registration) = true; | ||
|
||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { | ||
info: { | ||
version: "1.0"; | ||
}; | ||
external_docs: { | ||
url: "https://github.com/jaegertracing/jaeger"; | ||
description: "Jaeger API"; | ||
} | ||
schemes: HTTP; | ||
schemes: HTTPS; | ||
}; | ||
|
||
message PostSpansRequest { | ||
Batch batch = 1 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message PostSpansResponse { | ||
} | ||
|
||
service CollectorService { | ||
rpc PostSpans(PostSpansRequest) returns (PostSpansResponse) { | ||
option (google.api.http) = { | ||
post: "/api/v2/spans" | ||
body: "*" | ||
}; | ||
} | ||
} |
166 changes: 166 additions & 0 deletions
166
exporter/opentelemetry-exporter-jaeger/proto/api_v2/model.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
// Copyright (c) 2018 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 jaeger.api_v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "google/protobuf/duration.proto"; | ||
|
||
// TODO: document all types and fields | ||
|
||
// TODO: once this moves to jaeger-idl repo, we may want to change Go pkg to api_v2 | ||
// and rewrite it to model only in this repo. That should make it easier to generate | ||
// classes in other languages. | ||
option go_package = "model"; | ||
option java_package = "io.jaegertracing.api_v2"; | ||
|
||
// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). | ||
// Enable custom Marshal method. | ||
option (gogoproto.marshaler_all) = true; | ||
// Enable custom Unmarshal method. | ||
option (gogoproto.unmarshaler_all) = true; | ||
// Enable custom Size method (Required by Marshal and Unmarshal). | ||
option (gogoproto.sizer_all) = true; | ||
// Enable registration with golang/protobuf for the grpc-gateway. | ||
option (gogoproto.goproto_registration) = true; | ||
|
||
enum ValueType { | ||
STRING = 0; | ||
BOOL = 1; | ||
INT64 = 2; | ||
FLOAT64 = 3; | ||
BINARY = 4; | ||
}; | ||
|
||
message KeyValue { | ||
option (gogoproto.equal) = true; | ||
option (gogoproto.compare) = true; | ||
|
||
string key = 1; | ||
ValueType v_type = 2; | ||
string v_str = 3; | ||
bool v_bool = 4; | ||
int64 v_int64 = 5; | ||
double v_float64 = 6; | ||
bytes v_binary = 7; | ||
} | ||
|
||
message Log { | ||
google.protobuf.Timestamp timestamp = 1 [ | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.nullable) = false | ||
]; | ||
repeated KeyValue fields = 2 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
enum SpanRefType { | ||
CHILD_OF = 0; | ||
FOLLOWS_FROM = 1; | ||
}; | ||
|
||
message SpanRef { | ||
bytes trace_id = 1 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "TraceID", | ||
(gogoproto.customname) = "TraceID" | ||
]; | ||
bytes span_id = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "SpanID", | ||
(gogoproto.customname) = "SpanID" | ||
]; | ||
SpanRefType ref_type = 3; | ||
} | ||
|
||
message Process { | ||
string service_name = 1; | ||
repeated KeyValue tags = 2 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message Span { | ||
bytes trace_id = 1 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "TraceID", | ||
(gogoproto.customname) = "TraceID" | ||
]; | ||
bytes span_id = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "SpanID", | ||
(gogoproto.customname) = "SpanID" | ||
]; | ||
string operation_name = 3; | ||
repeated SpanRef references = 4 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
uint32 flags = 5 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "Flags" | ||
]; | ||
google.protobuf.Timestamp start_time = 6 [ | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.nullable) = false | ||
]; | ||
google.protobuf.Duration duration = 7 [ | ||
(gogoproto.stdduration) = true, | ||
(gogoproto.nullable) = false | ||
]; | ||
repeated KeyValue tags = 8 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
repeated Log logs = 9 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
Process process = 10; | ||
string process_id = 11 [ | ||
(gogoproto.customname) = "ProcessID" | ||
]; | ||
repeated string warnings = 12; | ||
} | ||
|
||
message Trace { | ||
message ProcessMapping { | ||
string process_id = 1 [ | ||
(gogoproto.customname) = "ProcessID" | ||
]; | ||
Process process = 2 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
repeated Span spans = 1; | ||
repeated ProcessMapping process_map = 2 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
repeated string warnings = 3; | ||
} | ||
|
||
message Batch { | ||
repeated Span spans = 1; | ||
Process process = 2 [ | ||
(gogoproto.nullable) = true | ||
]; | ||
} | ||
|
||
message DependencyLink { | ||
string parent = 1; | ||
string child = 2; | ||
uint64 call_count = 3; | ||
string source = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.