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

Is it possible to disable pg-pool instrumentation? #686

Closed
kirpichenko opened this issue Oct 2, 2021 · 4 comments
Closed

Is it possible to disable pg-pool instrumentation? #686

kirpichenko opened this issue Oct 2, 2021 · 4 comments

Comments

@kirpichenko
Copy link

Hi! We just started using opentelemetry in our Node.js applications and opentelemetry-instrumentation-pg is one of the instrumentation packages. In addition to DB queries we get pg-pool.connect spans which are not really useful for us now. I'm wondered if it's possible to disable pg-pool instrumentation?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2021

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Dec 6, 2021
@dyladan
Copy link
Member

dyladan commented Dec 8, 2021

It depends how you are enabling your instrumentations. If you're using the instrumentations-node-all package with registerInstrumentations, you should be able to do something like this:

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const exporter = new CollectorTraceExporter();
const provider = new NodeTracerProvider({
  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: 'basic-service',
  }),
});
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();

registerInstrumentations({
  instrumentations: [
    getNodeAutoInstrumentations({
      // load custom configuration for pg-pool instrumentation
      '@opentelemetry/instrumentation-pg-pool': {
        enabled: false
      },
    }),
  ],
});

@dyladan dyladan removed the stale label Dec 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Feb 7, 2022
@github-actions
Copy link
Contributor

This issue was closed because it has been stale for 14 days with no activity.

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

2 participants