Skip to content

Commit e4fd4f6

Browse files
jsuerethsmith
andauthored
Add EntityRef and use it in Resource. (open-telemetry#635)
* Add EntityRef and use it in Resource. * Update opentelemetry/proto/resource/v1/resource.proto Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> * Update opentelemetry/proto/common/v1/common.proto Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> * Update opentelemetry/proto/common/v1/common.proto Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> --------- Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
1 parent 9d7c091 commit e4fd4f6

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

opentelemetry/proto/common/v1/common.proto

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,37 @@ message InstrumentationScope {
7979
repeated KeyValue attributes = 3;
8080
uint32 dropped_attributes_count = 4;
8181
}
82+
83+
// A reference to an Entity.
84+
// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
85+
//
86+
// Status: [Development]
87+
message EntityRef {
88+
// The Schema URL, if known. This is the identifier of the Schema that the entity data
89+
// is recorded in. To learn more about Schema URL see
90+
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
91+
//
92+
// This schema_url applies to the data in this message and to the Resource attributes
93+
// referenced by id_keys and description_keys.
94+
// TODO: discuss if we are happy with this somewhat complicated definition of what
95+
// the schema_url applies to.
96+
//
97+
// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
98+
string schema_url = 1;
99+
100+
// Defines the type of the entity. MUST not change during the lifetime of the entity.
101+
// For example: "service" or "host". This field is required and MUST not be empty
102+
// for valid entities.
103+
string type = 2;
104+
105+
// Attribute Keys that identify the entity.
106+
// MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
107+
// These keys MUST exist in the containing {message}.attributes.
108+
repeated string id_keys = 3;
109+
110+
// Descriptive (non-identifying) attribute keys of the entity.
111+
// MAY change over the lifetime of the entity. MAY be empty.
112+
// These attribute keys are not part of entity's identity.
113+
// These keys MUST exist in the containing {message}.attributes.
114+
repeated string description_keys = 4;
115+
}

opentelemetry/proto/resource/v1/resource.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@ message Resource {
3434
// dropped_attributes_count is the number of dropped attributes. If the value is 0, then
3535
// no attributes were dropped.
3636
uint32 dropped_attributes_count = 2;
37+
38+
// Set of entities that participate in this Resource.
39+
//
40+
// Note: keys in the references MUST exist in attributes of this message.
41+
//
42+
// Status: [Development]
43+
repeated opentelemetry.proto.common.v1.EntityRef entity_refs = 3;
3744
}

0 commit comments

Comments
 (0)