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

Initial Entity and Resource proposal. #264

Merged
merged 52 commits into from
Sep 26, 2024

Conversation

jsuereth
Copy link
Contributor

@jsuereth jsuereth commented Aug 13, 2024

This is a proposal to address Resource and Entity data model interactions, including a path forward to address immediate friction and issues in the current resource specification.

The proposal includes all links and context needed to justify it, but duplicating a snapshot here:

Motivation

This proposal attempts to focus on the following problems within OpenTelemetry to unblock multiple working groups:

  • Allowing mutating attributes to participate in Resource (OTEP 208).
  • Allow Resource to handle entities whose lifetimes don't match the SDK's lifetime (OTEP 208).
  • Provide support for async resource lookup (spec#952).
  • Fix current Resource merge rules in the specification, which most implementations violate (oteps#208, spec#3382, spec#3710).
  • Allow semantic convention resource modeling to progress (spec#605, spec#559, etc).

@jsuereth jsuereth marked this pull request as ready for review August 13, 2024 22:20
@jsuereth jsuereth requested a review from a team August 13, 2024 22:20
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the draft @jsuereth !

This is an important next step for entities. I left some comments, but they don't prevent us from making progress.

text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
@austinlparker
Copy link
Member

A question for @jsuereth (and perhaps this has been addressed in WG meetings, if so, feel free to point me to those discussions) but my read of this proposal is that there is some future state where resource attributes are all contained inside entities, rather than flat, thus changing the 'logical' top-level resource attributes into complex attributes rather than flat ones. This is not a pattern that existing tools really use; Is the intention that these attributes should be flattened on ingest in order to allow traditional group-by/analysis functions and the entity definition ingested as some sort of hash (or other platform-appropriate representation)?

@bboreham
Copy link

Drive-by comment: I expected the top-level description to reference https://github.com/open-telemetry/oteps/blob/main/text/entities/0256-entities-data-model.md

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any prototype implementation of this? It sounds reasonable to me but is pretty abstract.

text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Show resolved Hide resolved
@jsuereth
Copy link
Contributor Author

A question for @jsuereth (and perhaps this has been addressed in WG meetings, if so, feel free to point me to those discussions) but my read of this proposal is that there is some future state where resource attributes are all contained inside entities, rather than flat, thus changing the 'logical' top-level resource attributes into complex attributes rather than flat ones. This is not a pattern that existing tools really use; Is the intention that these attributes should be flattened on ingest in order to allow traditional group-by/analysis functions and the entity definition ingested as some sort of hash (or other platform-appropriate representation)?

The goal of this is that tooling can continue to engage with the flattened resource attribtue model we provide today. optionally tooling can engage with the new bundled entity definitions (and OTEL itself, e.g. the collector, would do so).

This gives flexibility for users to engage or not engage with entities, depending on their need, and opens up further exploration of entities.

@tigrannajaryan
Copy link
Member

Is there any prototype implementation of this? It sounds reasonable to me but is pretty abstract.

@jack-berg There are early prototypes in Go and in Collector (core and contrib). The prototypes somewhat deviate from this proposal (e.g. the prototype only allows one associated EntityRef in the Resource, it uses key/value pairs, not key arrays, etc). Despite some deviation I think the prototypes demonstrate the idea (and we can update the prototypes to align with this proposal).

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks (see suggested change)!

text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
text/entities/0264-resource-and-entities.md Outdated Show resolved Hide resolved
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see this idea moving forward. With clear distinction of identifying attributes I believe we can design a better UX for Prometheus as a OTel metrics backend :)

@jsuereth
Copy link
Contributor Author

Thanks @carlosalberto !

Will Resource stay immutable (with the addition of the new entities field), and will be internally updated by the SDK with the latest instance tracked? If not, will attributes stay as read-only at least, in a best-effort attempt?

I think a follow on OTEP will define the needs and design for "mutable" resource. This OTEP calls out that users want descriptive/mutable attributes on Resource. I expect the ResourceProvider concept to be expanded on to provide that (cc @tedsuo who I think is working on that proposal, or updating the existing one).

For now - this proposal has resource remain read-only and defines a merge algorithm for a ResourceProvider, but with identifying "descriptive" (or changing) attributes as a first step. This does not solve the needs of browser until the follow on OTEP is complete and approved.

The merge algorithm mentions schema_url as a comparison point between entities of the same type, and then one of the examples mentions having the same schema_url with different schema version. Is this something to be tuned/clarified later on, regarding on how to merge values in such case?

We clarify schema url versions in the specificaiton already - https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/schemas#schema-url

So we already have a way to understand version and whether or not they match. We do not have any notion of "compatibility" encoded in version but we can check for equality and order them (to know which is latest).

Copy link

@annabokhan annabokhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking, follow ups noted

@jsuereth
Copy link
Contributor Author

Thanks @annabokhan !

Copy link
Member

@svrnm svrnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just added a comment for things we might want to address in the future as well

@tigrannajaryan
Copy link
Member

We have a broad consensus, all comments are resolved. Merging. Thanks @jsuereth

@tigrannajaryan tigrannajaryan merged commit 58d6420 into open-telemetry:main Sep 26, 2024
4 checks passed
@jsuereth jsuereth deleted the wip/entities-and-resource branch September 26, 2024 16:44
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry/opentelemetry-specification#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry#208),
[spec#3382](open-telemetry/opentelemetry-specification#3382),
[spec#3710](open-telemetry/opentelemetry-specification#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry/opentelemetry-specification#605),
[spec#559](open-telemetry/opentelemetry-specification#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry/opentelemetry-specification#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry#208),
[spec#3382](open-telemetry/opentelemetry-specification#3382),
[spec#3710](open-telemetry/opentelemetry-specification#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry/opentelemetry-specification#605),
[spec#559](open-telemetry/opentelemetry-specification#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 30, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry/opentelemetry-specification#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry#208),
[spec#3382](open-telemetry/opentelemetry-specification#3382),
[spec#3710](open-telemetry/opentelemetry-specification#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry/opentelemetry-specification#605),
[spec#559](open-telemetry/opentelemetry-specification#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry/oteps#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry/oteps#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry/oteps#208),
[spec#3382](open-telemetry#3382),
[spec#3710](open-telemetry#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry#605),
[spec#559](open-telemetry#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 31, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry/opentelemetry-specification#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry#208),
[spec#3382](open-telemetry/opentelemetry-specification#3382),
[spec#3710](open-telemetry/opentelemetry-specification#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry/opentelemetry-specification#605),
[spec#559](open-telemetry/opentelemetry-specification#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Nov 1, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry#208)).
- Provide support for async resource lookup
([spec#952](open-telemetry/opentelemetry-specification#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry#208),
[spec#3382](open-telemetry/opentelemetry-specification#3382),
[spec#3710](open-telemetry/opentelemetry-specification#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](open-telemetry/opentelemetry-specification#605),
[spec#559](open-telemetry/opentelemetry-specification#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
carlosalberto pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 8, 2024
This is a proposal to address Resource and Entity data model
interactions, including a path forward to address immediate friction and
issues in the current resource specification.


The proposal includes all links and context needed to justify it, but
duplicating a snapshot here:

## Motivation

This proposal attempts to focus on the following problems within
OpenTelemetry to unblock multiple working groups:

- Allowing mutating attributes to participate in Resource ([OTEP
208](open-telemetry/oteps#208)).
- Allow Resource to handle entities whose lifetimes don't match the
SDK's lifetime ([OTEP
208](open-telemetry/oteps#208)).
- Provide support for async resource lookup
([spec#952](#952)).
- Fix current Resource merge rules in the specification, which most
implementations violate
([oteps#208](open-telemetry/oteps#208),
[spec#3382](#3382),
[spec#3710](#3710)).
- Allow semantic convention resource modeling to progress
([spec#605](#605),
[spec#559](#559),
etc).

---------

Co-authored-by: Tigran Najaryan <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.