This repository has been moved to the Azure SDK for JavaScript repository. In order to improve discoverability and share common dependencies/tests, the OpenTelemetry Azure Monitor for JS exporter has moved to a common location containing all Azure SDKs.
This exporter package assumes your application is already instrumented with the OpenTelemetry SDK. Once you are ready to export OpenTelemetry data, you can add this exporter to your application:
npm install @azure/monitor-opentelemetry-exporter
Add the exporter to your existing OpenTelemetry tracer provider (NodeTracerProvider
/ BasicTracerProvider
)
const { AzureMonitorTraceExporter } = require('@azure/monitor-opentelemetry-exporter');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { BatchSpanProcessor } = require('@opentelemetry/tracing');
// Use your existing provider
const provider = new NodeTracerProvider({
plugins: {
https: {
// Ignore Application Insights Ingestion Server
ignoreOutgoingUrls: [new RegExp(/dc.services.visualstudio.com/i)],
},
},
});
provider.register();
// Create an exporter instance
const exporter = new AzureMonitorTraceExporter({
logger: provider.logger,
instrumentationKey: 'ikey',
});
// Add the exporter to the provider
provider.addSpanProcessor(new BatchSpanProcessor(exporter, {
bufferTimeout: 15000,
bufferSize: 1000,
}));
Coming Soon
Coming Soon
Please take a look at the examples to see how to add the Azure Monitor Exporter to your existing OpenTelemetry instrumented project.
npm install
npm run build
npm run lint
npm run test
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.