-
Notifications
You must be signed in to change notification settings - Fork 888
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
Add semantic conventions for log media attributes #2022
Conversation
6bc026a
to
65083e3
Compare
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.
Should we define here which type of log data model attributes these should be applied to? If so, I see file related attributes as Resource attributes, and the stream attribute as log record attributes, but open for discussion.
I disagree on this point because the log file is not really the source of the log, which would be necessary to categorize file attributes as resource attributes. The file is really just a communication mechanism between the source of the log and the consumer of the log.
Probably we should try to describe any new resource types as separate documents in this directory, so that there are no a log-specific resource types. |
This makes sense, but the attribute namespace name |
@dmitryax This is a very good point. I think the namespace you've proposed is a good description. My only hesitation is that it seems a bit more likely that this namespace risks a collision with actual log attributes. (i.e. a developer or a logging framework chooses to emit logs with a "log" key in the attributes) That said, it seems still unlikely enough that it probably should not guide this decision. |
So, for reference the spec has a recommendation about this which says
Now, I think it is OK to use "log" as a namespace. I don't think we will want to have an attribute names "log". Presumably that would be for the body of the log record but there is a native field for that in our data model, so we will not want to make a semantic convention for an attribute "log" ourselves. This leaves the possibility of someone accidentally using "log" as an attribute name. If they do it there is no catastrophic results, but it will be against Otel recommendations. How likely it is for someone to accidentally do this? We can consider 2 typical use-cases:
Of course there is a possibility someone can manually add an attribute using Otel Logging SDK or using Collector, but the again it can happen with any other attribute name, I don't think "log" is any different. Perhaps there is some other scenario that I am missing. With all this said I am not sure what's the proposal. :-) Do we want to go with |
Thanks for your analysis Tigran.
This is basically the scenario I was pondering, but you've pointed out that this is easily handled.
This is where we've arrived. I'll update the PR. |
Please rebase. |
cb94a2c
to
9cc37d0
Compare
This should be ready to merge, unless there is any more feedback. |
@djaglowski I think this needs one more rebase. I enabled auto-merged, should be merged once you rebase. |
Logs are transmitted via several common media, such as files and iostreams. This PR establishes semantic conventions for describing the file or iostream from which a log was read. Notably, these attributes are not resource attributes, as the medium used to tranmit a log is not considered to be the originator of the log.
Head branch was pushed to by a user without write access
9cc37d0
to
b549570
Compare
Logs are transmitted via several common media, such as files and iostreams. This PR establishes semantic conventions for describing the file or iostream from which a log was read. Notably, these attributes are not resource attributes, as the medium used to tranmit a log is not considered to be the originator of the log.
Resolves #1772
Changes
Adds semantic conventions for file log source.