Socket
Book a DemoInstallSign in
Socket

@opentelemetry/plugin-dns

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/plugin-dns

OpenTelemetry dns automatic instrumentation package.

latest
Source
npmnpm
Version
0.15.0
Version published
Maintainers
4
Created
Source

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:

OptionsTypeDescription
ignoreHostnamesIgnoreMatcher[]Dns plugin will not trace all requests that match hostnames

License

Apache 2.0 - See LICENSE for more information.

Keywords

opentelemetry

FAQs

Package last updated on 05 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts