Skip to content

Commit 4b60b81

Browse files
authored
Add new profile signal (#534)
This is a follow up to [OTEP 239: Introduces Profiling Data Model v2](open-telemetry/oteps#239) The main motivation behind this PR is that this will allow us to start experimenting with the profiles proto in opentelemetry-collector. I marked the profiles part as `Experimental` to indicate that this is not a final version of the data model. I copied the proto from the OTEP, and moved `pprofextended.proto` from `profiles/v1/alternatives/pprofextended.proto` to just `profiles/v1/pprofextended.proto`. I did this because I figured we no longer have alternative representations and this will reduce confusion for people outside of Profiling SIG. The rest of the proto stayed the same. I tested this file with a collector fork and I it compiles properly.
1 parent 342e1d4 commit 4b60b81

File tree

5 files changed

+665
-0
lines changed

5 files changed

+665
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ components as indicated by the Maturity table below.
4343
| metrics/\*<br>collector/metrics/* | Stable | [Stable](docs/specification.md#json-protobuf-encoding) |
4444
| trace/\*<br>collector/trace/* | Stable | [Stable](docs/specification.md#json-protobuf-encoding) |
4545
| logs/\*<br>collector/logs/* | Stable | [Stable](docs/specification.md#json-protobuf-encoding) |
46+
| profiles/\*<br>collector/profiles/* | Experimental | [Experimental](docs/specification.md#json-protobuf-encoding) |
4647

4748
(See [maturity-matrix.yaml](https://github.com/open-telemetry/community/blob/47813530864b9fe5a5146f466a58bd2bb94edc72/maturity-matrix.yaml#L57)
4849
for definition of maturity levels).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.v1experimental;
18+
19+
import "opentelemetry/proto/profiles/v1experimental/profiles.proto";
20+
21+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Profiles.V1Experimental";
22+
option java_multiple_files = true;
23+
option java_package = "io.opentelemetry.proto.collector.profiles.v1experimental";
24+
option java_outer_classname = "ProfilesServiceProto";
25+
option go_package = "go.opentelemetry.io/proto/otlp/collector/profiles/v1experimental";
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+
// For performance reasons, it is recommended to keep this RPC
31+
// alive for the entire life of the application.
32+
rpc Export(ExportProfilesServiceRequest) returns (ExportProfilesServiceResponse) {}
33+
}
34+
35+
message ExportProfilesServiceRequest {
36+
// An array of ResourceProfiles.
37+
// For data coming from a single resource this array will typically contain one
38+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
39+
// data from multiple origins typically batch the data before forwarding further and
40+
// in that case this array will contain multiple elements.
41+
repeated opentelemetry.proto.profiles.v1experimental.ResourceProfiles resource_profiles = 1;
42+
}
43+
44+
message ExportProfilesServiceResponse {
45+
// The details of a partially successful export request.
46+
//
47+
// If the request is only partially accepted
48+
// (i.e. when the server accepts only parts of the data and rejects the rest)
49+
// the server MUST initialize the `partial_success` field and MUST
50+
// set the `rejected_<signal>` with the number of items it rejected.
51+
//
52+
// Servers MAY also make use of the `partial_success` field to convey
53+
// warnings/suggestions to senders even when the request was fully accepted.
54+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
55+
// the `error_message` MUST be non-empty.
56+
//
57+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
58+
// `error_message` = "") is equivalent to it not being set/present. Senders
59+
// SHOULD interpret it the same way as in the full success case.
60+
ExportProfilesPartialSuccess partial_success = 1;
61+
}
62+
63+
message ExportProfilesPartialSuccess {
64+
// The number of rejected profiles.
65+
//
66+
// A `rejected_<signal>` field holding a `0` value indicates that the
67+
// request was fully accepted.
68+
int64 rejected_profiles = 1;
69+
70+
// A developer-facing human-readable message in English. It should be used
71+
// either to explain why the server rejected parts of the data during a partial
72+
// success or to convey warnings/suggestions during a full success. The message
73+
// should offer guidance on how users can address such issues.
74+
//
75+
// error_message is an optional field. An error_message with an empty value
76+
// is equivalent to it not being set.
77+
string error_message = 2;
78+
}
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.v1.ProfilesService.Export
8+
post: /v1experimental/profiles
9+
body: "*"

0 commit comments

Comments
 (0)