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.
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 Body representation in Log Bridge API #3814
Clarify Body representation in Log Bridge API #3814
Changes from all commits
70f8a2e
4c263b2
58b3901
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is a Stable document and we are not allowed breaking changes.
I think is a breaking change. It is not a choice to support
any
type. The reference to (also Stable) log data model clearly defines the type of Body and it isany
, not a string.I would like to hear arguments in favour of somehow considering this as an allowed change. Blocking until then.
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.
There is no place in the specification that enforces the Bridge API to support the
any
type.From the PR description:
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.
True, not explicitly. But implicitly, by inference the type definition in log data model of course applies (for all fields that link to it, including Body), otherwise it is impossible to understand what the Emit method is supposed to do. The reason Bridge API does not say so is because it would be just a duplication of the same information.
Notice how "First-party Application" does not directly call Bridge API. So, strictly speaking what "First-party Application" is required to do is only a subset of what Bridge API needs to support, it does not need to be an exact match. Also the README document you refer to is non-normative, its purpose is to explain, not to serve as precise specification.
So far I am not convinced the existing vague wording about "First-party Application" absolves Bridge API from supporting
any
type for Body.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.
So far when working on OTel Go Logs Bridge API prototype I have not found any popular Go logging library where I would want to put anything other than a string in Body.
This is also supported by:https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model-appendix.md which always suggests putting the log record text message as Body.
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.
Why the Data Model even references "First-party Application" and uses normative language? It suggests that the API or SDK author should do something with information. How would someone reviewing the API+SDK conforms with this statement?
We could change the statement to:
But I am not sure if others would agree with such interpretation. I would rather do it as a separate PR as I think it is more controversial:
any
defined in Logs Data Model.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.
As I understand, otel-rust accept Body as a type representing
any
as per the Log Data Model. However the signal is not yet stable and can be changed. The otel-cpp, as you mentioned, uses the attribute's value type to represent the Body, and the signal is already stable.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.
I created #3827