-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Azure Monitor] Unable to track incoming requests to FastAPI end point using azure-monitor-opentelemetry-exporter #18171
Comments
Hi @gautam-ergo, thank you for opening this issue! We'll investigate ASAP. |
@gautam-ergo |
yes @lzchen current stack: |
@gautam-ergo |
Thanks @lzchen As seen in the screenshot above, there are 4 events being generated, collated all the details in this file, Please let me know if you need more info |
@gautam-ergo |
hey @lzchen, not sure if this is what you expected, Following graph is for the request count from the request blade you requested, spread across 30min bins and the flat line corresponds to 360 Background: the flat line corresponds to request made to /health end point from within the pod in which the api is hosted, which is continuously polled at 5 seconds which translates to 12 calls per minute and 360 calls per 30 mins Since you said the telemetry collector is doing its job, I created a sample python client and made calls to the endpoint and could see a spike in request count as shown below. If you could help me understand, when I created a python client with the same namespace as that of the api, I was able to track the incoming requests but actual scenario is that a .NET client residing in a different app insight namespace is making the calls to this api which are not getting tracked. From the above two graphs, it is clear that only the /health endpoint is being tracked whereas the calls made by the backend client to the api url is not showing up. Kindly advise. |
Is this sample python client using FastAPI, instrumented with opentelemetry-fastapi-instrumentation and you are using the AzureSpanExporter? It would be useful if you can paste your code in which you do all of this. If yes to all three, then we can isolate the issue as an either configuration issue that relates to app insights itself, not the exporter or opentelemetry. First of all, what do you mean by |
Thanks @lzchen , Yes, the .NET backend client that makes the calls to api endpoint is using a different instrumentation key. API receiving these calls are hosted using a different instrumentation key. Intention was to capture those outbound calls (from a different instrumentation key) as incoming requests This is the trace information from the .NET client, which is using a different key; these are shown as outbound POST calls in its respective application map This is the URI that is captured when made from the same app instance as that of api using the python client Was under the assumption that since the endpoint ('/api/v1/metrics/track' ) being tracked is the same, telemetry would pick up inbound requests as well. considering that .NET client is on a different instance, what do you recommend (different cloud roles? namespaces ?) Kindly advise |
To my knowledge, telemetry captured must be under the same instrumentation key to be traced together in the same application map. There might be some other solutions but I don't have the expertise for this as it is not an SDK or exporter issue. Might I suggest filing a ticket about this through azure support? |
Would that be a different repo, can you please point me towards the appropriate service repo. Thanks for your time and inputs @lzchen |
@gautam-ergo |
Closing this issue for now. Please feel free to reopen if any additional details. @gautam-ergo |
Describe the bug
We are using FastAPI in our production and successfully implemented log exporting using Azure log handers to Azure App Insights.
Currently we are not able to track incoming requests to the api endpoint made by the .NET client but those api POST calls are shown as outbound requests in the .NET application map.
But those outbound requests made by the .NET client are not being captured as incoming requests in the api telemetry
instrumented using ASGI and Azure exporter open telemetry
To Reproduce
Attached document contains more info
otel.docx
Expected behavior
Ability to track incoming requests
Screenshots
Attached document with screen grabs
Additional context
As part of the performance tracking only the healthcheck endpoint is being displayed
kindly advise
The text was updated successfully, but these errors were encountered: