-
Notifications
You must be signed in to change notification settings - Fork 256
Unexpected behavior for log record attributes with symbols for keys #1781
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
Comments
Notes from SIG:
If that can be disproven, then we could have a discussion around allowing Symbols; this is already working and could be more natural for Rubyists. By allowing Symbols, we may be enabling users to make OpenTelemetry less efficient |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Comparing behavior on other signals, spans will have attributes with invalid names or values removed from the attribute collection during finish(). The span is still exported, but without the attributes that didn't conform to spec. We could opt to match that behavior in LogRecord, maybe in trim_attributes(). The ERROR message generated currently could be a WARN about how the invalid attribute was removed from the log record (or span) before sending and tell the reader—at least for keys—that they should provide a string instead. The ERROR message is currently generated with a call to |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
When a log record attribute has a Symbol for a key, the following OpenTelemetry error log message is output:
ERROR -- : OpenTelemetry error: invalid log record attribute key type Symbol on record: 'Thuja plicata with symbol attribute key'
Where
Thuja plicata
is the log body, and:cedar
is the attribute key.The expectation is that all attribute keys are Strings. This is the same as the expectation for attributes on stable Ruby OTel signals, like Spans/SpanEvents for Traces.
Despite this warning, the attribute is passed along to the exporter anyway, and it is successfully sent over OTLP.
For example (source):
OpenTelemetry Ruby logger SDK
Shell output from running the code above
Collector output from running the code above
Questions / Next Steps
The text was updated successfully, but these errors were encountered: