@azure/opentelemetry-instrumentation-azure-sdk 1.0.0-alpha.20250416.1 → 1.0.0-alpha.20250421.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@ import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
|
45
45
|
import { createAzureSdkInstrumentation } from "@azure/opentelemetry-instrumentation-azure-sdk";
|
|
46
46
|
import { KeyClient } from "@azure/keyvault-keys";
|
|
47
47
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
48
|
+
import { trace, context } from "@opentelemetry/api";
|
|
48
49
|
|
|
49
50
|
// Set-up and configure a Node Tracer Provider using OpenTelemetry SDK.
|
|
50
51
|
const provider = new NodeTracerProvider();
|
|
@@ -67,9 +68,9 @@ await keyClient.getKey("MyKeyName");
|
|
|
67
68
|
// If your scenario requires manual span propagation, all Azure client libraries
|
|
68
69
|
// support explicitly passing a parent context via an `options` parameter.
|
|
69
70
|
// Get a tracer from a registered provider, create a span, and get the current context.
|
|
70
|
-
const tracer =
|
|
71
|
+
const tracer = trace.getTracer("my-tracer");
|
|
71
72
|
const span = tracer.startSpan("main");
|
|
72
|
-
const ctx =
|
|
73
|
+
const ctx = trace.setSpan(context.active(), span);
|
|
73
74
|
|
|
74
75
|
await keyClient.getKey("MyKeyName", {
|
|
75
76
|
tracingOptions: {
|
package/package.json
CHANGED