Skip to content
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

Avoid the logs instrumentation for specific instance when there are multiple logger instance #2585

Open
2 tasks
ruddenchaux opened this issue Dec 5, 2024 · 0 comments

Comments

@ruddenchaux
Copy link

Hi, I have a Node.js application with multiple logger instances (application and audit) and want to instrument and send only the application instance logs to the collector. I am using the pino logger so the auto instrumentation loads the opentelemetry-instrumentation-pino plugin but the configurations are the same for the opentelemetry-instrumentation-winston and opentelemetry-instrumentation-bunyan plugins. Seeing this, I can't find a way to conditionally instrument a specific logger instance.

Let me give an example.

application log

{ "context": "application", "level": 30, "msg": "Info log"}

audit log

{ "context": "audit", "level": 30, "msg": "Info log"}

I only want the instrumentation when context matches audit.

Is it an expected case?

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant