diff --git a/opentelemetry-otlp/tests/integration_test/expected/serialized_traces.json b/opentelemetry-otlp/tests/integration_test/expected/serialized_traces.json index f1d64108ad..e4e44c50a5 100644 --- a/opentelemetry-otlp/tests/integration_test/expected/serialized_traces.json +++ b/opentelemetry-otlp/tests/integration_test/expected/serialized_traces.json @@ -10,7 +10,8 @@ } } ], - "droppedAttributesCount": 0 + "droppedAttributesCount": 0, + "entityRefs": [] }, "scopeSpans": [ { diff --git a/opentelemetry-proto/CHANGELOG.md b/opentelemetry-proto/CHANGELOG.md index fe745ca785..e53c832369 100644 --- a/opentelemetry-proto/CHANGELOG.md +++ b/opentelemetry-proto/CHANGELOG.md @@ -3,6 +3,7 @@ ## vNext - Update `tonic` dependency version to 0.13 +- - Update proto definitions to v1.6.0. ## 0.29.0 diff --git a/opentelemetry-proto/src/proto/opentelemetry-proto b/opentelemetry-proto/src/proto/opentelemetry-proto index 2bd940b2b7..be5d584704 160000 --- a/opentelemetry-proto/src/proto/opentelemetry-proto +++ b/opentelemetry-proto/src/proto/opentelemetry-proto @@ -1 +1 @@ -Subproject commit 2bd940b2b77c1ab57c27166af21384906da7bb2b +Subproject commit be5d58470429d0255ffdd49491f0815a3a63d6ef diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.logs.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.logs.v1.rs index 8a760a46b4..bc9238e340 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.logs.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.logs.v1.rs @@ -153,8 +153,6 @@ pub mod logs_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. pub async fn export( &mut self, request: impl tonic::IntoRequest, @@ -200,8 +198,6 @@ pub mod logs_service_server { /// Generated trait containing gRPC methods that should be implemented for use with LogsServiceServer. #[async_trait] pub trait LogsService: std::marker::Send + std::marker::Sync + 'static { - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. async fn export( &self, request: tonic::Request, diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.metrics.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.metrics.v1.rs index e1021eaefe..0da402a848 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.metrics.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.metrics.v1.rs @@ -153,8 +153,6 @@ pub mod metrics_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. pub async fn export( &mut self, request: impl tonic::IntoRequest, @@ -200,8 +198,6 @@ pub mod metrics_service_server { /// Generated trait containing gRPC methods that should be implemented for use with MetricsServiceServer. #[async_trait] pub trait MetricsService: std::marker::Send + std::marker::Sync + 'static { - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. async fn export( &self, request: tonic::Request, diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.trace.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.trace.v1.rs index 5cc02d67d1..5f5aa09ca2 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.trace.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.trace.v1.rs @@ -153,8 +153,6 @@ pub mod trace_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. pub async fn export( &mut self, request: impl tonic::IntoRequest, @@ -200,8 +198,6 @@ pub mod trace_service_server { /// Generated trait containing gRPC methods that should be implemented for use with TraceServiceServer. #[async_trait] pub trait TraceService: std::marker::Send + std::marker::Sync + 'static { - /// For performance reasons, it is recommended to keep this RPC - /// alive for the entire life of the application. async fn export( &self, request: tonic::Request, diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.common.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.common.v1.rs index b5bde05c27..46ed18a434 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.common.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.common.v1.rs @@ -106,3 +106,41 @@ pub struct InstrumentationScope { #[prost(uint32, tag = "4")] pub dropped_attributes_count: u32, } +/// A reference to an Entity. +/// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs. +/// +/// Status: \[Development\] +#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EntityRef { + /// The Schema URL, if known. This is the identifier of the Schema that the entity data + /// is recorded in. To learn more about Schema URL see + /// + /// + /// This schema_url applies to the data in this message and to the Resource attributes + /// referenced by id_keys and description_keys. + /// TODO: discuss if we are happy with this somewhat complicated definition of what + /// the schema_url applies to. + /// + /// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs. + #[prost(string, tag = "1")] + pub schema_url: ::prost::alloc::string::String, + /// Defines the type of the entity. MUST not change during the lifetime of the entity. + /// For example: "service" or "host". This field is required and MUST not be empty + /// for valid entities. + #[prost(string, tag = "2")] + pub r#type: ::prost::alloc::string::String, + /// Attribute Keys that identify the entity. + /// MUST not change during the lifetime of the entity. The Id must contain at least one attribute. + /// These keys MUST exist in the containing {message}.attributes. + #[prost(string, repeated, tag = "3")] + pub id_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Descriptive (non-identifying) attribute keys of the entity. + /// MAY change over the lifetime of the entity. MAY be empty. + /// These attribute keys are not part of entity's identity. + /// These keys MUST exist in the containing {message}.attributes. + #[prost(string, repeated, tag = "4")] + pub description_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.logs.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.logs.v1.rs index 04f1c6dad4..d5a4780649 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.logs.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.logs.v1.rs @@ -190,8 +190,6 @@ pub struct LogRecord { /// as an event. /// /// \[Optional\]. - /// - /// Status: \[Development\] #[prost(string, tag = "12")] pub event_name: ::prost::alloc::string::String, } diff --git a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.resource.v1.rs b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.resource.v1.rs index 58e244b35e..817277e03c 100644 --- a/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.resource.v1.rs +++ b/opentelemetry-proto/src/proto/tonic/opentelemetry.proto.resource.v1.rs @@ -15,4 +15,11 @@ pub struct Resource { /// no attributes were dropped. #[prost(uint32, tag = "2")] pub dropped_attributes_count: u32, + /// Set of entities that participate in this Resource. + /// + /// Note: keys in the references MUST exist in attributes of this message. + /// + /// Status: \[Development\] + #[prost(message, repeated, tag = "3")] + pub entity_refs: ::prost::alloc::vec::Vec, } diff --git a/opentelemetry-proto/src/transform/logs.rs b/opentelemetry-proto/src/transform/logs.rs index 008ee4cc4d..65d0598216 100644 --- a/opentelemetry-proto/src/transform/logs.rs +++ b/opentelemetry-proto/src/transform/logs.rs @@ -150,6 +150,7 @@ pub mod tonic { resource: Some(Resource { attributes: resource.attributes.0.clone(), dropped_attributes_count: 0, + entity_refs: vec![], }), schema_url: resource.schema_url.clone().unwrap_or_default(), scope_logs: vec![ScopeLogs { @@ -210,6 +211,7 @@ pub mod tonic { resource: Some(Resource { attributes: resource.attributes.0.clone(), dropped_attributes_count: 0, + entity_refs: vec![], }), scope_logs, schema_url: resource.schema_url.clone().unwrap_or_default(), diff --git a/opentelemetry-proto/src/transform/metrics.rs b/opentelemetry-proto/src/transform/metrics.rs index c040898ec3..87ce22fc50 100644 --- a/opentelemetry-proto/src/transform/metrics.rs +++ b/opentelemetry-proto/src/transform/metrics.rs @@ -127,6 +127,7 @@ pub mod tonic { TonicResource { attributes: resource.iter().map(Into::into).collect(), dropped_attributes_count: 0, + entity_refs: vec![], // internal and currently unused } } } diff --git a/opentelemetry-proto/src/transform/trace.rs b/opentelemetry-proto/src/transform/trace.rs index 636296f654..231834a30d 100644 --- a/opentelemetry-proto/src/transform/trace.rs +++ b/opentelemetry-proto/src/transform/trace.rs @@ -97,6 +97,7 @@ pub mod tonic { resource: Some(Resource { attributes: resource.attributes.0.clone(), dropped_attributes_count: 0, + entity_refs: vec![], }), schema_url: resource.schema_url.clone().unwrap_or_default(), scope_spans: vec![ScopeSpans { @@ -182,6 +183,7 @@ pub mod tonic { resource: Some(Resource { attributes: resource.attributes.0.clone(), dropped_attributes_count: 0, + entity_refs: vec![], }), scope_spans, schema_url: resource.schema_url.clone().unwrap_or_default(), diff --git a/opentelemetry-proto/tests/json_serde.rs b/opentelemetry-proto/tests/json_serde.rs index 737a94e3f6..cfa6179619 100644 --- a/opentelemetry-proto/tests/json_serde.rs +++ b/opentelemetry-proto/tests/json_serde.rs @@ -44,6 +44,7 @@ mod json_serde { }), }], dropped_attributes_count: 0, + entity_refs: vec![], }), scope_spans: vec![ScopeSpans { scope: Some(InstrumentationScope { @@ -249,6 +250,7 @@ mod json_serde { }), }], dropped_attributes_count: 1, + entity_refs: vec![], }), scope_spans: vec![ScopeSpans { scope: Some(InstrumentationScope { @@ -792,6 +794,7 @@ mod json_serde { }), }], dropped_attributes_count: 0, + entity_refs: vec![], }), scope_metrics: vec![ScopeMetrics { scope: Some(InstrumentationScope { @@ -1178,6 +1181,7 @@ mod json_serde { }), }], dropped_attributes_count: 0, + entity_refs: vec![], }), scope_logs: vec![ScopeLogs { scope: Some(InstrumentationScope {