From 78f58a2838433ea161271093322bf39071a43cb5 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan Date: Thu, 26 Sep 2024 11:53:13 -0400 Subject: [PATCH] Update proto to reflect OTEP 0264 requirements There is now multiple ResourceEntityRefs in the Resource. --- opentelemetry/proto/logs/v1/logs.proto | 2 ++ opentelemetry/proto/metrics/v1/metrics.proto | 2 ++ .../profiles/v1development/profiles.proto | 2 ++ .../proto/resource/v1/resource.proto | 36 +++++++++++++++---- opentelemetry/proto/trace/v1/trace.proto | 2 ++ 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/opentelemetry/proto/logs/v1/logs.proto b/opentelemetry/proto/logs/v1/logs.proto index f9b97dd74..14077facf 100644 --- a/opentelemetry/proto/logs/v1/logs.proto +++ b/opentelemetry/proto/logs/v1/logs.proto @@ -60,6 +60,8 @@ message ResourceLogs { // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_logs" field which have their own schema_url field. + // + // This field is deprecated in favour of Resource.entities.schema_url. string schema_url = 3; } diff --git a/opentelemetry/proto/metrics/v1/metrics.proto b/opentelemetry/proto/metrics/v1/metrics.proto index 1a9e0b77c..9dfb4fb83 100644 --- a/opentelemetry/proto/metrics/v1/metrics.proto +++ b/opentelemetry/proto/metrics/v1/metrics.proto @@ -78,6 +78,8 @@ message ResourceMetrics { // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_metrics" field which have their own schema_url field. + // + // This field is deprecated in favour of Resource.entities.schema_url. string schema_url = 3; } diff --git a/opentelemetry/proto/profiles/v1development/profiles.proto b/opentelemetry/proto/profiles/v1development/profiles.proto index 89b778ea8..99d9335c0 100644 --- a/opentelemetry/proto/profiles/v1development/profiles.proto +++ b/opentelemetry/proto/profiles/v1development/profiles.proto @@ -117,6 +117,8 @@ message ResourceProfiles { // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_profiles" field which have their own schema_url field. + // + // This field is deprecated in favour of Resource.entities.schema_url. string schema_url = 3; } diff --git a/opentelemetry/proto/resource/v1/resource.proto b/opentelemetry/proto/resource/v1/resource.proto index 55b78e528..e21beda81 100644 --- a/opentelemetry/proto/resource/v1/resource.proto +++ b/opentelemetry/proto/resource/v1/resource.proto @@ -35,10 +35,34 @@ message Resource { // no attributes were dropped. uint32 dropped_attributes_count = 2; - // Defines the producing entity type of this resource, e.g "service", "k8s.pod", etc. - string entity_type = 3; - - // Set of attributes that identify the producing entity. - // Note that the identifying attributes may be also recorded in the "attributes" field. - repeated opentelemetry.proto.common.v1.KeyValue entity_id = 4; + // Set of entities that participate in this Resource. + repeated ResourceEntityRef entities = 3; } + +message ResourceEntityRef { + // 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. + // + // 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 Resource.attributes. + repeated string id_attr_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 Resource.attributes. + repeated string descr_attr_keys = 4; +} \ No newline at end of file diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 5cb2f3ce1..6d3d39b01 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -60,6 +60,8 @@ message ResourceSpans { // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_spans" field which have their own schema_url field. + // + // This field is deprecated in favour of Resource.entities.schema_url. string schema_url = 3; }