Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions sdk/ai/azure-ai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,15 +1143,6 @@ from azure.monitor.opentelemetry import configure_azure_monitor
application_insights_connection_string = os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
configure_azure_monitor(connection_string=application_insights_connection_string)

try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

scenario = os.path.basename(__file__)
tracer = trace.get_tracer(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ def enable_azure_monitor_tracing(self):
print("Enable it via the 'Tracing' tab in your AI Foundry project page.")
exit()
configure_azure_monitor(connection_string=application_insights_connection_string)
try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

def enable_console_tracing_without_genai(self):
exporter = ConsoleSpanExporter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ async def main() -> None:
application_insights_connection_string = os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
configure_azure_monitor(connection_string=application_insights_connection_string)

try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

with tracer.start_as_current_span(scenario):
async with agents_client:
agent = await agents_client.create_agent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
can be found in the `sample_telemetry.py` file in the azure-ai-projects telemetry samples.
"""

import os, time
import os
from azure.ai.agents import AgentsClient
from azure.ai.agents.models import ListSortOrder
from azure.identity import DefaultAzureCredential
Expand All @@ -46,15 +46,6 @@
application_insights_connection_string = os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
configure_azure_monitor(connection_string=application_insights_connection_string)

try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

scenario = os.path.basename(__file__)
tracer = trace.get_tracer(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ def on_unhandled_event(self, event_type: str, event_data: Any) -> None:
application_insights_connection_string = os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
configure_azure_monitor(connection_string=application_insights_connection_string)

try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

scenario = os.path.basename(__file__)
tracer = trace.get_tracer(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@
application_insights_connection_string = os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
configure_azure_monitor(connection_string=application_insights_connection_string)

try:
from azure.ai.agents.telemetry import AIAgentsInstrumentor

agents_instrumentor = AIAgentsInstrumentor()
if not agents_instrumentor.is_instrumented():
agents_instrumentor.instrument()
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Could not call `AIAgentsInstrumentor().instrument()`. Exception: {exc}")

scenario = os.path.basename(__file__)
tracer = trace.get_tracer(__name__)

Expand Down