diff --git a/CHANGELOG.md b/CHANGELOG.md index 648e72d5f59..305f9f92011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2540](https://github.com/open-telemetry/opentelemetry-python/pull/2540)) - Drop the usage of name field from log model in OTLP ([#2565](https://github.com/open-telemetry/opentelemetry-python/pull/2565)) +- Update opentelemetry-proto to v0.15.0 + ([#2566](https://github.com/open-telemetry/opentelemetry-python/pull/2566)) - Remove `enable_default_view` option from sdk MeterProvider ([#2547](https://github.com/open-telemetry/opentelemetry-python/pull/2547)) diff --git a/opentelemetry-proto/README.rst b/opentelemetry-proto/README.rst index 03c53dbb678..bb3a1e9796c 100644 --- a/opentelemetry-proto/README.rst +++ b/opentelemetry-proto/README.rst @@ -7,9 +7,9 @@ OpenTelemetry Python Proto :target: https://pypi.org/project/opentelemetry-proto/ This library contains the generated code for OpenTelemetry protobuf data model. The code in the current -package was generated using the v0.9.0 release_ of opentelemetry-proto. +package was generated using the v0.15.0 release_ of opentelemetry-proto. -.. _release: https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v0.9.0 +.. _release: https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v0.15.0 Installation ------------ diff --git a/opentelemetry-proto/src/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py index e315109d13c..d439d077b32 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py @@ -18,9 +18,9 @@ name='opentelemetry/proto/collector/logs/v1/logs_service.proto', package='opentelemetry.proto.collector.logs.v1', syntax='proto3', - serialized_options=b'\n(io.opentelemetry.proto.collector.logs.v1B\020LogsServiceProtoP\001ZFgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/logs/v1', + serialized_options=b'\n(io.opentelemetry.proto.collector.logs.v1B\020LogsServiceProtoP\001Z0go.opentelemetry.io/proto/otlp/collector/logs/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n8opentelemetry/proto/collector/logs/v1/logs_service.proto\x12%opentelemetry.proto.collector.logs.v1\x1a&opentelemetry/proto/logs/v1/logs.proto\"\\\n\x18\x45xportLogsServiceRequest\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"\x1b\n\x19\x45xportLogsServiceResponse2\x9d\x01\n\x0bLogsService\x12\x8d\x01\n\x06\x45xport\x12?.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest\x1a@.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse\"\x00\x42\x86\x01\n(io.opentelemetry.proto.collector.logs.v1B\x10LogsServiceProtoP\x01ZFgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/logs/v1b\x06proto3' + serialized_pb=b'\n8opentelemetry/proto/collector/logs/v1/logs_service.proto\x12%opentelemetry.proto.collector.logs.v1\x1a&opentelemetry/proto/logs/v1/logs.proto\"\\\n\x18\x45xportLogsServiceRequest\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"\x1b\n\x19\x45xportLogsServiceResponse2\x9d\x01\n\x0bLogsService\x12\x8d\x01\n\x06\x45xport\x12?.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest\x1a@.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse\"\x00\x42p\n(io.opentelemetry.proto.collector.logs.v1B\x10LogsServiceProtoP\x01Z0go.opentelemetry.io/proto/otlp/collector/logs/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_logs_dot_v1_dot_logs__pb2.DESCRIPTOR,]) diff --git a/opentelemetry-proto/src/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py index ba3c7902ff0..2fb3bf86dec 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py @@ -18,9 +18,9 @@ name='opentelemetry/proto/collector/metrics/v1/metrics_service.proto', package='opentelemetry.proto.collector.metrics.v1', syntax='proto3', - serialized_options=b'\n+io.opentelemetry.proto.collector.metrics.v1B\023MetricsServiceProtoP\001ZIgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/metrics/v1', + serialized_options=b'\n+io.opentelemetry.proto.collector.metrics.v1B\023MetricsServiceProtoP\001Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n>opentelemetry/proto/collector/metrics/v1/metrics_service.proto\x12(opentelemetry.proto.collector.metrics.v1\x1a,opentelemetry/proto/metrics/v1/metrics.proto\"h\n\x1b\x45xportMetricsServiceRequest\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\x1e\n\x1c\x45xportMetricsServiceResponse2\xac\x01\n\x0eMetricsService\x12\x99\x01\n\x06\x45xport\x12\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest\x1a\x46.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse\"\x00\x42\x8f\x01\n+io.opentelemetry.proto.collector.metrics.v1B\x13MetricsServiceProtoP\x01ZIgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/metrics/v1b\x06proto3' + serialized_pb=b'\n>opentelemetry/proto/collector/metrics/v1/metrics_service.proto\x12(opentelemetry.proto.collector.metrics.v1\x1a,opentelemetry/proto/metrics/v1/metrics.proto\"h\n\x1b\x45xportMetricsServiceRequest\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\x1e\n\x1c\x45xportMetricsServiceResponse2\xac\x01\n\x0eMetricsService\x12\x99\x01\n\x06\x45xport\x12\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest\x1a\x46.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse\"\x00\x42y\n+io.opentelemetry.proto.collector.metrics.v1B\x13MetricsServiceProtoP\x01Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_metrics_dot_v1_dot_metrics__pb2.DESCRIPTOR,]) diff --git a/opentelemetry-proto/src/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py index 4648414b796..7d988f1117b 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py @@ -18,9 +18,9 @@ name='opentelemetry/proto/collector/trace/v1/trace_service.proto', package='opentelemetry.proto.collector.trace.v1', syntax='proto3', - serialized_options=b'\n)io.opentelemetry.proto.collector.trace.v1B\021TraceServiceProtoP\001ZGgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1', + serialized_options=b'\n)io.opentelemetry.proto.collector.trace.v1B\021TraceServiceProtoP\001Z1go.opentelemetry.io/proto/otlp/collector/trace/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n:opentelemetry/proto/collector/trace/v1/trace_service.proto\x12&opentelemetry.proto.collector.trace.v1\x1a(opentelemetry/proto/trace/v1/trace.proto\"`\n\x19\x45xportTraceServiceRequest\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\x1c\n\x1a\x45xportTraceServiceResponse2\xa2\x01\n\x0cTraceService\x12\x91\x01\n\x06\x45xport\x12\x41.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest\x1a\x42.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse\"\x00\x42\x89\x01\n)io.opentelemetry.proto.collector.trace.v1B\x11TraceServiceProtoP\x01ZGgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1b\x06proto3' + serialized_pb=b'\n:opentelemetry/proto/collector/trace/v1/trace_service.proto\x12&opentelemetry.proto.collector.trace.v1\x1a(opentelemetry/proto/trace/v1/trace.proto\"`\n\x19\x45xportTraceServiceRequest\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\x1c\n\x1a\x45xportTraceServiceResponse2\xa2\x01\n\x0cTraceService\x12\x91\x01\n\x06\x45xport\x12\x41.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest\x1a\x42.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse\"\x00\x42s\n)io.opentelemetry.proto.collector.trace.v1B\x11TraceServiceProtoP\x01Z1go.opentelemetry.io/proto/otlp/collector/trace/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2.DESCRIPTOR,]) diff --git a/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.py index 4578f9409fb..ba7d33ef61f 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.py @@ -17,9 +17,9 @@ name='opentelemetry/proto/common/v1/common.proto', package='opentelemetry.proto.common.v1', syntax='proto3', - serialized_options=b'\n io.opentelemetry.proto.common.v1B\013CommonProtoP\001Z>github.com/open-telemetry/opentelemetry-proto/gen/go/common/v1', + serialized_options=b'\n io.opentelemetry.proto.common.v1B\013CommonProtoP\001Z(go.opentelemetry.io/proto/otlp/common/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n*opentelemetry/proto/common/v1/common.proto\x12\x1dopentelemetry.proto.common.v1\"\x8c\x02\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12@\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32).opentelemetry.proto.common.v1.ArrayValueH\x00\x12\x43\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32+.opentelemetry.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"E\n\nArrayValue\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"G\n\x0cKeyValueList\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\"O\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"0\n\x0eStringKeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x18\x01\"7\n\x16InstrumentationLibrary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\tBq\n io.opentelemetry.proto.common.v1B\x0b\x43ommonProtoP\x01Z>github.com/open-telemetry/opentelemetry-proto/gen/go/common/v1b\x06proto3' + serialized_pb=b'\n*opentelemetry/proto/common/v1/common.proto\x12\x1dopentelemetry.proto.common.v1\"\x8c\x02\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12@\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32).opentelemetry.proto.common.v1.ArrayValueH\x00\x12\x43\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32+.opentelemetry.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"E\n\nArrayValue\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"G\n\x0cKeyValueList\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\"O\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\";\n\x16InstrumentationLibrary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t:\x02\x18\x01\"5\n\x14InstrumentationScope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\tB[\n io.opentelemetry.proto.common.v1B\x0b\x43ommonProtoP\x01Z(go.opentelemetry.io/proto/otlp/common/v1b\x06proto3' ) @@ -207,23 +207,23 @@ ) -_STRINGKEYVALUE = _descriptor.Descriptor( - name='StringKeyValue', - full_name='opentelemetry.proto.common.v1.StringKeyValue', +_INSTRUMENTATIONLIBRARY = _descriptor.Descriptor( + name='InstrumentationLibrary', + full_name='opentelemetry.proto.common.v1.InstrumentationLibrary', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='key', full_name='opentelemetry.proto.common.v1.StringKeyValue.key', index=0, + name='name', full_name='opentelemetry.proto.common.v1.InstrumentationLibrary.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='value', full_name='opentelemetry.proto.common.v1.StringKeyValue.value', index=1, + name='version', full_name='opentelemetry.proto.common.v1.InstrumentationLibrary.version', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -242,27 +242,27 @@ oneofs=[ ], serialized_start=573, - serialized_end=621, + serialized_end=632, ) -_INSTRUMENTATIONLIBRARY = _descriptor.Descriptor( - name='InstrumentationLibrary', - full_name='opentelemetry.proto.common.v1.InstrumentationLibrary', +_INSTRUMENTATIONSCOPE = _descriptor.Descriptor( + name='InstrumentationScope', + full_name='opentelemetry.proto.common.v1.InstrumentationScope', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='name', full_name='opentelemetry.proto.common.v1.InstrumentationLibrary.name', index=0, + name='name', full_name='opentelemetry.proto.common.v1.InstrumentationScope.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='version', full_name='opentelemetry.proto.common.v1.InstrumentationLibrary.version', index=1, + name='version', full_name='opentelemetry.proto.common.v1.InstrumentationScope.version', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -280,8 +280,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=623, - serialized_end=678, + serialized_start=634, + serialized_end=687, ) _ANYVALUE.fields_by_name['array_value'].message_type = _ARRAYVALUE @@ -314,8 +314,8 @@ DESCRIPTOR.message_types_by_name['ArrayValue'] = _ARRAYVALUE DESCRIPTOR.message_types_by_name['KeyValueList'] = _KEYVALUELIST DESCRIPTOR.message_types_by_name['KeyValue'] = _KEYVALUE -DESCRIPTOR.message_types_by_name['StringKeyValue'] = _STRINGKEYVALUE DESCRIPTOR.message_types_by_name['InstrumentationLibrary'] = _INSTRUMENTATIONLIBRARY +DESCRIPTOR.message_types_by_name['InstrumentationScope'] = _INSTRUMENTATIONSCOPE _sym_db.RegisterFileDescriptor(DESCRIPTOR) AnyValue = _reflection.GeneratedProtocolMessageType('AnyValue', (_message.Message,), { @@ -346,13 +346,6 @@ }) _sym_db.RegisterMessage(KeyValue) -StringKeyValue = _reflection.GeneratedProtocolMessageType('StringKeyValue', (_message.Message,), { - 'DESCRIPTOR' : _STRINGKEYVALUE, - '__module__' : 'opentelemetry.proto.common.v1.common_pb2' - # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.StringKeyValue) - }) -_sym_db.RegisterMessage(StringKeyValue) - InstrumentationLibrary = _reflection.GeneratedProtocolMessageType('InstrumentationLibrary', (_message.Message,), { 'DESCRIPTOR' : _INSTRUMENTATIONLIBRARY, '__module__' : 'opentelemetry.proto.common.v1.common_pb2' @@ -360,7 +353,14 @@ }) _sym_db.RegisterMessage(InstrumentationLibrary) +InstrumentationScope = _reflection.GeneratedProtocolMessageType('InstrumentationScope', (_message.Message,), { + 'DESCRIPTOR' : _INSTRUMENTATIONSCOPE, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.InstrumentationScope) + }) +_sym_db.RegisterMessage(InstrumentationScope) + DESCRIPTOR._options = None -_STRINGKEYVALUE._options = None +_INSTRUMENTATIONLIBRARY._options = None # @@protoc_insertion_point(module_scope) diff --git a/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.pyi index 54789ef8939..0d1ff4f098b 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/common/v1/common_pb2.pyi @@ -78,6 +78,8 @@ class KeyValueList(google.protobuf.message.Message): def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KeyValue]: """A collection of key/value pairs of key-value pairs. The list may be empty (may contain 0 elements). + The keys MUST be unique (it is not allowed to have more than one + value with the same key). """ pass def __init__(self, @@ -106,32 +108,37 @@ class KeyValue(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ... global___KeyValue = KeyValue -class StringKeyValue(google.protobuf.message.Message): - """StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version - of KeyValue that only supports string values. +class InstrumentationLibrary(google.protobuf.message.Message): + """InstrumentationLibrary is a message representing the instrumentation library information + such as the fully qualified name and version. + InstrumentationLibrary is wire-compatible with InstrumentationScope for binary + Protobuf format. + This message is deprecated and will be removed on June 15, 2022. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... - KEY_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - key: typing.Text = ... - value: typing.Text = ... + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """An empty instrumentation library name means the name is unknown.""" + + version: typing.Text = ... def __init__(self, *, - key : typing.Text = ..., - value : typing.Text = ..., + name : typing.Text = ..., + version : typing.Text = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ... -global___StringKeyValue = StringKeyValue + def ClearField(self, field_name: typing_extensions.Literal["name",b"name","version",b"version"]) -> None: ... +global___InstrumentationLibrary = InstrumentationLibrary -class InstrumentationLibrary(google.protobuf.message.Message): - """InstrumentationLibrary is a message representing the instrumentation library information +class InstrumentationScope(google.protobuf.message.Message): + """InstrumentationScope is a message representing the instrumentation scope information such as the fully qualified name and version. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... NAME_FIELD_NUMBER: builtins.int VERSION_FIELD_NUMBER: builtins.int name: typing.Text = ... - """An empty instrumentation library name means the name is unknown.""" + """An empty instrumentation scope name means the name is unknown.""" version: typing.Text = ... def __init__(self, @@ -140,4 +147,4 @@ class InstrumentationLibrary(google.protobuf.message.Message): version : typing.Text = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["name",b"name","version",b"version"]) -> None: ... -global___InstrumentationLibrary = InstrumentationLibrary +global___InstrumentationScope = InstrumentationScope diff --git a/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.py index 6e16d73da12..a1569de0dac 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.py @@ -20,9 +20,9 @@ name='opentelemetry/proto/logs/v1/logs.proto', package='opentelemetry.proto.logs.v1', syntax='proto3', - serialized_options=b'\n\036io.opentelemetry.proto.logs.v1B\tLogsProtoP\001Z google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ScopeLogs]: + """A list of ScopeLogs that originate from a resource.""" + pass + @property def instrumentation_library_logs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InstrumentationLibraryLogs]: - """A list of InstrumentationLibraryLogs that originate from a resource.""" + """A list of InstrumentationLibraryLogs that originate from a resource. + This field is deprecated and will be removed after grace period expires on June 15, 2022. + + During the grace period the following rules SHOULD be followed: + + For Binary Protobufs + ==================== + Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + scope_logs SHOULD be set. + + Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + and scope_logs is not set then the value in instrumentation_library_logs + SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + + For JSON + ======== + JSON senders that set instrumentation_library_logs field MAY also set + scope_logs to carry the same logs, essentially double-publishing the same data. + Such double-publishing MAY be controlled by a user-settable option. + If double-publishing is not used then the senders SHOULD set scope_logs and + SHOULD NOT set instrumentation_library_logs. + + JSON receivers SHOULD check if instrumentation_library_logs is set and + scope_logs is not set then the value in instrumentation_library_logs + SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. + """ pass schema_url: typing.Text = ... """This schema_url applies to the data in the "resource" field. It does not apply - to the data in the "instrumentation_library_logs" field which have their own - schema_url field. + to the data in the "scope_logs" field which have their own schema_url field. """ def __init__(self, *, resource : typing.Optional[opentelemetry.proto.resource.v1.resource_pb2.Resource] = ..., + scope_logs : typing.Optional[typing.Iterable[global___ScopeLogs]] = ..., instrumentation_library_logs : typing.Optional[typing.Iterable[global___InstrumentationLibraryLogs]] = ..., schema_url : typing.Text = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["resource",b"resource"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_logs",b"instrumentation_library_logs","resource",b"resource","schema_url",b"schema_url"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_logs",b"instrumentation_library_logs","resource",b"resource","schema_url",b"schema_url","scope_logs",b"scope_logs"]) -> None: ... global___ResourceLogs = ResourceLogs +class ScopeLogs(google.protobuf.message.Message): + """A collection of Logs produced by a Scope.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + SCOPE_FIELD_NUMBER: builtins.int + LOG_RECORDS_FIELD_NUMBER: builtins.int + SCHEMA_URL_FIELD_NUMBER: builtins.int + @property + def scope(self) -> opentelemetry.proto.common.v1.common_pb2.InstrumentationScope: + """The instrumentation scope information for the logs in this message. + Semantically when InstrumentationScope isn't set, it is equivalent with + an empty instrumentation scope name (unknown). + """ + pass + @property + def log_records(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LogRecord]: + """A list of log records.""" + pass + schema_url: typing.Text = ... + """This schema_url applies to all logs in the "logs" field.""" + + def __init__(self, + *, + scope : typing.Optional[opentelemetry.proto.common.v1.common_pb2.InstrumentationScope] = ..., + log_records : typing.Optional[typing.Iterable[global___LogRecord]] = ..., + schema_url : typing.Text = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["scope",b"scope"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["log_records",b"log_records","schema_url",b"schema_url","scope",b"scope"]) -> None: ... +global___ScopeLogs = ScopeLogs + class InstrumentationLibraryLogs(google.protobuf.message.Message): - """A collection of Logs produced by an InstrumentationLibrary.""" + """A collection of Logs produced by an InstrumentationLibrary. + InstrumentationLibraryLogs is wire-compatible with ScopeLogs for binary + Protobuf format. + This message is deprecated and will be removed on June 15, 2022. + """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... INSTRUMENTATION_LIBRARY_FIELD_NUMBER: builtins.int LOG_RECORDS_FIELD_NUMBER: builtins.int @@ -171,7 +237,7 @@ class InstrumentationLibraryLogs(google.protobuf.message.Message): pass @property def log_records(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LogRecord]: - """A list of log records.""" + """A list of logs that originate from an instrumentation library.""" pass schema_url: typing.Text = ... """This schema_url applies to all logs in the "logs" field.""" @@ -192,6 +258,7 @@ class LogRecord(google.protobuf.message.Message): """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... TIME_UNIX_NANO_FIELD_NUMBER: builtins.int + OBSERVED_TIME_UNIX_NANO_FIELD_NUMBER: builtins.int SEVERITY_NUMBER_FIELD_NUMBER: builtins.int SEVERITY_TEXT_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int @@ -207,6 +274,24 @@ class LogRecord(google.protobuf.message.Message): Value of 0 indicates unknown or missing timestamp. """ + observed_time_unix_nano: builtins.int = ... + """Time when the event was observed by the collection system. + For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + this timestamp is typically set at the generation time and is equal to Timestamp. + For events originating externally and collected by OpenTelemetry (e.g. using + Collector) this is the time when OpenTelemetry's code observed the event measured + by the clock of the OpenTelemetry code. This field MUST be set once the event is + observed by OpenTelemetry. + + For converting OpenTelemetry log data to formats that support only one timestamp or + when receiving OpenTelemetry log data by recipients that support only one timestamp + internally the following logic is recommended: + - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + + Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + Value of 0 indicates unknown or missing timestamp. + """ + severity_number: global___SeverityNumber.V = ... """Numerical value of the severity, normalized to values described in Log Data Model. [Optional]. @@ -221,6 +306,8 @@ class LogRecord(google.protobuf.message.Message): """Short event identifier that does not contain varying parts. Name describes what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 characters. Not guaranteed to be unique in any way. [Optional]. + This deprecated field is planned to be removed March 15, 2022. Receivers can + ignore this field. """ @property @@ -232,7 +319,10 @@ class LogRecord(google.protobuf.message.Message): pass @property def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: - """Additional attributes that describe the specific event occurrence. [Optional].""" + """Additional attributes that describe the specific event occurrence. [Optional]. + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). + """ pass dropped_attributes_count: builtins.int = ... flags: builtins.int = ... @@ -260,6 +350,7 @@ class LogRecord(google.protobuf.message.Message): def __init__(self, *, time_unix_nano : builtins.int = ..., + observed_time_unix_nano : builtins.int = ..., severity_number : global___SeverityNumber.V = ..., severity_text : typing.Text = ..., name : typing.Text = ..., @@ -271,5 +362,5 @@ class LogRecord(google.protobuf.message.Message): span_id : builtins.bytes = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["body",b"body"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","body",b"body","dropped_attributes_count",b"dropped_attributes_count","flags",b"flags","name",b"name","severity_number",b"severity_number","severity_text",b"severity_text","span_id",b"span_id","time_unix_nano",b"time_unix_nano","trace_id",b"trace_id"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","body",b"body","dropped_attributes_count",b"dropped_attributes_count","flags",b"flags","name",b"name","observed_time_unix_nano",b"observed_time_unix_nano","severity_number",b"severity_number","severity_text",b"severity_text","span_id",b"span_id","time_unix_nano",b"time_unix_nano","trace_id",b"trace_id"]) -> None: ... global___LogRecord = LogRecord diff --git a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py index 5e3cccc105e..898f3d00abe 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py @@ -20,9 +20,9 @@ name='opentelemetry/proto/metrics/v1/metrics.proto', package='opentelemetry.proto.metrics.v1', syntax='proto3', - serialized_options=b'\n!io.opentelemetry.proto.metrics.v1B\014MetricsProtoP\001Z?github.com/open-telemetry/opentelemetry-proto/gen/go/metrics/v1', + serialized_options=b'\n!io.opentelemetry.proto.metrics.v1B\014MetricsProtoP\001Z)go.opentelemetry.io/proto/otlp/metrics/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\xca\x01\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x66\n\x1finstrumentation_library_metrics\x18\x02 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xc4\x01\n\x1dInstrumentationLibraryMetrics\x12V\n\x17instrumentation_library\x18\x01 \x01(\x0b\x32\x35.opentelemetry.proto.common.v1.InstrumentationLibrary\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x92\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x42\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xa5\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\rJ\x04\x08\x01\x10\x02\"\x81\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*;\n\x0e\x44\x61taPointFlags\x12\r\n\tFLAG_NONE\x10\x00\x12\x1a\n\x16\x46LAG_NO_RECORDED_VALUE\x10\x01\x42t\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z?github.com/open-telemetry/opentelemetry-proto/gen/go/metrics/v1b\x06proto3' + serialized_pb=b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\x94\x02\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x43\n\rscope_metrics\x18\x02 \x03(\x0b\x32,.opentelemetry.proto.metrics.v1.ScopeMetrics\x12k\n\x1finstrumentation_library_metrics\x18\xe8\x07 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetricsB\x02\x18\x01\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x9f\x01\n\x0cScopeMetrics\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xc8\x01\n\x1dInstrumentationLibraryMetrics\x12V\n\x17instrumentation_library\x18\x01 \x01(\x0b\x32\x35.opentelemetry.proto.common.v1.InstrumentationLibrary\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t:\x02\x18\x01\"\x92\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x42\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xb2\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\rB\x06\n\x04_sumJ\x04\x08\x01\x10\x02\"\x81\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*;\n\x0e\x44\x61taPointFlags\x12\r\n\tFLAG_NONE\x10\x00\x12\x1a\n\x16\x46LAG_NO_RECORDED_VALUE\x10\x01\x42^\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z)go.opentelemetry.io/proto/otlp/metrics/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2.DESCRIPTOR,]) @@ -51,8 +51,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=3397, - serialized_end=3537, + serialized_start=3650, + serialized_end=3790, ) _sym_db.RegisterEnumDescriptor(_AGGREGATIONTEMPORALITY) @@ -77,8 +77,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=3539, - serialized_end=3598, + serialized_start=3792, + serialized_end=3851, ) _sym_db.RegisterEnumDescriptor(_DATAPOINTFLAGS) @@ -139,14 +139,21 @@ is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='instrumentation_library_metrics', full_name='opentelemetry.proto.metrics.v1.ResourceMetrics.instrumentation_library_metrics', index=1, + name='scope_metrics', full_name='opentelemetry.proto.metrics.v1.ResourceMetrics.scope_metrics', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='schema_url', full_name='opentelemetry.proto.metrics.v1.ResourceMetrics.schema_url', index=2, + name='instrumentation_library_metrics', full_name='opentelemetry.proto.metrics.v1.ResourceMetrics.instrumentation_library_metrics', index=2, + number=1000, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='schema_url', full_name='opentelemetry.proto.metrics.v1.ResourceMetrics.schema_url', index=3, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -165,7 +172,53 @@ oneofs=[ ], serialized_start=263, - serialized_end=465, + serialized_end=539, +) + + +_SCOPEMETRICS = _descriptor.Descriptor( + name='ScopeMetrics', + full_name='opentelemetry.proto.metrics.v1.ScopeMetrics', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='scope', full_name='opentelemetry.proto.metrics.v1.ScopeMetrics.scope', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metrics', full_name='opentelemetry.proto.metrics.v1.ScopeMetrics.metrics', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='schema_url', full_name='opentelemetry.proto.metrics.v1.ScopeMetrics.schema_url', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=542, + serialized_end=701, ) @@ -204,14 +257,14 @@ nested_types=[], enum_types=[ ], - serialized_options=None, + serialized_options=b'\030\001', is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], - serialized_start=468, - serialized_end=664, + serialized_start=704, + serialized_end=904, ) @@ -296,8 +349,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=667, - serialized_end=1069, + serialized_start=907, + serialized_end=1309, ) @@ -328,8 +381,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1071, - serialized_end=1148, + serialized_start=1311, + serialized_end=1388, ) @@ -374,8 +427,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1151, - serialized_end=1337, + serialized_start=1391, + serialized_end=1577, ) @@ -413,8 +466,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1340, - serialized_end=1513, + serialized_start=1580, + serialized_end=1753, ) @@ -452,8 +505,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1516, - serialized_end=1711, + serialized_start=1756, + serialized_end=1951, ) @@ -484,8 +537,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1713, - serialized_end=1793, + serialized_start=1953, + serialized_end=2033, ) @@ -563,8 +616,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=1796, - serialized_end=2058, + serialized_start=2036, + serialized_end=2298, ) @@ -650,9 +703,14 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='_sum', full_name='opentelemetry.proto.metrics.v1.HistogramDataPoint._sum', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=2061, - serialized_end=2354, + serialized_start=2301, + serialized_end=2607, ) @@ -690,8 +748,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2822, - serialized_end=2870, + serialized_start=3075, + serialized_end=3123, ) _EXPONENTIALHISTOGRAMDATAPOINT = _descriptor.Descriptor( @@ -791,8 +849,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2357, - serialized_end=2870, + serialized_start=2610, + serialized_end=3123, ) @@ -830,8 +888,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3142, - serialized_end=3192, + serialized_start=3395, + serialized_end=3445, ) _SUMMARYDATAPOINT = _descriptor.Descriptor( @@ -903,8 +961,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2873, - serialized_end=3198, + serialized_start=3126, + serialized_end=3451, ) @@ -975,13 +1033,16 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=3201, - serialized_end=3394, + serialized_start=3454, + serialized_end=3647, ) _METRICSDATA.fields_by_name['resource_metrics'].message_type = _RESOURCEMETRICS _RESOURCEMETRICS.fields_by_name['resource'].message_type = opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2._RESOURCE +_RESOURCEMETRICS.fields_by_name['scope_metrics'].message_type = _SCOPEMETRICS _RESOURCEMETRICS.fields_by_name['instrumentation_library_metrics'].message_type = _INSTRUMENTATIONLIBRARYMETRICS +_SCOPEMETRICS.fields_by_name['scope'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._INSTRUMENTATIONSCOPE +_SCOPEMETRICS.fields_by_name['metrics'].message_type = _METRIC _INSTRUMENTATIONLIBRARYMETRICS.fields_by_name['instrumentation_library'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._INSTRUMENTATIONLIBRARY _INSTRUMENTATIONLIBRARYMETRICS.fields_by_name['metrics'].message_type = _METRIC _METRIC.fields_by_name['gauge'].message_type = _GAUGE @@ -1022,6 +1083,9 @@ _NUMBERDATAPOINT.fields_by_name['as_int'].containing_oneof = _NUMBERDATAPOINT.oneofs_by_name['value'] _HISTOGRAMDATAPOINT.fields_by_name['attributes'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._KEYVALUE _HISTOGRAMDATAPOINT.fields_by_name['exemplars'].message_type = _EXEMPLAR +_HISTOGRAMDATAPOINT.oneofs_by_name['_sum'].fields.append( + _HISTOGRAMDATAPOINT.fields_by_name['sum']) +_HISTOGRAMDATAPOINT.fields_by_name['sum'].containing_oneof = _HISTOGRAMDATAPOINT.oneofs_by_name['_sum'] _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS.containing_type = _EXPONENTIALHISTOGRAMDATAPOINT _EXPONENTIALHISTOGRAMDATAPOINT.fields_by_name['attributes'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._KEYVALUE _EXPONENTIALHISTOGRAMDATAPOINT.fields_by_name['positive'].message_type = _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS @@ -1039,6 +1103,7 @@ _EXEMPLAR.fields_by_name['as_int'].containing_oneof = _EXEMPLAR.oneofs_by_name['value'] DESCRIPTOR.message_types_by_name['MetricsData'] = _METRICSDATA DESCRIPTOR.message_types_by_name['ResourceMetrics'] = _RESOURCEMETRICS +DESCRIPTOR.message_types_by_name['ScopeMetrics'] = _SCOPEMETRICS DESCRIPTOR.message_types_by_name['InstrumentationLibraryMetrics'] = _INSTRUMENTATIONLIBRARYMETRICS DESCRIPTOR.message_types_by_name['Metric'] = _METRIC DESCRIPTOR.message_types_by_name['Gauge'] = _GAUGE @@ -1069,6 +1134,13 @@ }) _sym_db.RegisterMessage(ResourceMetrics) +ScopeMetrics = _reflection.GeneratedProtocolMessageType('ScopeMetrics', (_message.Message,), { + 'DESCRIPTOR' : _SCOPEMETRICS, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ScopeMetrics) + }) +_sym_db.RegisterMessage(ScopeMetrics) + InstrumentationLibraryMetrics = _reflection.GeneratedProtocolMessageType('InstrumentationLibraryMetrics', (_message.Message,), { 'DESCRIPTOR' : _INSTRUMENTATIONLIBRARYMETRICS, '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' @@ -1171,4 +1243,6 @@ DESCRIPTOR._options = None +_RESOURCEMETRICS.fields_by_name['instrumentation_library_metrics']._options = None +_INSTRUMENTATIONLIBRARYMETRICS._options = None # @@protoc_insertion_point(module_scope) diff --git a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi index 7ee8a16f13c..9b49ee04296 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi @@ -226,9 +226,10 @@ class MetricsData(google.protobuf.message.Message): global___MetricsData = MetricsData class ResourceMetrics(google.protobuf.message.Message): - """A collection of InstrumentationLibraryMetrics from a Resource.""" + """A collection of ScopeMetrics from a Resource.""" DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... RESOURCE_FIELD_NUMBER: builtins.int + SCOPE_METRICS_FIELD_NUMBER: builtins.int INSTRUMENTATION_LIBRARY_METRICS_FIELD_NUMBER: builtins.int SCHEMA_URL_FIELD_NUMBER: builtins.int @property @@ -238,27 +239,92 @@ class ResourceMetrics(google.protobuf.message.Message): """ pass @property - def instrumentation_library_metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InstrumentationLibraryMetrics]: + def scope_metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ScopeMetrics]: """A list of metrics that originate from a resource.""" pass + @property + def instrumentation_library_metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InstrumentationLibraryMetrics]: + """A list of InstrumentationLibraryMetrics that originate from a resource. + This field is deprecated and will be removed after grace period expires on June 15, 2022. + + During the grace period the following rules SHOULD be followed: + + For Binary Protobufs + ==================== + Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + scope_metrics SHOULD be set. + + Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + and scope_metrics is not set then the value in instrumentation_library_metrics + SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + + For JSON + ======== + JSON senders that set instrumentation_library_metrics field MAY also set + scope_metrics to carry the same metrics, essentially double-publishing the same data. + Such double-publishing MAY be controlled by a user-settable option. + If double-publishing is not used then the senders SHOULD set scope_metrics and + SHOULD NOT set instrumentation_library_metrics. + + JSON receivers SHOULD check if instrumentation_library_metrics is set and + scope_metrics is not set then the value in instrumentation_library_metrics + SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + """ + pass schema_url: typing.Text = ... """This schema_url applies to the data in the "resource" field. It does not apply - to the data in the "instrumentation_library_metrics" field which have their own - schema_url field. + to the data in the "scope_metrics" field which have their own schema_url field. """ def __init__(self, *, resource : typing.Optional[opentelemetry.proto.resource.v1.resource_pb2.Resource] = ..., + scope_metrics : typing.Optional[typing.Iterable[global___ScopeMetrics]] = ..., instrumentation_library_metrics : typing.Optional[typing.Iterable[global___InstrumentationLibraryMetrics]] = ..., schema_url : typing.Text = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["resource",b"resource"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_metrics",b"instrumentation_library_metrics","resource",b"resource","schema_url",b"schema_url"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_metrics",b"instrumentation_library_metrics","resource",b"resource","schema_url",b"schema_url","scope_metrics",b"scope_metrics"]) -> None: ... global___ResourceMetrics = ResourceMetrics +class ScopeMetrics(google.protobuf.message.Message): + """A collection of Metrics produced by an Scope.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + SCOPE_FIELD_NUMBER: builtins.int + METRICS_FIELD_NUMBER: builtins.int + SCHEMA_URL_FIELD_NUMBER: builtins.int + @property + def scope(self) -> opentelemetry.proto.common.v1.common_pb2.InstrumentationScope: + """The instrumentation scope information for the metrics in this message. + Semantically when InstrumentationScope isn't set, it is equivalent with + an empty instrumentation scope name (unknown). + """ + pass + @property + def metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Metric]: + """A list of metrics that originate from an instrumentation library.""" + pass + schema_url: typing.Text = ... + """This schema_url applies to all metrics in the "metrics" field.""" + + def __init__(self, + *, + scope : typing.Optional[opentelemetry.proto.common.v1.common_pb2.InstrumentationScope] = ..., + metrics : typing.Optional[typing.Iterable[global___Metric]] = ..., + schema_url : typing.Text = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["scope",b"scope"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["metrics",b"metrics","schema_url",b"schema_url","scope",b"scope"]) -> None: ... +global___ScopeMetrics = ScopeMetrics + class InstrumentationLibraryMetrics(google.protobuf.message.Message): - """A collection of Metrics produced by an InstrumentationLibrary.""" + """A collection of Metrics produced by an InstrumentationLibrary. + InstrumentationLibraryMetrics is wire-compatible with ScopeMetrics for binary + Protobuf format. + This message is deprecated and will be removed on June 15, 2022. + """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... INSTRUMENTATION_LIBRARY_FIELD_NUMBER: builtins.int METRICS_FIELD_NUMBER: builtins.int @@ -548,6 +614,8 @@ class NumberDataPoint(google.protobuf.message.Message): def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: """The set of key/value pairs that uniquely identify the timeseries from where this point belongs. The list may be empty (may contain 0 elements). + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). """ pass start_time_unix_nano: builtins.int = ... @@ -619,6 +687,8 @@ class HistogramDataPoint(google.protobuf.message.Message): def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: """The set of key/value pairs that uniquely identify the timeseries from where this point belongs. The list may be empty (may contain 0 elements). + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). """ pass start_time_unix_nano: builtins.int = ... @@ -704,7 +774,9 @@ class HistogramDataPoint(google.protobuf.message.Message): exemplars : typing.Optional[typing.Iterable[global___Exemplar]] = ..., flags : builtins.int = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","bucket_counts",b"bucket_counts","count",b"count","exemplars",b"exemplars","explicit_bounds",b"explicit_bounds","flags",b"flags","start_time_unix_nano",b"start_time_unix_nano","sum",b"sum","time_unix_nano",b"time_unix_nano"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_sum",b"_sum","sum",b"sum"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_sum",b"_sum","attributes",b"attributes","bucket_counts",b"bucket_counts","count",b"count","exemplars",b"exemplars","explicit_bounds",b"explicit_bounds","flags",b"flags","start_time_unix_nano",b"start_time_unix_nano","sum",b"sum","time_unix_nano",b"time_unix_nano"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["_sum",b"_sum"]) -> typing.Optional[typing_extensions.Literal["sum"]]: ... global___HistogramDataPoint = HistogramDataPoint class ExponentialHistogramDataPoint(google.protobuf.message.Message): @@ -762,6 +834,8 @@ class ExponentialHistogramDataPoint(google.protobuf.message.Message): def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: """The set of key/value pairs that uniquely identify the timeseries from where this point belongs. The list may be empty (may contain 0 elements). + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). """ pass start_time_unix_nano: builtins.int = ... @@ -909,6 +983,8 @@ class SummaryDataPoint(google.protobuf.message.Message): def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: """The set of key/value pairs that uniquely identify the timeseries from where this point belongs. The list may be empty (may contain 0 elements). + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). """ pass start_time_unix_nano: builtins.int = ... diff --git a/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.py index f64160f6024..553053c28a8 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.py @@ -18,9 +18,9 @@ name='opentelemetry/proto/resource/v1/resource.proto', package='opentelemetry.proto.resource.v1', syntax='proto3', - serialized_options=b'\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\001Z@github.com/open-telemetry/opentelemetry-proto/gen/go/resource/v1', + serialized_options=b'\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\001Z*go.opentelemetry.io/proto/otlp/resource/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n.opentelemetry/proto/resource/v1/resource.proto\x12\x1fopentelemetry.proto.resource.v1\x1a*opentelemetry/proto/common/v1/common.proto\"i\n\x08Resource\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\rBw\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\x01Z@github.com/open-telemetry/opentelemetry-proto/gen/go/resource/v1b\x06proto3' + serialized_pb=b'\n.opentelemetry/proto/resource/v1/resource.proto\x12\x1fopentelemetry.proto.resource.v1\x1a*opentelemetry/proto/common/v1/common.proto\"i\n\x08Resource\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\rBa\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\x01Z*go.opentelemetry.io/proto/otlp/resource/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,]) diff --git a/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.pyi index 957a7b6d1b0..f660c7f2294 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/resource/v1/resource_pb2.pyi @@ -19,7 +19,10 @@ class Resource(google.protobuf.message.Message): DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER: builtins.int @property def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: - """Set of labels that describe the resource.""" + """Set of attributes that describe the resource. + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). + """ pass dropped_attributes_count: builtins.int = ... """dropped_attributes_count is the number of dropped attributes. If the value is 0, then diff --git a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_config_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_config_pb2.py index 99428b3c89b..4b7cc3a69b8 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_config_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_config_pb2.py @@ -17,9 +17,9 @@ name='opentelemetry/proto/trace/v1/trace_config.proto', package='opentelemetry.proto.trace.v1', syntax='proto3', - serialized_options=b'\n\037io.opentelemetry.proto.trace.v1B\020TraceConfigProtoP\001ZGgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1', + serialized_options=b'\n\037io.opentelemetry.proto.trace.v1B\020TraceConfigProtoP\001Z1go.opentelemetry.io/proto/otlp/collector/trace/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n/opentelemetry/proto/trace/v1/trace_config.proto\x12\x1copentelemetry.proto.trace.v1\"\xc8\x03\n\x0bTraceConfig\x12I\n\x10\x63onstant_sampler\x18\x01 \x01(\x0b\x32-.opentelemetry.proto.trace.v1.ConstantSamplerH\x00\x12O\n\x14trace_id_ratio_based\x18\x02 \x01(\x0b\x32/.opentelemetry.proto.trace.v1.TraceIdRatioBasedH\x00\x12R\n\x15rate_limiting_sampler\x18\x03 \x01(\x0b\x32\x31.opentelemetry.proto.trace.v1.RateLimitingSamplerH\x00\x12 \n\x18max_number_of_attributes\x18\x04 \x01(\x03\x12\"\n\x1amax_number_of_timed_events\x18\x05 \x01(\x03\x12\x30\n(max_number_of_attributes_per_timed_event\x18\x06 \x01(\x03\x12\x1b\n\x13max_number_of_links\x18\x07 \x01(\x03\x12)\n!max_number_of_attributes_per_link\x18\x08 \x01(\x03\x42\t\n\x07sampler\"\xa9\x01\n\x0f\x43onstantSampler\x12P\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32>.opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision\"D\n\x10\x43onstantDecision\x12\x0e\n\nALWAYS_OFF\x10\x00\x12\r\n\tALWAYS_ON\x10\x01\x12\x11\n\rALWAYS_PARENT\x10\x02\"*\n\x11TraceIdRatioBased\x12\x15\n\rsamplingRatio\x18\x01 \x01(\x01\"\"\n\x13RateLimitingSampler\x12\x0b\n\x03qps\x18\x01 \x01(\x03\x42~\n\x1fio.opentelemetry.proto.trace.v1B\x10TraceConfigProtoP\x01ZGgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1b\x06proto3' + serialized_pb=b'\n/opentelemetry/proto/trace/v1/trace_config.proto\x12\x1copentelemetry.proto.trace.v1\"\xc8\x03\n\x0bTraceConfig\x12I\n\x10\x63onstant_sampler\x18\x01 \x01(\x0b\x32-.opentelemetry.proto.trace.v1.ConstantSamplerH\x00\x12O\n\x14trace_id_ratio_based\x18\x02 \x01(\x0b\x32/.opentelemetry.proto.trace.v1.TraceIdRatioBasedH\x00\x12R\n\x15rate_limiting_sampler\x18\x03 \x01(\x0b\x32\x31.opentelemetry.proto.trace.v1.RateLimitingSamplerH\x00\x12 \n\x18max_number_of_attributes\x18\x04 \x01(\x03\x12\"\n\x1amax_number_of_timed_events\x18\x05 \x01(\x03\x12\x30\n(max_number_of_attributes_per_timed_event\x18\x06 \x01(\x03\x12\x1b\n\x13max_number_of_links\x18\x07 \x01(\x03\x12)\n!max_number_of_attributes_per_link\x18\x08 \x01(\x03\x42\t\n\x07sampler\"\xa9\x01\n\x0f\x43onstantSampler\x12P\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32>.opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision\"D\n\x10\x43onstantDecision\x12\x0e\n\nALWAYS_OFF\x10\x00\x12\r\n\tALWAYS_ON\x10\x01\x12\x11\n\rALWAYS_PARENT\x10\x02\"*\n\x11TraceIdRatioBased\x12\x15\n\rsamplingRatio\x18\x01 \x01(\x01\"\"\n\x13RateLimitingSampler\x12\x0b\n\x03qps\x18\x01 \x01(\x03\x42h\n\x1fio.opentelemetry.proto.trace.v1B\x10TraceConfigProtoP\x01Z1go.opentelemetry.io/proto/otlp/collector/trace/v1b\x06proto3' ) diff --git a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py index b231fd0d140..7c4057ca7b8 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py @@ -19,9 +19,9 @@ name='opentelemetry/proto/trace/v1/trace.proto', package='opentelemetry.proto.trace.v1', syntax='proto3', - serialized_options=b'\n\037io.opentelemetry.proto.trace.v1B\nTraceProtoP\001Z=github.com/open-telemetry/opentelemetry-proto/gen/go/trace/v1', + serialized_options=b'\n\037io.opentelemetry.proto.trace.v1B\nTraceProtoP\001Z\'go.opentelemetry.io/proto/otlp/trace/v1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\xc2\x01\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12`\n\x1dinstrumentation_library_spans\x18\x02 \x03(\x0b\x32\x39.opentelemetry.proto.trace.v1.InstrumentationLibrarySpans\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xbc\x01\n\x1bInstrumentationLibrarySpans\x12V\n\x17instrumentation_library\x18\x01 \x01(\x0b\x32\x35.opentelemetry.proto.common.v1.InstrumentationLibrary\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xe6\x07\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\x9d\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02\x42n\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z=github.com/open-telemetry/opentelemetry-proto/gen/go/trace/v1b\x06proto3' + serialized_pb=b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\x86\x02\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12=\n\x0bscope_spans\x18\x02 \x03(\x0b\x32(.opentelemetry.proto.trace.v1.ScopeSpans\x12\x65\n\x1dinstrumentation_library_spans\x18\xe8\x07 \x03(\x0b\x32\x39.opentelemetry.proto.trace.v1.InstrumentationLibrarySpansB\x02\x18\x01\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x97\x01\n\nScopeSpans\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xc0\x01\n\x1bInstrumentationLibrarySpans\x12V\n\x17instrumentation_library\x18\x01 \x01(\x0b\x32\x35.opentelemetry.proto.common.v1.InstrumentationLibrary\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t:\x02\x18\x01\"\xe6\x07\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\x9d\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02\x42X\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z\'go.opentelemetry.io/proto/otlp/trace/v1b\x06proto3' , dependencies=[opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2.DESCRIPTOR,]) @@ -67,8 +67,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1483, - serialized_end=1636, + serialized_start=1709, + serialized_end=1862, ) _sym_db.RegisterEnumDescriptor(_SPAN_SPANKIND) @@ -97,8 +97,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1729, - serialized_end=1807, + serialized_start=1955, + serialized_end=2033, ) _sym_db.RegisterEnumDescriptor(_STATUS_STATUSCODE) @@ -151,14 +151,21 @@ is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='instrumentation_library_spans', full_name='opentelemetry.proto.trace.v1.ResourceSpans.instrumentation_library_spans', index=1, + name='scope_spans', full_name='opentelemetry.proto.trace.v1.ResourceSpans.scope_spans', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='schema_url', full_name='opentelemetry.proto.trace.v1.ResourceSpans.schema_url', index=2, + name='instrumentation_library_spans', full_name='opentelemetry.proto.trace.v1.ResourceSpans.instrumentation_library_spans', index=2, + number=1000, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='schema_url', full_name='opentelemetry.proto.trace.v1.ResourceSpans.schema_url', index=3, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -177,7 +184,53 @@ oneofs=[ ], serialized_start=250, - serialized_end=444, + serialized_end=512, +) + + +_SCOPESPANS = _descriptor.Descriptor( + name='ScopeSpans', + full_name='opentelemetry.proto.trace.v1.ScopeSpans', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='scope', full_name='opentelemetry.proto.trace.v1.ScopeSpans.scope', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='spans', full_name='opentelemetry.proto.trace.v1.ScopeSpans.spans', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='schema_url', full_name='opentelemetry.proto.trace.v1.ScopeSpans.schema_url', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=515, + serialized_end=666, ) @@ -216,14 +269,14 @@ nested_types=[], enum_types=[ ], - serialized_options=None, + serialized_options=b'\030\001', is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], - serialized_start=447, - serialized_end=635, + serialized_start=669, + serialized_end=861, ) @@ -275,8 +328,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1180, - serialized_end=1320, + serialized_start=1406, + serialized_end=1546, ) _SPAN_LINK = _descriptor.Descriptor( @@ -334,8 +387,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1323, - serialized_end=1480, + serialized_start=1549, + serialized_end=1706, ) _SPAN = _descriptor.Descriptor( @@ -464,8 +517,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=638, - serialized_end=1636, + serialized_start=864, + serialized_end=1862, ) @@ -504,13 +557,16 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1639, - serialized_end=1813, + serialized_start=1865, + serialized_end=2039, ) _TRACESDATA.fields_by_name['resource_spans'].message_type = _RESOURCESPANS _RESOURCESPANS.fields_by_name['resource'].message_type = opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2._RESOURCE +_RESOURCESPANS.fields_by_name['scope_spans'].message_type = _SCOPESPANS _RESOURCESPANS.fields_by_name['instrumentation_library_spans'].message_type = _INSTRUMENTATIONLIBRARYSPANS +_SCOPESPANS.fields_by_name['scope'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._INSTRUMENTATIONSCOPE +_SCOPESPANS.fields_by_name['spans'].message_type = _SPAN _INSTRUMENTATIONLIBRARYSPANS.fields_by_name['instrumentation_library'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._INSTRUMENTATIONLIBRARY _INSTRUMENTATIONLIBRARYSPANS.fields_by_name['spans'].message_type = _SPAN _SPAN_EVENT.fields_by_name['attributes'].message_type = opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2._KEYVALUE @@ -527,6 +583,7 @@ _STATUS_STATUSCODE.containing_type = _STATUS DESCRIPTOR.message_types_by_name['TracesData'] = _TRACESDATA DESCRIPTOR.message_types_by_name['ResourceSpans'] = _RESOURCESPANS +DESCRIPTOR.message_types_by_name['ScopeSpans'] = _SCOPESPANS DESCRIPTOR.message_types_by_name['InstrumentationLibrarySpans'] = _INSTRUMENTATIONLIBRARYSPANS DESCRIPTOR.message_types_by_name['Span'] = _SPAN DESCRIPTOR.message_types_by_name['Status'] = _STATUS @@ -546,6 +603,13 @@ }) _sym_db.RegisterMessage(ResourceSpans) +ScopeSpans = _reflection.GeneratedProtocolMessageType('ScopeSpans', (_message.Message,), { + 'DESCRIPTOR' : _SCOPESPANS, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.ScopeSpans) + }) +_sym_db.RegisterMessage(ScopeSpans) + InstrumentationLibrarySpans = _reflection.GeneratedProtocolMessageType('InstrumentationLibrarySpans', (_message.Message,), { 'DESCRIPTOR' : _INSTRUMENTATIONLIBRARYSPANS, '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' @@ -585,4 +649,6 @@ DESCRIPTOR._options = None +_RESOURCESPANS.fields_by_name['instrumentation_library_spans']._options = None +_INSTRUMENTATIONLIBRARYSPANS._options = None # @@protoc_insertion_point(module_scope) diff --git a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi index 16491d9230e..170d66e1c56 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi @@ -45,9 +45,10 @@ class TracesData(google.protobuf.message.Message): global___TracesData = TracesData class ResourceSpans(google.protobuf.message.Message): - """A collection of InstrumentationLibrarySpans from a Resource.""" + """A collection of ScopeSpans from a Resource.""" DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... RESOURCE_FIELD_NUMBER: builtins.int + SCOPE_SPANS_FIELD_NUMBER: builtins.int INSTRUMENTATION_LIBRARY_SPANS_FIELD_NUMBER: builtins.int SCHEMA_URL_FIELD_NUMBER: builtins.int @property @@ -57,27 +58,92 @@ class ResourceSpans(google.protobuf.message.Message): """ pass @property + def scope_spans(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ScopeSpans]: + """A list of ScopeSpans that originate from a resource.""" + pass + @property def instrumentation_library_spans(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InstrumentationLibrarySpans]: - """A list of InstrumentationLibrarySpans that originate from a resource.""" + """A list of InstrumentationLibrarySpans that originate from a resource. + This field is deprecated and will be removed after grace period expires on June 15, 2022. + + During the grace period the following rules SHOULD be followed: + + For Binary Protobufs + ==================== + Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + scope_spans SHOULD be set. + + Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + and scope_spans is not set then the value in instrumentation_library_spans + SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + + For JSON + ======== + JSON senders that set instrumentation_library_spans field MAY also set + scope_spans to carry the same spans, essentially double-publishing the same data. + Such double-publishing MAY be controlled by a user-settable option. + If double-publishing is not used then the senders SHOULD set scope_spans and + SHOULD NOT set instrumentation_library_spans. + + JSON receivers SHOULD check if instrumentation_library_spans is set and + scope_spans is not set then the value in instrumentation_library_spans + SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. + """ pass schema_url: typing.Text = ... """This schema_url applies to the data in the "resource" field. It does not apply - to the data in the "instrumentation_library_spans" field which have their own - schema_url field. + to the data in the "scope_spans" field which have their own schema_url field. """ def __init__(self, *, resource : typing.Optional[opentelemetry.proto.resource.v1.resource_pb2.Resource] = ..., + scope_spans : typing.Optional[typing.Iterable[global___ScopeSpans]] = ..., instrumentation_library_spans : typing.Optional[typing.Iterable[global___InstrumentationLibrarySpans]] = ..., schema_url : typing.Text = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["resource",b"resource"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_spans",b"instrumentation_library_spans","resource",b"resource","schema_url",b"schema_url"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["instrumentation_library_spans",b"instrumentation_library_spans","resource",b"resource","schema_url",b"schema_url","scope_spans",b"scope_spans"]) -> None: ... global___ResourceSpans = ResourceSpans +class ScopeSpans(google.protobuf.message.Message): + """A collection of Spans produced by an InstrumentationScope.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + SCOPE_FIELD_NUMBER: builtins.int + SPANS_FIELD_NUMBER: builtins.int + SCHEMA_URL_FIELD_NUMBER: builtins.int + @property + def scope(self) -> opentelemetry.proto.common.v1.common_pb2.InstrumentationScope: + """The instrumentation scope information for the spans in this message. + Semantically when InstrumentationScope isn't set, it is equivalent with + an empty instrumentation scope name (unknown). + """ + pass + @property + def spans(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Span]: + """A list of Spans that originate from an instrumentation scope.""" + pass + schema_url: typing.Text = ... + """This schema_url applies to all spans and span events in the "spans" field.""" + + def __init__(self, + *, + scope : typing.Optional[opentelemetry.proto.common.v1.common_pb2.InstrumentationScope] = ..., + spans : typing.Optional[typing.Iterable[global___Span]] = ..., + schema_url : typing.Text = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["scope",b"scope"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["schema_url",b"schema_url","scope",b"scope","spans",b"spans"]) -> None: ... +global___ScopeSpans = ScopeSpans + class InstrumentationLibrarySpans(google.protobuf.message.Message): - """A collection of Spans produced by an InstrumentationLibrary.""" + """A collection of Spans produced by an InstrumentationLibrary. + InstrumentationLibrarySpans is wire-compatible with ScopeSpans for binary + Protobuf format. + This message is deprecated and will be removed on June 15, 2022. + """ DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... INSTRUMENTATION_LIBRARY_FIELD_NUMBER: builtins.int SPANS_FIELD_NUMBER: builtins.int @@ -210,7 +276,10 @@ class Span(google.protobuf.message.Message): @property def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: - """attributes is a collection of attribute key/value pairs on the event.""" + """attributes is a collection of attribute key/value pairs on the event. + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). + """ pass dropped_attributes_count: builtins.int = ... """dropped_attributes_count is the number of dropped attributes. If the value is 0, @@ -251,7 +320,10 @@ class Span(google.protobuf.message.Message): @property def attributes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: - """attributes is a collection of attribute key/value pairs on the link.""" + """attributes is a collection of attribute key/value pairs on the link. + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). + """ pass dropped_attributes_count: builtins.int = ... """dropped_attributes_count is the number of dropped attributes. If the value is 0, @@ -366,6 +438,8 @@ class Span(google.protobuf.message.Message): The OpenTelemetry API specification further restricts the allowed value types: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). """ pass dropped_attributes_count: builtins.int = ... diff --git a/scripts/proto_codegen.sh b/scripts/proto_codegen.sh index 08875e14286..62df015d367 100755 --- a/scripts/proto_codegen.sh +++ b/scripts/proto_codegen.sh @@ -12,7 +12,7 @@ # PROTO_REPO_DIR - the path to an existing checkout of the opentelemetry-proto repo # Pinned commit/branch/tag for the current version used in opentelemetry-proto python package. -PROTO_REPO_BRANCH_OR_COMMIT="v0.12.0" +PROTO_REPO_BRANCH_OR_COMMIT="v0.15.0" set -e