OpenTelemetry Net module Instrumentation for Node.js
This module provides instrumentation of outgoing connections for net
.
Supports both TCP and IPC connections.
Installation
npm install --save @opentelemetry/instrumentation-net
Usage
const { NodeTracerProvider } = require('@opentelemetry/node');
const { NetInstrumentation } = require('@opentelemetry/instrumentation-net');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const provider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: [
new NetInstrumentation(),
],
});
Attributes added to connect
spans
net.transport
: IP.TCP
, pipe
or Unix
net.peer.name
: host name or the IPC file path
For TCP:
net.peer.ip
net.peer.port
net.host.ip
net.host.port
Useful links
License
Apache 2.0 - See LICENSE for more information.