Debian Codegraph @

opentelemetry/proto/common/v1/common.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.common.v1;
18
19 option csharp_namespace = "OpenTelemetry.Proto.Common.V1";
20 option java_multiple_files = true;
21 option java_package = "io.opentelemetry.proto.common.v1";
22 option java_outer_classname = "CommonProto";
23 option go_package = "go.opentelemetry.io/proto/otlp/common/v1";
24
25 // AnyValue is used to represent any type of attribute value. AnyValue may contain a
26 // primitive value such as a string or integer or it may contain an arbitrary nested
27 // object containing arrays, key-value lists and primitives.
28 message AnyValue {
29 // The value is one of the listed fields. It is valid for all values to be unspecified
30 // in which case this AnyValue is considered to be "empty".
31 oneof value {
32 string string_value = 1;
33 bool bool_value = 2;
34 int64 int_value = 3;
35 double double_value = 4;
36 ArrayValue array_value = 5;
37 KeyValueList kvlist_value = 6;
38 bytes bytes_value = 7;
39 }
40 }
41
42 // ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
43 // since oneof in AnyValue does not allow repeated fields.
44 message ArrayValue {
45 // Array of values. The array may be empty (contain 0 elements).
46 repeated AnyValue values = 1;
47 }
48
49 // KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
50 // since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
51 // a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
52 // avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
53 // are semantically equivalent.
54 message KeyValueList {
55 // A collection of key/value pairs of key-value pairs. The list may be empty (may
56 // contain 0 elements).
57 // The keys MUST be unique (it is not allowed to have more than one
58 // value with the same key).
59 repeated KeyValue values = 1;
60 }
61
62 // KeyValue is a key-value pair that is used to store Span attributes, Link
63 // attributes, etc.
64 message KeyValue {
65 string key = 1;
66 AnyValue value = 2;
67 }
68
69 // InstrumentationScope is a message representing the instrumentation scope information
70 // such as the fully qualified name and version.
71 message InstrumentationScope {
72 // An empty instrumentation scope name means the name is unknown.
73 string name = 1;
74 string version = 2;
75
76 // Additional attributes that describe the scope. [Optional].
77 // Attribute keys MUST be unique (it is not allowed to have more than one
78 // attribute with the same key).
79 repeated KeyValue attributes = 3;
80 uint32 dropped_attributes_count = 4;
81 }
82
83 // A reference to an Entity.
84 // Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
85 //
86 // Status: [Development]
87 message EntityRef {
88 // The Schema URL, if known. This is the identifier of the Schema that the entity data
89 // is recorded in. To learn more about Schema URL see
90 // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
91 //
92 // This schema_url applies to the data in this message and to the Resource attributes
93 // referenced by id_keys and description_keys.
94 // TODO: discuss if we are happy with this somewhat complicated definition of what
95 // the schema_url applies to.
96 //
97 // This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
98 string schema_url = 1;
99
100 // Defines the type of the entity. MUST not change during the lifetime of the entity.
101 // For example: "service" or "host". This field is required and MUST not be empty
102 // for valid entities.
103 string type = 2;
104
105 // Attribute Keys that identify the entity.
106 // MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
107 // These keys MUST exist in the containing {message}.attributes.
108 repeated string id_keys = 3;
109
110 // Descriptive (non-identifying) attribute keys of the entity.
111 // MAY change over the lifetime of the entity. MAY be empty.
112 // These attribute keys are not part of entity's identity.
113 // These keys MUST exist in the containing {message}.attributes.
114 repeated string description_keys = 4;
115 }