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

Failed to derive Resource from Tracer Provider: 'ProxyTracerProvider' object has no attribute 'resource' #37460

Open
TaylorN15 opened this issue Sep 19, 2024 · 4 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@TaylorN15
Copy link

  • Package Name: azure-monitor-opentelemetry-exporter
  • Package Version: 1.0.0b29
  • Operating System: Linux (Azure App Service)
  • Python Version: 3.10

Describe the bug
Recently I have noticed a large amount of exceptions being thrown by azure-monitor-opentelemetry-exporter
which seem to be related to this change.

2024-09-19T00:09:19.214845698Z: [ERROR]  Traceback (most recent call last):
2024-09-19T00:09:19.214853498Z: [ERROR]    File "/tmp/8dcd83d242adfa1/antenv/lib/python3.10/site-packages/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py", line 91, in export
2024-09-19T00:09:19.214876499Z: [ERROR]      resource = tracer_provider.resource # type: ignore
2024-09-19T00:09:19.214882599Z: [ERROR]  AttributeError: 'ProxyTracerProvider' object has no attribute 'resource'

To Reproduce
I am not sure what is causing the exception to occur, but looking at the log stream from the App Service, it appears very frequently, so I assume it's whenever it's trying to log to Azure Monitor/App Insights.

Expected behavior
No exceptions

Additional context
Add any other context about the problem here.
I am also using some other otel packages as below

opentelemetry-instrumentation-aiohttp-client
opentelemetry-instrumentation-httpx
opentelemetry-instrumentation-requests
opentelemetry-instrumentation-openai

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Sep 19, 2024
Copy link

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

@Pinqvin
Copy link

Pinqvin commented Sep 19, 2024

We noticed this problem in our environment as well (Linux App Service, Python 3.12). Seems like version 1.0.0b29 introduced some breaking changes or something else is wrong here. We fixed the issue by downgrading both azure-monitor-opentelemetry packages:

azure-monitor-opentelemetry==1.6.1 
azure-monitor-opentelemetry-exporter==1.0.0b28

Ran into this issue and solution via Stack Overflow

@lzchen
Copy link
Member

lzchen commented Sep 19, 2024

@TaylorN15 @Pinqvin

Could you share a code snippet of the logic you are using? I mostly want to see if you are setting the global TracerProvider before the AzureMonitorTraceExporter.

@lzchen
Copy link
Member

lzchen commented Sep 19, 2024

I've put out a potential fix for the issue, apologies about the breaking behavior.

#37469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants