Skip to content
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

Clarify that resources are immutable #515

Merged
merged 6 commits into from
Mar 27, 2020

Conversation

Oberon00
Copy link
Member

@Oberon00 Oberon00 commented Mar 12, 2020

The spec did never explicitly say that resources are immutable. It IMHO did so implicitly, as there are create+merge operations but no set operation. This PR makes immutability explicit.

All implementations that I know of already have immutable resources, so this should hopefully really just be a clarification.

specification/sdk-resource.md Show resolved Hide resolved
specification/sdk-resource.md Outdated Show resolved Hide resolved
Oberon00 and others added 2 commits March 12, 2020 13:38
Copy link
Member

@arminru arminru left a comment

Choose a reason for hiding this comment

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

Please also update the description of the merge operation in line 46 to a MUST:

The original resources should be unmodified.

[MeterProvider](sdk-metrics.md#meter-sdk). When associated with a `MeterProvider`,
all `Metrics` produced by any `Meter` from the provider will automatically be
[TracerProvider](sdk-tracing.md#tracer-sdk) when it is created.
That association cannot be changed later.
Copy link
Member Author

@Oberon00 Oberon00 Mar 17, 2020

Choose a reason for hiding this comment

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

Is this sentence OK? There was a discussion in SIG meeting about Kubernetes Pod labels that can change. This would mean that we cannot put them on resources.

Copy link
Contributor

Choose a reason for hiding this comment

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

The conversation about resource labels that can change suggests to me that we should support per-Tracer resources as prototyped in open-telemetry/oteps#78. When the pod label changes, you would construct a new scope with the new resources and begin using that tracer. Modifying "static" resources on the fly sounds problematic, to me.

Copy link
Member

Choose a reason for hiding this comment

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

Not necessary, I can see that pod_labels be logs/events associated with the same immutable Resource. Not saying that scope is not useful but probably not for the pod labels example.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, having global events sounds like a useful idea. You should make an issue for that.

Copy link
Member

Choose a reason for hiding this comment

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

Also these events are more or less some type of "time-series" being associated with the time when they change. Not trying to design the solution here, but just some "food for thought" :)

[MeterProvider](sdk-metrics.md#meter-sdk). When associated with a `MeterProvider`,
all `Metrics` produced by any `Meter` from the provider will automatically be
[TracerProvider](sdk-tracing.md#tracer-sdk) when it is created.
That association cannot be changed later.
Copy link
Contributor

Choose a reason for hiding this comment

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

The conversation about resource labels that can change suggests to me that we should support per-Tracer resources as prototyped in open-telemetry/oteps#78. When the pod label changes, you would construct a new scope with the new resources and begin using that tracer. Modifying "static" resources on the fly sounds problematic, to me.

@Oberon00
Copy link
Member Author

@open-telemetry/technical-committee (@bogdandrutu): As discussed in yesterday's SIG Spec call, can we please merge this?

@bogdandrutu bogdandrutu merged commit 16e0801 into open-telemetry:master Mar 27, 2020
@Oberon00 Oberon00 deleted the patch-5 branch December 18, 2020 10:57
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Clarify that resources are immutable

* Typo.

* Update specification/sdk-resource.md

Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>

* Mention immutability right in the beginning.

* Reformulate Merge to make immutability more clear

Co-authored-by: Armin Ruech <armin.ruech@gmail.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants