| 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 |
// Represents 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 |
// Reference to the string value in ProfilesDictionary.string_table. |
| 40 |
// |
| 41 |
// Note: This is currently used exclusively in the Profiling signal. |
| 42 |
// Implementers of OTLP receivers for signals other than Profiling should |
| 43 |
// treat the presence of this value as a non-fatal issue. |
| 44 |
// Log an error or warning indicating an unexpected field intended for the |
| 45 |
// Profiling signal and process the data as if this value were absent or |
| 46 |
// empty, ignoring its semantic content for the non-Profiling signal. |
| 47 |
// |
| 48 |
// Status: [Development] |
| 49 |
int32 string_value_strindex = 8; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message |
| 54 |
// since oneof in AnyValue does not allow repeated fields. |
| 55 |
message ArrayValue { |
| 56 |
// Array of values. The array may be empty (contain 0 elements). |
| 57 |
repeated AnyValue values = 1; |
| 58 |
} |
| 59 |
|
| 60 |
// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message |
| 61 |
// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need |
| 62 |
// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to |
| 63 |
// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches |
| 64 |
// are semantically equivalent. |
| 65 |
message KeyValueList { |
| 66 |
// A collection of key/value pairs of key-value pairs. The list may be empty (may |
| 67 |
// contain 0 elements). |
| 68 |
// |
| 69 |
// The keys MUST be unique (it is not allowed to have more than one |
| 70 |
// value with the same key). |
| 71 |
// The behavior of software that receives duplicated keys can be unpredictable. |
| 72 |
repeated KeyValue values = 1; |
| 73 |
} |
| 74 |
|
| 75 |
// Represents a key-value pair that is used to store Span attributes, Link |
| 76 |
// attributes, etc. |
| 77 |
message KeyValue { |
| 78 |
// The key name of the pair. |
| 79 |
// key_ref MUST NOT be set if key is used. |
| 80 |
string key = 1; |
| 81 |
|
| 82 |
// The value of the pair. |
| 83 |
AnyValue value = 2; |
| 84 |
|
| 85 |
// Reference to the string key in ProfilesDictionary.string_table. |
| 86 |
// key MUST NOT be set if key_strindex is used. |
| 87 |
// |
| 88 |
// Note: This is currently used exclusively in the Profiling signal. |
| 89 |
// Implementers of OTLP receivers for signals other than Profiling should |
| 90 |
// treat the presence of this key as a non-fatal issue. |
| 91 |
// Log an error or warning indicating an unexpected field intended for the |
| 92 |
// Profiling signal and process the data as if this value were absent or |
| 93 |
// empty, ignoring its semantic content for the non-Profiling signal. |
| 94 |
// |
| 95 |
// Status: [Development] |
| 96 |
int32 key_strindex = 3; |
| 97 |
} |
| 98 |
|
| 99 |
// InstrumentationScope is a message representing the instrumentation scope information |
| 100 |
// such as the fully qualified name and version. |
| 101 |
message InstrumentationScope { |
| 102 |
// A name denoting the Instrumentation scope. |
| 103 |
// An empty instrumentation scope name means the name is unknown. |
| 104 |
string name = 1; |
| 105 |
|
| 106 |
// Defines the version of the instrumentation scope. |
| 107 |
// An empty instrumentation scope version means the version is unknown. |
| 108 |
string version = 2; |
| 109 |
|
| 110 |
// Additional attributes that describe the scope. [Optional]. |
| 111 |
// Attribute keys MUST be unique (it is not allowed to have more than one |
| 112 |
// attribute with the same key). |
| 113 |
// The behavior of software that receives duplicated keys can be unpredictable. |
| 114 |
repeated KeyValue attributes = 3; |
| 115 |
|
| 116 |
// The number of attributes that were discarded. Attributes |
| 117 |
// can be discarded because their keys are too long or because there are too many |
| 118 |
// attributes. If this value is 0, then no attributes were dropped. |
| 119 |
uint32 dropped_attributes_count = 4; |
| 120 |
} |
| 121 |
|
| 122 |
// A reference to an Entity. |
| 123 |
// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs. |
| 124 |
// |
| 125 |
// Status: [Development] |
| 126 |
message EntityRef { |
| 127 |
// The Schema URL, if known. This is the identifier of the Schema that the entity data |
| 128 |
// is recorded in. To learn more about Schema URL see |
| 129 |
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url |
| 130 |
// |
| 131 |
// This schema_url applies to the data in this message and to the Resource attributes |
| 132 |
// referenced by id_keys and description_keys. |
| 133 |
// TODO: discuss if we are happy with this somewhat complicated definition of what |
| 134 |
// the schema_url applies to. |
| 135 |
// |
| 136 |
// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs. |
| 137 |
string schema_url = 1; |
| 138 |
|
| 139 |
// Defines the type of the entity. MUST not change during the lifetime of the entity. |
| 140 |
// For example: "service" or "host". This field is required and MUST not be empty |
| 141 |
// for valid entities. |
| 142 |
string type = 2; |
| 143 |
|
| 144 |
// Attribute Keys that identify the entity. |
| 145 |
// MUST not change during the lifetime of the entity. The Id must contain at least one attribute. |
| 146 |
// These keys MUST exist in the containing {message}.attributes. |
| 147 |
repeated string id_keys = 3; |
| 148 |
|
| 149 |
// Descriptive (non-identifying) attribute keys of the entity. |
| 150 |
// MAY change over the lifetime of the entity. MAY be empty. |
| 151 |
// These attribute keys are not part of entity's identity. |
| 152 |
// These keys MUST exist in the containing {message}.attributes. |
| 153 |
repeated string description_keys = 4; |
| 154 |
} |