-
Notifications
You must be signed in to change notification settings - Fork 539
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
[instrumentation-bunyan] Allow log level to be configured for auto instrumentation and BunyanStream #1918
Comments
I'm not sure that filtering on log-level/severity is the job of an OTel log-sending appender/stream/transport class.
The level of logs that are emitted is determined by the Logger class (also in Bunyan's case by the stream info associated with a Bunyan output stream). So, for example, a Logger configured at the I might be misunderstanding your intention, however. Looking at this part of your PR: logger.addStream({
type: 'raw',
stream: new OpenTelemetryBunyanStream({
logSendingLevel: config.logSendingLevel,
}),
level: logger.level(),
}); Here there are two levels involved with that stream, which I think will be confusing. If Did you perhaps intend some way to configure the auto-instrumentation to set that existing logger.addStream({
type: 'raw',
stream: new OpenTelemetryBunyanStream({
logSendingLevel: config.logSendingLevel,
}),
level: config.logSendingLevel ? bunyanLevelFromSeverityNumber(config.logSendingLevel) : logger.level(),
}); |
@trentm according to docs streams can have specific levels not specific to the actual logger right? https://www.npmjs.com/package/bunyan#stream-type-stream |
Bunyan's use of "stream" gets pretty ambiguous sometimes. (I regret using the bare word "stream" for this facility because of the confusion.) Given: const bunyan = require('bunyan');
const log = bunyan.createLogger({name: 'foo'});
log.addStream({
name: 'my-stream-name',
level: 'debug',
stream: process.stderr
}); Bunyan docs and code loosely refer to that In Bunyan, it is this "stream info" object that can have a level. When you do that
I think that would be handled by something like:
(I'd meant to write it this way in my preceding comment, but I accidentally left in the So, in other words, the instrumentation would still take a level/severity-related config option, but that would be passed to If that seems reasonable, then... severity vs level
|
Currently there is no way to control which level/severity for logs auto generation, all logs will be emitted
The text was updated successfully, but these errors were encountered: