Skip to content

Commit f1ebecb

Browse files
authored
Update azure-monitor-opentelemetry min version and update enable telemetry logic (#120)
* Update azure-monitor-opentelemetry min version and remove unneceaary code * Fixed spelling AZURE_TRACING_GENAI_CONTENT_RECORDING_ENABLED
1 parent 3d06652 commit f1ebecb

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ pipeline:
5454
- AZURE_EXISTING_AIPROJECT_ENDPOINT
5555
- AZURE_EXISTING_AGENT_ID
5656
- ENABLE_AZURE_MONITOR_TRACING
57-
- AZURE_TRACING_GENAI_CONTENT_RECORDING_ENABLED
57+
- AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ output AZURE_AI_AGENT_NAME string = agentName
442442
output AZURE_EXISTING_AGENT_ID string = agentID
443443
output AZURE_EXISTING_AIPROJECT_ENDPOINT string = projectEndpoint
444444
output ENABLE_AZURE_MONITOR_TRACING bool = enableAzureMonitorTracing
445-
output AZURE_TRACING_GENAI_CONTENT_RECORDING_ENABLED bool = azureTracingGenAIContentRecordingEnabled
445+
output AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED bool = azureTracingGenAIContentRecordingEnabled
446446

447447
// Outputs required by azd for ACA
448448
output AZURE_CONTAINER_ENVIRONMENT_NAME string = containerApps.outputs.environmentName

scripts/write_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo "AZURE_AI_AGENT_NAME=$(azd env get-value AZURE_AI_AGENT_NAME)" >> $ENV_FILE
1919
echo "AZURE_TENANT_ID=$(azd env get-value AZURE_TENANT_ID)" >> $ENV_FILE_PATH
2020
echo "AZURE_EXISTING_AIPROJECT_ENDPOINT=$(azd env get-value AZURE_EXISTING_AIPROJECT_ENDPOINT)" >> $ENV_FILE_PATH
2121
echo "ENABLE_AZURE_MONITOR_TRACING=$(azd env get-value ENABLE_AZURE_MONITOR_TRACING)" >> $ENV_FILE_PATH
22-
echo "AZURE_TRACING_GENAI_CONTENT_RECORDING_ENABLED=$(azd env get-value AZURE_TRACING_GENAI_CONTENT_RECORDING_ENABLED)" >> $ENV_FILE_PATH
22+
echo "AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED=$(azd env get-value AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED)" >> $ENV_FILE_PATH
2323

2424
echo "Web app URL:"
2525
echo -e "\033[0;36m $(azd env get-value SERVICE_API_URI)"

src/api/main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ async def lifespan(app: fastapi.FastAPI):
4747
from azure.monitor.opentelemetry import configure_azure_monitor
4848
configure_azure_monitor(connection_string=application_insights_connection_string)
4949
app.state.application_insights_connection_string = application_insights_connection_string
50-
51-
from azure.ai.agents.telemetry import AIAgentsInstrumentor
52-
agents_instrumentor = AIAgentsInstrumentor()
53-
if not agents_instrumentor.is_instrumented():
54-
agents_instrumentor.instrument()
55-
logger.info("Configured Application Insights for tracing.")
50+
logger.info("Configured Application Insights for tracing.")
5651

5752
if agent_id:
5853
try:

src/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"aiohttp==3.11.1",
1212
"azure-ai-projects",
1313
"azure-core-tracing-opentelemetry",
14-
"azure-monitor-opentelemetry",
14+
"azure-monitor-opentelemetry>=1.6.9",
1515
"azure-search-documents"
1616
]
1717

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ azure_ai_projects==1.0.0b11
99

1010
azure-core==1.31.0 # other versions might not compatible
1111
azure-core-tracing-opentelemetry
12-
azure-monitor-opentelemetry
12+
azure-monitor-opentelemetry>=1.6.9
1313
azure-search-documents
1414
opentelemetry-sdk
1515

0 commit comments

Comments
 (0)