Package Exports
- @azure/opentelemetry-instrumentation-azure-sdk
- @azure/opentelemetry-instrumentation-azure-sdk/dist-esm/src/index.js
- @azure/opentelemetry-instrumentation-azure-sdk/dist/index.js
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 (@azure/opentelemetry-instrumentation-azure-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Azure OpenTelemetry Instrumentation library for JavaScript
Getting started
Currently supported environments
- LTS versions of Node.js
- Latest versions of Safari, Chrome, Edge, and Firefox.
See our support policy for more details.
Prerequisites
- An Azure subscription.
- The @opentelemetry/instrumentation package.
You'll need to configure the OpenTelemetry SDK in order to produce Telemetry data. While configuring OpenTelemetry is outside the scope of this README, we encourage you to review the OpenTelemetry documentation in order to get started using OpenTelemetry.
Install the @azure/opentelemetry-instrumentation-azure-sdk
package
Install the Azure OpenTelemetry Instrumentation client library with npm
:
npm install @azure/opentelemetry-instrumentation-azure-sdk
Browser support
JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our bundling documentation.
Key concepts
- The createAzureSdkInstrumentation function is the main hook exported by this library which provides a way to create an Azure SDK Instrumentation object to be registered with OpenTelemetry.
Examples
Enable OpenTelemetry instrumentation
const { registerInstrumentations } = require("@opentelemetry/instrumentation");
const { createAzureSdkInstrumentation } = require("@azure/opentelemetry-instrumentation-azure-sdk");
// Configure exporters, tracer providers, etc.
// Please refer to the OpenTelemetry documentation for more information.
registerInstrumentations({
instrumentations: [createAzureSdkInstrumentation()],
});
// Continue to import any Azure SDK client libraries after registering the instrumentation.
const { keyClient } = require("@azure/keyvault-keys");
// Do something cool with the keyClient...
Troubleshooting
Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the AZURE_LOG_LEVEL
environment variable to info
. Alternatively, logging can be enabled at runtime by calling setLogLevel
in the @azure/logger
:
import { setLogLevel } from "@azure/logger";
setLogLevel("info");
For more detailed instructions on how to enable logs, you can look at the @azure/logger package docs.
Contributing
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.