Skip to content

Commit

Permalink
Update proto to reflect OTEP 0264 requirements
Browse files Browse the repository at this point in the history
There is now multiple ResourceEntityRefs in the Resource.
  • Loading branch information
tigrannajaryan committed Sep 26, 2024
1 parent e5ce418 commit 7ddec65
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry/proto/logs/v1/logs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions opentelemetry/proto/metrics/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions opentelemetry/proto/profiles/v1development/profiles.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
38 changes: 32 additions & 6 deletions opentelemetry/proto/resource/v1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions opentelemetry/proto/trace/v1/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7ddec65

Please sign in to comment.