$ npm install @azure/monitor-opentelemetry
npm install @azure/monitor-opentelemetry
See our support policy for more details.
Important:
AzureMonitorOpenTelemetryClientmust be setup and started before you import anything else. There may be resulting telemetry loss if other libraries are imported first.
const { AzureMonitorOpenTelemetryClient, AzureMonitorOpenTelemetryConfig } = require("@azure/monitor-opentelemetry");
const config = new AzureMonitorOpenTelemetryConfig();
config.connectionString = "<YOUR_CONNECTION_STRING>";
const client = new AzureMonitorOpenTelemetryClient(config);
For complete samples of a few champion scenarios, see the samples/ folder.
For more information on the OpenTelemetry project, please review the OpenTelemetry Specifications.
You can enable debug logging by changing the logging level of your provider.
const { DiagConsoleLogger, DiagLogLevel, diag } = require("@opentelemetry/api");
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const provider = new NodeTracerProvider();
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ALL);
provider.register();
To see if a plugin has already been made for a library you are using, please check out the OpenTelemetry Registry.
If you cannot your library in the registry, feel free to suggest a new plugin request at opentelemetry-js-contrib.
If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.

© 2010 - cnpmjs.org x YWFE | Home | YWFE