From e87d2a31ff5ebf6055905858c4a7be5f78583335 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 6 Mar 2025 12:15:58 -0500 Subject: [PATCH 1/4] Add EntityRef and use it in Resource. --- opentelemetry/proto/common/v1/common.proto | 34 +++++++++++++++++++ .../proto/resource/v1/resource.proto | 7 ++++ 2 files changed, 41 insertions(+) diff --git a/opentelemetry/proto/common/v1/common.proto b/opentelemetry/proto/common/v1/common.proto index ff8a21a1..4e9187bc 100644 --- a/opentelemetry/proto/common/v1/common.proto +++ b/opentelemetry/proto/common/v1/common.proto @@ -79,3 +79,37 @@ message InstrumentationScope { repeated KeyValue attributes = 3; uint32 dropped_attributes_count = 4; } + +// A reference to an Entity. +// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics or logs. +// +// Status: [Development] +message 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 + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // + // This schema_url applies to the data in this message and to the Resource attributes + // referenced by id_attr_keys and descr_attr_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. + string schema_url = 1; + + // 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. + string type = 2; + + // 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. + repeated string id_keys = 3; + + // 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. + repeated string description_keys = 4; +} \ No newline at end of file diff --git a/opentelemetry/proto/resource/v1/resource.proto b/opentelemetry/proto/resource/v1/resource.proto index 6637560b..05c8c882 100644 --- a/opentelemetry/proto/resource/v1/resource.proto +++ b/opentelemetry/proto/resource/v1/resource.proto @@ -34,4 +34,11 @@ message Resource { // dropped_attributes_count is the number of dropped attributes. If the value is 0, then // no attributes were dropped. uint32 dropped_attributes_count = 2; + + // Set of entities that participate in this Resource. + // + // Note: keys in the references MUST existing in attributes of this message. + // + // Status: [Development] + repeated opentelemetry.proto.common.v1.EntityRef entity_refs = 3; } From 5a968800cd173cf9fcaee794ce4823db21fccb85 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 18 Mar 2025 12:17:10 -0700 Subject: [PATCH 2/4] Update opentelemetry/proto/resource/v1/resource.proto Co-authored-by: Nathan L Smith --- opentelemetry/proto/resource/v1/resource.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/resource/v1/resource.proto b/opentelemetry/proto/resource/v1/resource.proto index 05c8c882..05d44568 100644 --- a/opentelemetry/proto/resource/v1/resource.proto +++ b/opentelemetry/proto/resource/v1/resource.proto @@ -37,7 +37,7 @@ message Resource { // Set of entities that participate in this Resource. // - // Note: keys in the references MUST existing in attributes of this message. + // Note: keys in the references MUST exist in attributes of this message. // // Status: [Development] repeated opentelemetry.proto.common.v1.EntityRef entity_refs = 3; From 95e154bcf91daac7021697212e9a951c038d0d2e Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 18 Mar 2025 12:17:24 -0700 Subject: [PATCH 3/4] Update opentelemetry/proto/common/v1/common.proto Co-authored-by: Nathan L Smith --- opentelemetry/proto/common/v1/common.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/common/v1/common.proto b/opentelemetry/proto/common/v1/common.proto index 4e9187bc..b2f0f1f6 100644 --- a/opentelemetry/proto/common/v1/common.proto +++ b/opentelemetry/proto/common/v1/common.proto @@ -90,7 +90,7 @@ message EntityRef { // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // // This schema_url applies to the data in this message and to the Resource attributes - // referenced by id_attr_keys and descr_attr_keys. + // 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. // From 0a24a63d048526aa3d79faf720ef45f6aaa1c916 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 18 Mar 2025 12:17:29 -0700 Subject: [PATCH 4/4] Update opentelemetry/proto/common/v1/common.proto Co-authored-by: Nathan L Smith --- opentelemetry/proto/common/v1/common.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/common/v1/common.proto b/opentelemetry/proto/common/v1/common.proto index b2f0f1f6..57c9f86e 100644 --- a/opentelemetry/proto/common/v1/common.proto +++ b/opentelemetry/proto/common/v1/common.proto @@ -81,7 +81,7 @@ message InstrumentationScope { } // A reference to an Entity. -// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics or logs. +// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs. // // Status: [Development] message EntityRef {