diff --git a/Makefile b/Makefile index 4f52d69f2..5b9ff10cc 100644 --- a/Makefile +++ b/Makefile @@ -163,7 +163,7 @@ gen-ruby: # The Profiling protocol is still development. So it is excluded from the breaking-change check. .PHONY: breaking-change breaking-change: - $(BUF) breaking --against $(BUF_AGAINST) --config '{"version":"v1","breaking":{"ignore":["opentelemetry/proto/profiles", "opentelemetry/proto/collector/profiles"]}}' $(BUF_FLAGS) + $(BUF) breaking --against $(BUF_AGAINST) --config '{"version":"v1","breaking":{"ignore":["opentelemetry/proto/profiles", "opentelemetry/proto/collector/profiles", "opentelemetry/proto/entities", "opentelemetry/proto/collector/entities"]}}' $(BUF_FLAGS) ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' | sort) 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..575fad8c8 100644 --- a/opentelemetry/proto/resource/v1/resource.proto +++ b/opentelemetry/proto/resource/v1/resource.proto @@ -35,10 +35,36 @@ 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. + // 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 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; }