QuestionQ39

VerifiedImplement generative AI and agentic solutions

Your company is piloting a customer support agent within a Microsoft Foundry project called Project1. Project1 is connected to an existing Application Insights resource, and the support team reviews runs on the Traces tab.

The Foundry Agent Service is set up to:

  • Retrieve the Application Insights connection string by calling project_client.telemetry.get_application_insights_connection_string().
  • Call configure_azure_monitor(connection_string=...) to enable telemetry.

A separate LangChain service uses OpenTelemetry and is configured as follows:

  • It uses AzureAIOpenTelemetryTracer(connection_string=..., enable_content_recording=False).
  • It passes the tracer with config=\{"callbacks":[azure_tracer]\}.

Company policy requires that:

  • Telemetry from LangChain and OpenTelemetry must be distinguishable within the same Application Insights resource.
  • Secrets and credentials must not be stored in prompts, tool arguments, or span attributes.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Yes or No
StatementsYesNo
The LangChain service will appear in Traces without configuring a tracer.
Setting different OTEL_SERVICE_NAME values separates the services in Application Insights.
When using enable_content_recording=False, prompts and tool data will be captured in the telemetry.
Explanation

AzureAIOpenTelemetryTracer must be explicitly created and attached to a LangChain/LangGraph run (for example, via config={"callbacks": [tracer]}) for that service's spans to be exported to Application Insights; without configuring a tracer for a given process, that process's telemetry is not automatically captured there. Application Insights differentiates telemetry from multiple services within a single resource by the underlying OpenTelemetry service.name resource attribute, commonly set through the OTEL_SERVICE_NAME environment variable, which becomes the cloud role name shown in Azure Monitor - giving each service its own identifiable role even though both write to the same Application Insights resource. Setting enable_content_recording=False on AzureAIOpenTelemetryTracer redacts message content and tool call arguments from the emitted spans, so prompts and tool data are NOT captured in the telemetry when this flag is False, which is what satisfies the requirement that secrets and credentials not be stored in prompts, tool arguments, or span attributes.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!