Debian Codegraph @

third-party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.proto

raw
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 }