@opentelemetry/instrumentation-net
v0.65.0
Published
OpenTelemetry instrumentation for `node:net` network API module
Downloads
31,262,751
Readme
OpenTelemetry Net module Instrumentation for Node.js
This module provides automatic instrumentation for the net module.
If total installation size is not constrained, it is recommended to use the @opentelemetry/auto-instrumentations-node bundle with @opentelemetry/sdk-node for the most seamless instrumentation experience.
Compatible with OpenTelemetry JS API and SDK 1.0+.
Supports both TCP and IPC connections.
Installation
npm install --save @opentelemetry/instrumentation-netSupported Versions
- Node.js
>=14
Usage
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { NetInstrumentation } = require('@opentelemetry/instrumentation-net');
const sdk = new NodeSDK({
instrumentations: [
new NetInstrumentation(),
],
});
sdk.start();
process.once('beforeExit', async () => { await sdk.shutdown(); });Semantic Conventions
This instrumentation uses stable semantic conventions for networking attributes.
The instrumentation-net versions 0.64.0 and later emit the stable v1.23.0+ semantic conventions.
| Attribute | Description |
| ----------------------- | -------------------------------------------------------------------------------- |
| network.transport | One of tcp or pipe |
| server.address | Host name or the IPC file path |
| server.port | Remote port number |
| network.peer.address | Peer address of the network connection - IP address or Unix domain socket name. |
| network.local.address | Local address of the network connection - IP address or Unix domain socket name. |
| network.local.port | Local port number of the network connection. |
Useful links
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry JavaScript: https://github.com/open-telemetry/opentelemetry-js
- For help or feedback on this project, join us in GitHub Discussions
License
Apache 2.0 - See LICENSE for more information.
