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

Describe how to convert non-string primitives for protocols which only support strings #2343

Merged
merged 6 commits into from
Mar 3, 2022

Conversation

dashpole
Copy link
Contributor

Changes

Small change forked from #2266 (comment). Similarly to specifying how to represent arrays, we should specify how to represent primitives as strings if those are not supported. We should use the same string representation for primitive types as we do for primitives within arrays.

I'm not sure if this is actually allowed, since the spec is stable. But since this is a SHOULD, rather than a MUST, it wouldn't require breaking changes. If it isn't permitted, I can just document this in the Prometheus conversion spec itself.

@bogdandrutu I think this would require slight changes to https://github.com/open-telemetry/opentelemetry-collector/blob/30e6bf6eeee544e869411bf50c57447323d259d9/model/pdata/common.go#L370.

cc @jmacd @jsuereth

specification/common/common.md Outdated Show resolved Hide resolved
@tigrannajaryan
Copy link
Member

FYI, I have a related open OTEP which tells how to convert from values to OTLP value (the opposite direction of what this PR defines): open-telemetry/oteps#178

@bogdandrutu
Copy link
Member

@dashpole I am confused about the changes you mentioned in the description.

@dashpole
Copy link
Contributor Author

dashpole commented Mar 1, 2022

@bogdandrutu
See open-telemetry/opentelemetry-collector#4934. Bools and ints still have the same conversion. For floats (double), it would change how they are converted to strings in some cases.

@bogdandrutu bogdandrutu merged commit 0986b9d into open-telemetry:main Mar 3, 2022
@dashpole dashpole deleted the attribute_update branch March 3, 2022 13:44
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…y support strings (open-telemetry#2343)

* Describe how to handle converting non-string primitives for protocols that only support strings

* update wording to make clear that only non-string values are converted to strings

* unify language

* Update specification/common/common.md

Co-authored-by: Joshua MacDonald <[email protected]>

Co-authored-by: Joshua MacDonald <[email protected]>
Co-authored-by: Bogdan Drutu <[email protected]>
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.

6 participants