Skip to content

Commit e330632

Browse files
committed
Otel protos for use in interop testing.
1 parent 81110f5 commit e330632

File tree

15 files changed

+2349
-0
lines changed

15 files changed

+2349
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# OpenTelemetry Collector Proto
2+
3+
This package describes the OpenTelemetry collector protocol.
4+
5+
## Packages
6+
7+
1. `common` package contains the common messages shared between different services.
8+
2. `trace` package contains the Trace Service protos.
9+
3. `metrics` package contains the Metrics Service protos.
10+
4. `logs` package contains the Logs Service protos.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2020, OpenTelemetry 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 opentelemetry.proto.collector.logs.v1;
18+
19+
import "opentelemetry/proto/logs/v1/logs.proto";
20+
21+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Logs.V1";
22+
option java_multiple_files = true;
23+
option java_package = "io.opentelemetry.proto.collector.logs.v1";
24+
option java_outer_classname = "LogsServiceProto";
25+
option go_package = "go.opentelemetry.io/proto/otlp/collector/logs/v1";
26+
27+
// Service that can be used to push logs between one Application instrumented with
28+
// OpenTelemetry and an collector, or between an collector and a central collector (in this
29+
// case logs are sent/received to/from multiple Applications).
30+
service LogsService {
31+
rpc Export(ExportLogsServiceRequest) returns (ExportLogsServiceResponse) {}
32+
}
33+
34+
message ExportLogsServiceRequest {
35+
// An array of ResourceLogs.
36+
// For data coming from a single resource this array will typically contain one
37+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
38+
// data from multiple origins typically batch the data before forwarding further and
39+
// in that case this array will contain multiple elements.
40+
repeated opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1;
41+
}
42+
43+
message ExportLogsServiceResponse {
44+
// The details of a partially successful export request.
45+
//
46+
// If the request is only partially accepted
47+
// (i.e. when the server accepts only parts of the data and rejects the rest)
48+
// the server MUST initialize the `partial_success` field and MUST
49+
// set the `rejected_<signal>` with the number of items it rejected.
50+
//
51+
// Servers MAY also make use of the `partial_success` field to convey
52+
// warnings/suggestions to senders even when the request was fully accepted.
53+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
54+
// the `error_message` MUST be non-empty.
55+
//
56+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
57+
// `error_message` = "") is equivalent to it not being set/present. Senders
58+
// SHOULD interpret it the same way as in the full success case.
59+
ExportLogsPartialSuccess partial_success = 1;
60+
}
61+
62+
message ExportLogsPartialSuccess {
63+
// The number of rejected log records.
64+
//
65+
// A `rejected_<signal>` field holding a `0` value indicates that the
66+
// request was fully accepted.
67+
int64 rejected_log_records = 1;
68+
69+
// A developer-facing human-readable message in English. It should be used
70+
// either to explain why the server rejected parts of the data during a partial
71+
// success or to convey warnings/suggestions during a full success. The message
72+
// should offer guidance on how users can address such issues.
73+
//
74+
// error_message is an optional field. An error_message with an empty value
75+
// is equivalent to it not being set.
76+
string error_message = 2;
77+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
2+
# OpenTelemetry service using github.com/grpc-ecosystem/grpc-gateway.
3+
type: google.api.Service
4+
config_version: 3
5+
http:
6+
rules:
7+
- selector: opentelemetry.proto.collector.logs.v1.LogsService.Export
8+
post: /v1/logs
9+
body: "*"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2019, OpenTelemetry 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 opentelemetry.proto.collector.metrics.v1;
18+
19+
import "opentelemetry/proto/metrics/v1/metrics.proto";
20+
21+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Metrics.V1";
22+
option java_multiple_files = true;
23+
option java_package = "io.opentelemetry.proto.collector.metrics.v1";
24+
option java_outer_classname = "MetricsServiceProto";
25+
option go_package = "go.opentelemetry.io/proto/otlp/collector/metrics/v1";
26+
27+
// Service that can be used to push metrics between one Application
28+
// instrumented with OpenTelemetry and a collector, or between a collector and a
29+
// central collector.
30+
service MetricsService {
31+
rpc Export(ExportMetricsServiceRequest) returns (ExportMetricsServiceResponse) {}
32+
}
33+
34+
message ExportMetricsServiceRequest {
35+
// An array of ResourceMetrics.
36+
// For data coming from a single resource this array will typically contain one
37+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
38+
// data from multiple origins typically batch the data before forwarding further and
39+
// in that case this array will contain multiple elements.
40+
repeated opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
41+
}
42+
43+
message ExportMetricsServiceResponse {
44+
// The details of a partially successful export request.
45+
//
46+
// If the request is only partially accepted
47+
// (i.e. when the server accepts only parts of the data and rejects the rest)
48+
// the server MUST initialize the `partial_success` field and MUST
49+
// set the `rejected_<signal>` with the number of items it rejected.
50+
//
51+
// Servers MAY also make use of the `partial_success` field to convey
52+
// warnings/suggestions to senders even when the request was fully accepted.
53+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
54+
// the `error_message` MUST be non-empty.
55+
//
56+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
57+
// `error_message` = "") is equivalent to it not being set/present. Senders
58+
// SHOULD interpret it the same way as in the full success case.
59+
ExportMetricsPartialSuccess partial_success = 1;
60+
}
61+
62+
message ExportMetricsPartialSuccess {
63+
// The number of rejected data points.
64+
//
65+
// A `rejected_<signal>` field holding a `0` value indicates that the
66+
// request was fully accepted.
67+
int64 rejected_data_points = 1;
68+
69+
// A developer-facing human-readable message in English. It should be used
70+
// either to explain why the server rejected parts of the data during a partial
71+
// success or to convey warnings/suggestions during a full success. The message
72+
// should offer guidance on how users can address such issues.
73+
//
74+
// error_message is an optional field. An error_message with an empty value
75+
// is equivalent to it not being set.
76+
string error_message = 2;
77+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
2+
# OpenTelemetry service using github.com/grpc-ecosystem/grpc-gateway.
3+
type: google.api.Service
4+
config_version: 3
5+
http:
6+
rules:
7+
- selector: opentelemetry.proto.collector.metrics.v1.MetricsService.Export
8+
post: /v1/metrics
9+
body: "*"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright 2023, OpenTelemetry 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 opentelemetry.proto.collector.profiles.v1development;
18+
19+
import "opentelemetry/proto/profiles/v1development/profiles.proto";
20+
21+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Profiles.V1Development";
22+
option java_multiple_files = true;
23+
option java_package = "io.opentelemetry.proto.collector.profiles.v1development";
24+
option java_outer_classname = "ProfilesServiceProto";
25+
option go_package = "go.opentelemetry.io/proto/otlp/collector/profiles/v1development";
26+
27+
// Service that can be used to push profiles between one Application instrumented with
28+
// OpenTelemetry and a collector, or between a collector and a central collector.
29+
service ProfilesService {
30+
rpc Export(ExportProfilesServiceRequest) returns (ExportProfilesServiceResponse) {}
31+
}
32+
33+
message ExportProfilesServiceRequest {
34+
// An array of ResourceProfiles.
35+
// For data coming from a single resource this array will typically contain one
36+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
37+
// data from multiple origins typically batch the data before forwarding further and
38+
// in that case this array will contain multiple elements.
39+
repeated opentelemetry.proto.profiles.v1development.ResourceProfiles resource_profiles = 1;
40+
41+
// The reference table containing all data shared by profiles across the message being sent.
42+
opentelemetry.proto.profiles.v1development.ProfilesDictionary dictionary = 2;
43+
}
44+
45+
message ExportProfilesServiceResponse {
46+
// The details of a partially successful export request.
47+
//
48+
// If the request is only partially accepted
49+
// (i.e. when the server accepts only parts of the data and rejects the rest)
50+
// the server MUST initialize the `partial_success` field and MUST
51+
// set the `rejected_<signal>` with the number of items it rejected.
52+
//
53+
// Servers MAY also make use of the `partial_success` field to convey
54+
// warnings/suggestions to senders even when the request was fully accepted.
55+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
56+
// the `error_message` MUST be non-empty.
57+
//
58+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
59+
// `error_message` = "") is equivalent to it not being set/present. Senders
60+
// SHOULD interpret it the same way as in the full success case.
61+
ExportProfilesPartialSuccess partial_success = 1;
62+
}
63+
64+
message ExportProfilesPartialSuccess {
65+
// The number of rejected profiles.
66+
//
67+
// A `rejected_<signal>` field holding a `0` value indicates that the
68+
// request was fully accepted.
69+
int64 rejected_profiles = 1;
70+
71+
// A developer-facing human-readable message in English. It should be used
72+
// either to explain why the server rejected parts of the data during a partial
73+
// success or to convey warnings/suggestions during a full success. The message
74+
// should offer guidance on how users can address such issues.
75+
//
76+
// error_message is an optional field. An error_message with an empty value
77+
// is equivalent to it not being set.
78+
string error_message = 2;
79+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
2+
# OpenTelemetry service using github.com/grpc-ecosystem/grpc-gateway.
3+
type: google.api.Service
4+
config_version: 3
5+
http:
6+
rules:
7+
- selector: opentelemetry.proto.collector.profiles.v1development.ProfilesService.Export
8+
post: /v1development/profiles
9+
body: "*"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2019, OpenTelemetry 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 opentelemetry.proto.collector.trace.v1;
18+
19+
import "opentelemetry/proto/trace/v1/trace.proto";
20+
21+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Trace.V1";
22+
option java_multiple_files = true;
23+
option java_package = "io.opentelemetry.proto.collector.trace.v1";
24+
option java_outer_classname = "TraceServiceProto";
25+
option go_package = "go.opentelemetry.io/proto/otlp/collector/trace/v1";
26+
27+
// Service that can be used to push spans between one Application instrumented with
28+
// OpenTelemetry and a collector, or between a collector and a central collector (in this
29+
// case spans are sent/received to/from multiple Applications).
30+
service TraceService {
31+
rpc Export(ExportTraceServiceRequest) returns (ExportTraceServiceResponse) {}
32+
}
33+
34+
message ExportTraceServiceRequest {
35+
// An array of ResourceSpans.
36+
// For data coming from a single resource this array will typically contain one
37+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
38+
// data from multiple origins typically batch the data before forwarding further and
39+
// in that case this array will contain multiple elements.
40+
repeated opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1;
41+
}
42+
43+
message ExportTraceServiceResponse {
44+
// The details of a partially successful export request.
45+
//
46+
// If the request is only partially accepted
47+
// (i.e. when the server accepts only parts of the data and rejects the rest)
48+
// the server MUST initialize the `partial_success` field and MUST
49+
// set the `rejected_<signal>` with the number of items it rejected.
50+
//
51+
// Servers MAY also make use of the `partial_success` field to convey
52+
// warnings/suggestions to senders even when the request was fully accepted.
53+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
54+
// the `error_message` MUST be non-empty.
55+
//
56+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
57+
// `error_message` = "") is equivalent to it not being set/present. Senders
58+
// SHOULD interpret it the same way as in the full success case.
59+
ExportTracePartialSuccess partial_success = 1;
60+
}
61+
62+
message ExportTracePartialSuccess {
63+
// The number of rejected spans.
64+
//
65+
// A `rejected_<signal>` field holding a `0` value indicates that the
66+
// request was fully accepted.
67+
int64 rejected_spans = 1;
68+
69+
// A developer-facing human-readable message in English. It should be used
70+
// either to explain why the server rejected parts of the data during a partial
71+
// success or to convey warnings/suggestions during a full success. The message
72+
// should offer guidance on how users can address such issues.
73+
//
74+
// error_message is an optional field. An error_message with an empty value
75+
// is equivalent to it not being set.
76+
string error_message = 2;
77+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
2+
# OpenTelemetry service using github.com/grpc-ecosystem/grpc-gateway.
3+
type: google.api.Service
4+
config_version: 3
5+
http:
6+
rules:
7+
- selector: opentelemetry.proto.collector.trace.v1.TraceService.Export
8+
post: /v1/traces
9+
body: "*"

0 commit comments

Comments
 (0)