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

OpenTelemetry.Instrumentation.AspNetCore Does Not Work as Expected in Azure Function Isolated-Worker Mode #5232

Closed
lsl-2020 opened this issue Jan 18, 2024 · 7 comments
Labels
question Further information is requested

Comments

@lsl-2020
Copy link

Question

Descriptions

Hi experts, as title mentioned. OpenTelemetry.Instrumentation.AspNetCore is not work as expected. Detailed behaviors: There are indeed Activitys generated by .NET framework, but none of them are sampled/recorded. Therefore, child activity has valid ParentId but null Parent, as is shown in screenshot below.
1705542845817

I have been debugging inside package OpenTelemetry.Instrumentation.AspNetCore and found that when Http request comes in, HttpInListener does not capture the event at all. My best guess is that Azure Function isolated-worker mode does not rely on internal ActivitySource "Microsoft.AspNetCore", which is the instrumentation package relying on.
Currently I am using a function middleware pipeline as a replacement of the AspNetCore instrumentation package. But I really do hope to get some hints on what's going on here. Thanks!

Reproduce

@lsl-2020 lsl-2020 added the question Further information is requested label Jan 18, 2024
@cijothomas
Copy link
Member

@martinjt Was discussing this exact issue in slack as well!

@cijothomas
Copy link
Member

Adding @RohitRanjanMS from Azure Functions.

@cijothomas
Copy link
Member

@lsl-2020 There is no expectation that AspNetCore instrumentation would work in Azure Functions or any other specific frameworks other than regular AspNetCore apps.
I'll close this issue, given there is no issue with regular AspNetCore apps.

For the Azure Functions - its a feature request to Azure Functions to provide a native instrumentation support or an instrumentation library. It is entirely possible than OTel's contrib repo will host the instrumentation library, so you may create a feature request there (or directly in Azure Functions repo).

@RohitRanjanMS
Copy link

Hi @lsl-2020 , Functions host is the right place to add ASPNetCore instrumentation. It's not possible as of now but we are actively working on a feature to enable OpenTelemetry support, ETA April/May. Here's our roadmap.

@martinjt
Copy link
Member

@RohitRanjanMS For clarity on the solution you're proposing, it will allow custom samplers for head sampling, full config of the exporters, processors, resource attribute customisation etc.?

The reason I ask is if you'll have all that in April/May, it may not be worth the otel team working on the instrumentation package, however, from what I've been told the solution being worked on wouldn't allow that, only configuring the export?

@lsl-2020
Copy link
Author

Thank you @cijothomas for the reply.
Thank you @RohitRanjanMS for the kind direction! One last quick question under this thread, the April/May ETA is for private preview or public preview? (I'll move to the azure-functions-host repo for the rest of questions.)

@RohitRanjanMS
Copy link

May likely for public preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants