Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Unable to View Logs in App Insights Telemetry Example #11510

Open
anu43 opened this issue Apr 11, 2025 · 0 comments
Open

Python: Unable to View Logs in App Insights Telemetry Example #11510

anu43 opened this issue Apr 11, 2025 · 0 comments
Labels
python Pull requests for the Python Semantic Kernel triage

Comments

@anu43
Copy link

anu43 commented Apr 11, 2025

Hello,

I attempted to run the python/samples/demos/telemetry example using the command python main.py --scenario ai_service by enabling AzureAIInferenceChatCompletion instead of the default OpenAIChatCompletion. However, I cannot see any logs in my App Insights instance under Monitoring > Logs > Tables > traces. In contrast, logs appear correctly when using the alternative setup provided in the documentation.

from azure.monitor.opentelemetry import configure_azure_monitor
import logging
from opentelemetry import trace

# Configure Azure Monitor
configure_azure_monitor(
    connection_string="...",
)

# Get logger and tracer
logger = logging.getLogger(__name__)
tracer = trace.get_tracer(__name__)

# Log and trace
logger.warning("This is a warning")
with tracer.start_as_current_span("operation_name") as span:
    span.set_attribute("attribute_key", "value")
    logger.info("Operation in progress")
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel triage
Projects
None yet
Development

No branches or pull requests

2 participants