-
Notifications
You must be signed in to change notification settings - Fork 895
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
Conversation
Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
@open-telemetry/technical-committee (@bogdandrutu): As discussed in yesterday's SIG Spec call, can we please merge this? |
* 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>
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.