You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Content recording with `--enable-recording` flag
175
+
- Custom console span exporter
176
176
- Azure Monitor integration example
177
177
178
-
8.**MCPSample.java** - Model Context Protocol (MCP) tool integration
178
+
8.**telemetry/GlobalTracingSample.java** - Automatic tracing via GlobalOpenTelemetry
179
+
- Zero builder configuration — uses `buildAndRegisterGlobal()`
180
+
- Same span output as explicit tracing
181
+
182
+
9.**MCPSample.java** - Model Context Protocol (MCP) tool integration
179
183
- Configure MCP servers for external tool access
180
184
- Handle MCP call events and tool execution
181
185
- Handle MCP approval requests for tool calls
182
186
- Process MCP call results and continue conversations
183
187
184
-
9.**AgentV2Sample.java** - Azure AI Foundry agent session
188
+
10.**AgentV2Sample.java** - Azure AI Foundry agent session
185
189
- Connect directly to an Azure AI Foundry agent via AgentSessionConfig
186
190
- Real-time audio capture and playback
187
191
- Sequence number based audio for interrupt handling
@@ -485,7 +489,10 @@ The SDK has built-in [OpenTelemetry](https://opentelemetry.io/) tracing that emi
485
489
486
490
#### Automatic tracing (recommended)
487
491
488
-
If the [OpenTelemetry Java agent](https://opentelemetry.io/docs/languages/java/automatic/) is attached, or `GlobalOpenTelemetry` is configured, tracing works automatically with no code changes:
492
+
When no `.openTelemetry()` is called on the builder, the SDK defaults to `GlobalOpenTelemetry.getOrNoop()` —
493
+
tracing is automatically active when a global OpenTelemetry instance exists (e.g., via the
494
+
[OpenTelemetry Java agent](https://opentelemetry.io/docs/languages/java/automatic/) or
495
+
`OpenTelemetrySdk.builder().buildAndRegisterGlobal()`), and is a zero-cost no-op otherwise:
489
496
490
497
```java com.azure.ai.voicelive.tracing.automatic
491
498
// No special configuration needed — tracing is picked up from GlobalOpenTelemetry
@@ -497,7 +504,8 @@ VoiceLiveAsyncClient client = new VoiceLiveClientBuilder()
497
504
498
505
#### Explicit OpenTelemetry instance
499
506
500
-
Provide your own `OpenTelemetry` instance to control trace export:
507
+
Pass your own `OpenTelemetry` instance directly to the builder for full control. This is useful
508
+
when you want different clients to use different tracer configurations:
501
509
502
510
```java com.azure.ai.voicelive.tracing.explicit
503
511
VoiceLiveAsyncClient client = new VoiceLiveClientBuilder()
@@ -514,29 +522,30 @@ When tracing is active, the following span hierarchy is emitted for each voice s
Copy file name to clipboardExpand all lines: sdk/voicelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/telemetry/ExplicitTracingSample.java
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
0 commit comments