Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 64c6b15

Browse files
committed
Some lint fixes.
1 parent e3a3de0 commit 64c6b15

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

text/entities/0264-resource-and-entities.md

+25-23
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ current resource specification.
88

99
<!-- tocstop -->
1010

11-
1211
## Motivation
1312

1413
This proposal attempts to focus on the following problems within OpenTelemetry to unblock multiple working groups:
@@ -19,8 +18,11 @@ This proposal attempts to focus on the following problems within OpenTelemetry t
1918
- Fix current Resource merge rules in the specification, which most implementations violate ([oteps#208](https://github.com/open-telemetry/oteps/pull/208), [spec#3382](https://github.com/open-telemetry/opentelemetry-specification/issues/3382), [spec#3710](https://github.com/open-telemetry/opentelemetry-specification/issues/3710)).
2019
- Allow semantic convention resource modeling to progress ([spec#605](https://github.com/open-telemetry/opentelemetry-specification/issues/605), [spec#559](https://github.com/open-telemetry/opentelemetry-specification/issues/559), etc).
2120

22-
# Approach - Resource Improvements
23-
Start with outlining Entity detectors and Resource composition. This has a higher priority for fixing within OpenTelemetry, and needs to be unblocked sooner. Infer our way back to data model and Collector use cases.
21+
## Design
22+
23+
### Approach - Resource Improvements
24+
25+
Let's focus on outlining Entity detectors and Resource composition. This has a higher priority for fixing within OpenTelemetry, and needs to be unblocked sooner. Then infer our way back to data model and Collector use cases.
2426

2527
We define the following SDK components:
2628

@@ -32,7 +34,7 @@ We define the following SDK components:
3234
- Providing SDK-internal access to detected Resources for reporting via Log signal on configured LogProviders.
3335
- *(new) Managing Entity changes during SDK lifetime, specifically dealing with entities that have lifetimes shorter than the SDK*
3436

35-
## Resource Container
37+
#### Resource Container
3638

3739
The SDK Resource coordinator is responsible for running all configured Resource and Entity Detectors. There will be some (user-controlled, otel default) priority order to these.
3840

@@ -48,7 +50,7 @@ The SDK Resource coordinator is responsible for running all configured Resource
4850
- An OOTB "Env Variable Entity Detector" will be specified and provided vs. requiring SDK wide ENV variables for resource detection.
4951
- *Additionally, Resource Coordinator would be responsible for understanding Entity lifecycle events, for Entities whose lifetimes do not match or exceed the SDK's own lifetime (e.g. browser session).*
5052

51-
## Entity Detector
53+
#### Entity Detector
5254

5355
The Entity detector in the SDK is responsible for detecting possible entities that could identify the SDK. For Example, if the SDK is running in a kubernetes pod, it may provide an Entity for that pod. SDK Entity Detectors are only required to provide identifying attributes, but may provide descriptive attributes to ensure combined Resource contains similar attributes as today's SDK.
5456

@@ -61,7 +63,7 @@ trait EntityDetector
6163

6264
Where `Result` is the equivalent of error channel in the language of choice (e.g. in Go this would be `entities, err := e.detectEntities()`).
6365

64-
## Entity Merging and Resource
66+
#### Entity Merging and Resource
6567

6668
The most important aspect of this design is how Entities will be merged to construct a Resource. We provide a simple algorithm for this behavior:
6769

@@ -75,7 +77,7 @@ The most important aspect of this design is how Entities will be merged to const
7577

7678
Any implementation that achieves the same result as this algorithm is acceptable.
7779

78-
## Environment Variable Detector
80+
#### Environment Variable Detector
7981

8082
An Entity detector will be specified to allow Platform to inject entity identity information into workloads running on that platform. For Example, the OpenTelemetry Operator could inject information about Kubernetes Deployment + Container into the environment, which SDKs can elect to interact with (through configuration of the Environment Variable Entity Detector).
8183

@@ -94,7 +96,7 @@ The minimum requirements of this entity detector are:
9496

9597
The actual design for this ENV variable interaction would follow the approval of this OTEP.
9698

97-
## Interactions with OpenTelemetry Collector
99+
### Interactions with OpenTelemetry Collector
98100

99101
The OpenTelemetry collector can be updated to optionally interact with Entity on Resource. A new entity-focused resource detection process can be created which allows add/override behavior at the entity level, rather than individual attribute level.
100102

@@ -121,7 +123,7 @@ processor:
121123

122124
The list of detectors is given in priority order (first wins, in event of a tie, outside of override configuration). The processor may need to be updated to allow the override flag to apply to each individual detector.
123125

124-
# Datamodel Changes
126+
## Datamodel Changes
125127

126128
Given our desired design and algorithms for detecting, merging and manipulating Entities, we need the ability to denote how entity and resource relate. These changes must not break existing usage of Resource, therefore:
127129

@@ -131,7 +133,7 @@ Given our desired design and algorithms for detecting, merging and manipulating
131133

132134
The following changes are made:
133135

134-
## Resource
136+
### Resource
135137

136138
| Field | Type | Description | Changes |
137139
| ----- | ---- | ----------- | ------- |
@@ -142,7 +144,7 @@ The following changes are made:
142144

143145
The DataModel would ensure that attributes in Resource are produced from both the identifying and descriptive attributes of Entity. This does not mean the protocol needs to transmit duplicate data, that design is TBD.
144146

145-
## ResourceEntityRef
147+
### ResourceEntityRef
146148

147149
The entityref data model, would have the following changes from the original [entity OTEP](https://github.com/open-telemetry/oteps/blob/main/text/entities/0256-entities-data-model.md) to denote references within Resource:
148150

@@ -153,7 +155,7 @@ The entityref data model, would have the following changes from the original [en
153155
| identifying_attributes_keys | repeated string | Attribute Keys that identify the entity.<br/>MUST not change during the lifetime of the entity. The Id must contain at least one attribute.<br/><br/>These keys MUST exists in Resource.attributes.<br/><br/>Follows OpenTelemetry common attribute definition. SHOULD follow OpenTelemetry semantic conventions for attributes.| now a reference |
154156
| descriptive_attributes_keys | repeated string | Descriptive (non-identifying) attribute keys of the entity.<br/>MAY change over the lifetime of the entity. MAY be empty. These attribute keys are not part of entity's identity.<br/><br/>These keys MUST exist in Resource.attributes.<br/><br/>Follows any value definition in the OpenTelemetry spec - it can be a scalar value, byte array, an array or map of values. Arbitrary deep nesting of values for arrays and maps is allowed.<br/><br/>SHOULD follow OpenTelemetry semantic conventions for attributes.| now a reference |
155157

156-
# How this proposal solves the problems that motivated it
158+
## How this proposal solves the problems that motivated it
157159

158160
Let's look at some motivating problems from the [Entities Proposal](https://docs.google.com/document/d/1VUdBRInLEhO_0ABAoiLEssB1CQO_IcD5zDnaMEha42w/edit#heading=h.atg5m85uw9w8):
159161

@@ -205,11 +207,11 @@ The Resource Manager allows users to configure priority of Entity Detectors.
205207
Resource Manager is responsible for resolving entities into a cohesive Resource that meets the same demands as Resource today.
206208

207209

208-
# Open Questions
210+
## Open Questions
209211

210212
The following remain open questions:
211213

212-
## How to attach Entity "bundle" information in Resource?
214+
### How to attach Entity "bundle" information in Resource?
213215

214216
The protocol today requires a raw grab bag of Attributes on Resource. We cannot break this going forward. However, Entities represent a new mechanism of "bundling" attributes on Resource and interacting with these bundles. We do not want this to bloat the protocol, nor do we want it to cause oddities.
215217

@@ -222,46 +224,46 @@ Going forward, we have set of options:
222224

223225
The third option prevents generic code from interacting with Resource and Entity without understanding the model of each. The first keeps all usage of entity simple at the expense of duplicating information and the middle is awkward to interact with from an OTLP usage perspective. The fourth is violates our stability policy for OTLP.
224226

225-
## How to deal with Resource/Entities whose lifecycle does not match the SDK?
227+
### How to deal with Resource/Entities whose lifecycle does not match the SDK?
226228

227229
This proposal motivates a Resource Coordinator in the SDK whose job could include managing changes in entity lifetimes, but does not account for how these changes would be broadcast across TracerProvider, LogProvider, MeterProvider, etc. That would be addressed in a follow on OTEP.
228230

229-
## How to deal with Prometheus Compatibility for non-SDK telemetry?
231+
### How to deal with Prometheus Compatibility for non-SDK telemetry?
230232

231233
Today, Prometheus compatibility relies on two key attributes in Resource: service.name and service.instance.id. These are not guaranteed to exist outside of OpenTelemetry SDK generation. While this question is not fully answered, we believe outlining identity in all resources within OpenTelemetry allows us to define a solution in the future while preserving compatibility with what works today.
232234

233-
## Should entities have a domain?
235+
### Should entities have a domain?
234236

235237
Is it worth having a `domain` in addition to type for entity? We could force each entity to exist in one domain and leverage domain generically in resource management. Entity Detectors would be responsible for an entire domain, selecting only ONE to apply a resource. Domains could be layered, e.g. a Cloud-specific domain may layer on top of a Kubernetes domain, where "GKE cluster entity" identifies *which* kubernetes cluster a kuberntes infra entity is part of. This layer would be done naively, via automatic join of participating entities or explicit relationships derived from GKE specific hooks.
236238

237239
It's unclear if this is needed initially, and we believe this could be layered in later.
238240

239-
## Should resources have only one associated entity?
241+
### Should resources have only one associated entity?
240242

241243
Given the problems leading to the Entities working group, and the needs of existing Resource users today, we think it is infeasible and unscalable to limit resource to only one entity. This would place restrictions on modeling Entities that would require OpenTelemetry to be the sole source of entity definitions and hurt building an open and extensible ecosystem. Additionally it would need careful definition of solutions for the following problems/rubrics:
242244

243245
- New entities added by extension should not break existing code
244246
- Collector augmentation / enrichment (resource, e.g.) - Should be extensible and not hard-coded. We need a general algorithm not specific rulesets.
245247

246-
## What identity should entities use (LID, UUID / GUID, or other)?
248+
### What identity should entities use (LID, UUID / GUID, or other)?
247249

248250
One of the largest questions in the first entities' OTEP was how to identify an entity. This was an attempt to unify the need for Navigational attributes with the notion that only identifying attributes of Entity would show up in Resource going forward. This restriction is no longer necessary in this proposal and we should reconsider how to model identity for an Entity.
249251
250252
This can be done in follow up design / OTEPs.
251253
252-
## What happens if existing Resource translation in the collector remove resource attributes an Entity relies on?
254+
### What happens if existing Resource translation in the collector remove resource attributes an Entity relies on?
253255
254256
While we expect the collector to be the first component to start engaging with Entities in an architecture, this could lead to data model violations. We have a few options to deal with this issue:
255257
256258
- Consider this a bug and warn users not to do it.
257259
- Specify that missing attribute keys are acceptable for descriptive attribtues.
258260
- Specify that missing attribute keys denote that entities are unusable for that batch of telemetry, and treat the content as malformed.
259261
260-
# Trade-offs and mitigations
262+
## Trade-offs and mitigations
261263
262264
The design proposed here attempts to balance non-breaking (backwards and forwards compatible) changes with the need to improve problematic issues in the Specification. Given the inability of most SDKs to implement the current Resource merge specification, breaking this should have little effect on actual users. Instead, the proposed merge specification should allow implementations to match current behavior and expectation, while evolving for users who engage with the new model.
263265
264-
# Prior art and alternatives
266+
## Prior art and alternatives
265267
266268
Previously, we have a few unaccepted oteps, e.g. ([OTEP 208](https://github.com/open-telemetry/oteps/pull/208)). Additionally, there are some alternatives that were considered in the Entities WG and rejected.
267269
@@ -271,6 +273,6 @@ Below is a brief discussion of some design decisions:
271273
- **Embed fully Entity in Resource.** This was rejected because it makes it easy/trivial for Resource attributes and Entities to diverge. This would prevent the backwards/forwards compatibility goals and also require all participating OTLP users to leverage entities. Entity should be an opt-in / additional feature that may or may not be engaged with, depending on user need.
272274
- **Re-using resource detectoin as-is** This was reject as not having a viable compatibility path forward. Creating a new set of components that can preserve existing behavior while allowing users to adopt the new functionality means that users have better control of when they see / change system behavior, and adoption is more obvious across the ecosystem.
273275
274-
# Future Posibilities
276+
## Future Posibilities
275277
276278
This proposal opens the door for addressing issues where an Entity's lifetime does not match an SDK's lifetime, in addition to providing a data model where mutable (descriptive) attributes can be changed over the lifetime of a resource without affecting its idnetity. We expect a follow-on OTEP which directly handles this issue.

0 commit comments

Comments
 (0)