What is @azure/core-tracing?
The @azure/core-tracing package provides a common interface for adding tracing to Azure SDKs. It allows developers to collect detailed information about operations performed by Azure SDKs, making it easier to diagnose issues and optimize performance. The package is built on OpenTelemetry, a set of APIs, libraries, agents, and instrumentation that provide observability for applications.
What are @azure/core-tracing's main functionalities?
Creating and managing spans
This feature allows developers to create and manage spans, which represent individual operations. Spans can be nested to represent complex operations composed of multiple steps. The code sample demonstrates how to create a tracing client, start a new span, and then end the span.
const { createTracingClient } = require('@azure/core-tracing');
const tracingClient = createTracingClient({
namespace: 'Microsoft.Azure',
packageName: 'AzureExample',
packageVersion: '1.0.0'
});
// Start a new span
cost span = tracingClient.startSpan('myOperation');
// End the span
span.end();
Integrating with Azure SDKs
This feature demonstrates how to integrate the @azure/core-tracing package with other Azure SDKs, such as Azure Storage Blobs. By passing a tracing client to the SDK's client constructor, developers can automatically collect tracing information for operations performed by the SDK.
const { DefaultAzureCredential } = require('@azure/identity');
const { BlobServiceClient } = require('@azure/storage-blob');
const { createTracingClient } = require('@azure/core-tracing');
const tracingClient = createTracingClient({
namespace: 'Microsoft.Azure',
packageName: 'Azure.Storage.Blobs',
packageVersion: '12.0.0'
});
const blobServiceClient = new BlobServiceClient(
'https://<my-storage-account>.blob.core.windows.net/',
new DefaultAzureCredential(),
{
tracingOptions: { tracingClient }
}
);
Other packages similar to @azure/core-tracing
jaeger-client
Jaeger client is a distributed tracing system that can be used to monitor and troubleshoot transactions in complex distributed systems. While it provides similar functionality to @azure/core-tracing in terms of tracing operations, Jaeger is a standalone system with its own backend and UI for visualizing traces, making it more suited for end-to-end tracing across multiple services and platforms.
Azure Core tracing library for JS
This is the core tracing library that provides low-level interfaces and helper methods for tracing in Azure SDK JavaScript libraries which work in the browser and Node.js.
Getting started
Coming soon....
Contributing
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.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., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
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.
This project has adopted the Microsoft Open Source Code of Conduct.
For more information see the Code of Conduct FAQ or
contact opencode@microsoft.com with any additional questions or comments.