Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.35k stars 2.7k forks source link

OpenTelemetry SDK didn't send Resources #36097

Open hcoona opened 1 week ago

hcoona commented 1 week ago

Describe the bug

After instrumented my Flask app with azure-monitor-opentelemetry, I can find some logs and traces as expected. However, none of them carries my customized resource. Even more, I cannot find any of the default resources from OpenTelemetry Python SDK.

image

C# SDK can emit it correctly.

To Reproduce

Steps to reproduce the behavior:

  1. Write any Flask app and instrument it with azure-monitor-opentelemetry.
  2. Start it and do something to emit some logs to Azure Monitor.
  3. Query with criteria | where * contains 'opentelemetry' (it's in default resource).

Expected behavior

Each of the logs, traces, requests, etc. should attach the resources.

hcoona commented 1 week ago

It's possible we need to also involve the exporter SDK owner to triage the issue.

github-actions[bot] commented 1 week ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @hectorhdzg @jeremydvoss @lzchen.

lzchen commented 5 days ago

@hcoona

How are you calling the apis? Are you passing in your custom resource into configure_azure_monitor() as shown in the configuration settings?

hcoona commented 5 days ago

Yes, and I challenge it because not only my customized resource but also OpenTelemetry SDK default resources were not properly transferred.

lzchen commented 2 days ago

@hcoona

Could you paste a code snippet of how you are using the api?

github-actions[bot] commented 1 day ago

Hi @hcoona. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.