-
Notifications
You must be signed in to change notification settings - Fork 896
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
Attributes "hell" #4201
Comments
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-attributes already states that, Log Attributes are a superset of Attributes allowed in Span,Metrics, and that was intentional. Whether Event API should support the supertset or not: Its being discussed in #4199. |
@cijothomas thanks for the link. I think the word "superset" does not imply that the "standard attributes" must be allowed in the |
We can always add a function converting a standard attribute to log attribute if it would occur to be needed. EDIT: I created #4202 |
The body is type Given that the log bridge API is not intended to be user facing, API ergonomics are not a high priority. After all, how often do you need to reference standard attributes when writing a log appender? Note that in java we did add good support for standard attributes to the Event API prototype: https://github.com/open-telemetry/opentelemetry-java/blob/e063b34a2ad1865b8e8bc0e8758e6c375efbf473/api/incubator/src/main/java/io/opentelemetry/api/incubator/events/EventBuilder.java#L79-L114 The difference being:
Note that this isn't necessarily the final say on the java log API. Its possible that we add syntactic sugar to make it easier to add standard attributes to the body like we've done with the Event API. |
Java is not aligned with the spec requirement that log attributes (i.e. not the body) are |
This implicitly conflicts with this:
If it follows that a public API should support the common attributes, then we need a way to convert to log attributes given the current design of the events API. Otherwise, if we decide that the public Events API doesn't support common attributes, the argument that it's okay because it is only a bridge becomes invalidated. |
I think Java actually did the right thing keeping the log attributes as "standard attributes" because these are used to "identify a log entry". I actually want everyone for Attributes to use the "standard attributes" but for body we can have the "Any" value. |
@jack-berg depends how you read:
From your comment:
I want the |
Notes from SIG meeting #3849 (comment):
|
This is totally possible in Java. See see my previous comment:
|
What are you trying to achieve?
Share the same attributes across traces/metrics/logs. I do understand that the logs.attributes (this was a surprise that even attributes are different) and especially the body (not surprised about this) can be more generic than the traces and metrics, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-attributes and https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-body.
What did you expect to see?
Clear requirement in the bridge-api to support adding the "standard attributes" as well, since there are semantic conventions generate (example in go) that use the old style attributes.
Additional context.
Currently because of the logs data model saying that log record attributes are different than span/metrics attributes and that the bridge api reference to that https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#emit-a-logrecord
Java offers only support to add the "old style" attributes as attributes, see https://github.com/open-telemetry/opentelemetry-java/blob/main/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java
Go offers only the more generic way, and I cannot share the attributes easily, see https://github.com/open-telemetry/opentelemetry-go/blob/main/log/record.go#L112
The text was updated successfully, but these errors were encountered: