From 9845466fddc8fbe64e8db34652de596c851cb540 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 30 Oct 2024 10:35:22 -0700 Subject: [PATCH 1/2] Minor fixes in vanilla OTel tracing sample --- .../samples/sample_chat_completions_with_tracing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py index e2d40ca2f575..8e70f29289cb 100644 --- a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py +++ b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py @@ -7,7 +7,7 @@ This sample demonstrates how to use tracing with the Inference client library. Azure AI Inference is instrumented with OpenTelemetry. In order to enable tracing you need to configure OpenTelemetry to export traces to your observability backend. - This sample shows how to capture the traces to a file. + This sample shows how to print traces to stdout. This sample assumes the AI model is hosted on a Serverless API or Managed Compute endpoint. For GitHub Models or Azure OpenAI endpoints, @@ -23,6 +23,7 @@ where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. 2) AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. + 3) AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Set to 'true' to enable content recording. """ From b0b70f0d26a7ab8ce5d6fd0658a9f264f6c7a38a Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 30 Oct 2024 10:56:03 -0700 Subject: [PATCH 2/2] Feedback --- .../sample_chat_completions_with_azure_monitor_tracing.py | 3 ++- .../samples/sample_chat_completions_with_tracing.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_azure_monitor_tracing.py b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_azure_monitor_tracing.py index cde4505f3e83..a9df113c6e50 100644 --- a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_azure_monitor_tracing.py +++ b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_azure_monitor_tracing.py @@ -22,7 +22,8 @@ `your-azure-region` is the Azure region where your model is deployed. 2) AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. 3) APPLICATIONINSIGHTS_CONNECTION_STRING - Your Azure Monitor (Application Insights) connection string. - 4) AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Set to 'true' to enable content recording. + 4) AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to 'true' + for detailed traces, including chat request and response messages. """ diff --git a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py index 8e70f29289cb..978580f0c41e 100644 --- a/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py +++ b/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py @@ -23,7 +23,8 @@ where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. 2) AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. - 3) AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Set to 'true' to enable content recording. + 3) AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to 'true' + for detailed traces, including chat request and response messages. """