-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactored attribute limits to be controlled by the LoggerProvider #129
Conversation
addAttributes | ||
(loggerProviderAttributeLimits loggerProvider) | ||
emptyAttributes | ||
attributes |
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.
Is there anything about this that addresses the part of the spec that says this:
There SHOULD be a message printed in the SDK’s log to indicate to the user that an attribute was discarded due to such a limit. To prevent excessive logging, the message MUST be printed at most once per LogRecord (i.e., not per discarded attribute).
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 actually something that we don't support on the tracing side (which says effectively the same thing). I wanted to support it on the tracing side using OTel logging, so it's a bit of an ouroboros 😆
I think enough of the logging interface is in place that we should be be able to support this use case now though.
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 addressed by the next downstream pull request in the stack. The change was to large to be reasonably contained in this PR.
27fbd05
to
bdfb7c1
Compare
bdfb7c1
to
8e35e04
Compare
Big Context
Logging Support is being added to hs-opentelemetry. Logging spec
Small (This PR) Context
LoggerProvider
s should control theAttributeLimit
s forLogger
s. Previously, the entirety ofLogAttributes
was provided to theemitLogRecord
function instead of passing the attributes via aHashMap Text AnyValue
andAttributeLimit
s via aLoggerProvider
accessed through the providedLogger
. Relatedly,LogAttributes
should be able to be changed after the creation of theLogger
, but that will be added later.Testing
stack build
runs