You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: text/entities/0264-resource-and-entities.md
+25-23
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@ current resource specification.
8
8
9
9
<!-- tocstop -->
10
10
11
-
12
11
## Motivation
13
12
14
13
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
19
18
- 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)).
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.
24
26
25
27
We define the following SDK components:
26
28
@@ -32,7 +34,7 @@ We define the following SDK components:
32
34
- Providing SDK-internal access to detected Resources for reporting via Log signal on configured LogProviders.
33
35
-*(new) Managing Entity changes during SDK lifetime, specifically dealing with entities that have lifetimes shorter than the SDK*
34
36
35
-
## Resource Container
37
+
####Resource Container
36
38
37
39
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.
38
40
@@ -48,7 +50,7 @@ The SDK Resource coordinator is responsible for running all configured Resource
48
50
- An OOTB "Env Variable Entity Detector" will be specified and provided vs. requiring SDK wide ENV variables for resource detection.
49
51
-*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).*
50
52
51
-
## Entity Detector
53
+
####Entity Detector
52
54
53
55
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.
54
56
@@ -61,7 +63,7 @@ trait EntityDetector
61
63
62
64
Where `Result` istheequivalentoferrorchannelinthelanguageofchoice (e.g.inGothiswouldbe `entities, err:=e.detectEntities()`).
Theentityrefdatamodel, wouldhavethefollowingchangesfromtheoriginal [entityOTEP](https://github.com/open-telemetry/oteps/blob/main/text/entities/0256-entities-data-model.md) to denote references within Resource:
148
150
@@ -153,7 +155,7 @@ The entityref data model, would have the following changes from the original [en
Oneofthelargestquestionsinthefirstentities' 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.
249
251
250
252
This can be done in follow up design / OTEPs.
251
253
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?
253
255
254
256
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:
255
257
256
258
- Consider this a bug and warn users not to do it.
257
259
- Specify that missing attribute keys are acceptable for descriptive attribtues.
258
260
- Specify that missing attribute keys denote that entities are unusable for that batch of telemetry, and treat the content as malformed.
259
261
260
-
# Trade-offs and mitigations
262
+
## Trade-offs and mitigations
261
263
262
264
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.
263
265
264
-
# Prior art and alternatives
266
+
## Prior art and alternatives
265
267
266
268
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.
267
269
@@ -271,6 +273,6 @@ Below is a brief discussion of some design decisions:
271
273
- **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.
272
274
- **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.
273
275
274
-
# Future Posibilities
276
+
## Future Posibilities
275
277
276
278
This proposal opens the door for addressing issues where an Entity'slifetimedoesnotmatchanSDK'slifetime, inadditiontoprovidingadatamodelwheremutable (descriptive) attributescanbechangedoverthelifetimeofaresourcewithoutaffectingitsidnetity.Weexpectafollow-onOTEPwhichdirectlyhandlesthisissue.
0 commit comments