JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2470
  • Score
    100M100P100Q18561F
  • License Apache-2.0

OpenTelemetry dns automatic instrumentation package.

Package Exports

  • @opentelemetry/plugin-dns

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@opentelemetry/plugin-dns) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OpenTelemetry DNS Instrumentation for Node.js

NPM Published Version dependencies devDependencies Apache License

This module provides automatic instrumentation for dns.

For automatic instrumentation see the @opentelemetry/node package.

Installation

npm install --save @opentelemetry/plugin-dns

Usage

const { NodeTracerProvider } = require('@opentelemetry/node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const provider = new NodeTracerProvider();
provider.register();

registerInstrumentations({
  instrumentations: [
    {
      plugins: {
        dns: {
          enabled: true,
          // You may use a package name or absolute path to the file.
          path: '@opentelemetry/plugin-dns',
          // dns plugin options
        }
      }
    },
  ],
  tracerProvider: provider,
});

Zipkin

If you use Zipkin, you must use ignoreHostnames in order to not trace those calls. If the server is local. You can set :

const provider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
  instrumentations: [
    {
      plugins: {
        dns: {
          enabled: true,
          // You may use a package name or absolute path to the file.
          path: '@opentelemetry/plugin-dns',
          ignoreHostnames: ['localhost']
        }
      }
    },
  ],
  tracerProvider: provider,
});

Dns Plugin Options

Dns plugin has currently one option. You can set the following:

Options Type Description
ignoreHostnames IgnoreMatcher[] Dns plugin will not trace all requests that match hostnames

License

Apache 2.0 - See LICENSE for more information.