-
Notifications
You must be signed in to change notification settings - Fork 56
Proposal: Introduce bundles #871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thompson-tomo
wants to merge
2
commits into
open-telemetry:main
Choose a base branch
from
thompson-tomo:proposal/#857_Bundles
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Bundles | ||
|
|
||
| This document is a design proposal to add the ability to define bundles of attributes in semconv. | ||
|
|
||
| ## Use cases | ||
|
|
||
| There are a few different use cases which bundles will help us to achieve. | ||
|
|
||
| ### Defining signals | ||
|
|
||
| By introducing bundles we are able to bundle a collection of attributes together into a single reusable item. | ||
| These items have the primary goal of reducing the need to copy paste definitions while also reducing the maintaince effort. | ||
|
|
||
| An example of where this would be useful is if a `server` bundle was defined similiar to below: | ||
|
|
||
| ``` | ||
| bundle: | ||
| - name: server | ||
| brief: Defines a server | ||
| note: | ||
| attributes | ||
| - ref: sever.address | ||
| - ref: sever.port | ||
| ``` | ||
|
|
||
| Once it is defined, it can then be used on other signals to extend the definition. | ||
|
|
||
| ``` | ||
| span: | ||
| - name: messaging.produced | ||
| brief: Defines a span for sending a message via a message brooker such as rabbitmq | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| note: | ||
| attributes | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - ref: message.system.name | ||
| bundles: | ||
| - ref: server | ||
| ``` | ||
|
|
||
| In terms of the resolved schema, these bundles are blended seamlessly in to the definition. | ||
|
|
||
| ``` | ||
| span: | ||
| - name: messaging.produced | ||
| brief: Defines a span for sending a message via a message brooker such as rabbitmq | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| note: | ||
| attributes | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - id: message.system.name | ||
| .... | ||
| - id: sever.address | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .... | ||
| - id: sever.port | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .... | ||
| ``` | ||
|
|
||
| By adopting this approach we are improving the mantainability of the definitions, | ||
| by reusing the definition rather than copy and pasting strucutures. | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Extending signals | ||
|
|
||
| This use case is similiar to the previous except it is focussed on offering optional contextual extensions. | ||
| An example of this extension would be Cloud Events which are only applicable if the application is using Cloud Events, | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| hence the usage is contextual based upon cloud events being used. | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To indicate that a bundle is contextual, this can be done by defining this on the bundle, just like below for `cloud_events`: | ||
|
|
||
| ``` | ||
| bundle: | ||
| - name: cloud_events | ||
| brief: For more information on the concepts, terminology and background of CloudEvents consult the CloudEvents Primer document. | ||
| context: Can be used when a cloud event payload is being handled (sent/recieved). | ||
| note: | ||
| attributes | ||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - ref: cloudevents.event_id | ||
| - ref: cloudevents.event_source | ||
| ...... | ||
| ``` | ||
| Once it is defined, it can then be used on other signals ie the span defined in the previous chapter. | ||
|
|
||
| ``` | ||
| span: | ||
| - name: messaging.produced | ||
| brief: Defines a span for sending a message via a message brooker such as rabbitmq | ||
| note: | ||
| attributes | ||
| - ref: message.system.name | ||
| bundles: | ||
| - ref: server | ||
| - ref: cloud_events | ||
| ``` | ||
|
|
||
| In terms of the resolved schema, these bundles are blended seamlessly in to the definition. | ||
|
|
||
| ``` | ||
| span: | ||
| - name: messaging.produced | ||
| brief: Defines a span for sending a message via a message brooker such as rabbitmq | ||
| note: | ||
| attributes | ||
| - id: message.system.name | ||
| .... | ||
| - id: sever.address | ||
| .... | ||
| - id: sever.port | ||
| .... | ||
| - id: cloudevents.event_id | ||
| bundle: cloud_events | ||
| context: Can be used when a cloud event | ||
| .... | ||
| - id: cloudevents.event_source | ||
| bundle: cloud_events | ||
| context: Can be used when a cloud event | ||
| .... | ||
| ``` | ||
|
|
||
| By adopting this approach the definition of cloud events can easily be added/extended without needing to touch the usage. | ||
|
|
||
| ## Comparison to v1 solution | ||
| Attribute bundles are similiar to attribute groups however, | ||
| there are some important differences that needs to be called out: | ||
|
|
||
| * **Extends:** Bundles can not extend other bundles which is the case to reduce complexity | ||
| and enable streamlining of the resolving process. | ||
| * **Referencing:** A signal ie span can now reference multiple bundles, | ||
| which removes the need for creating nested bundles. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.