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

Microsoft.Azure.Functions.Worker.ApplicationInsights missing operation name for child activities #1124

Closed
wkoeter opened this issue Oct 14, 2022 · 12 comments

Comments

@wkoeter
Copy link

wkoeter commented Oct 14, 2022

When starting a new activity within the activity provided by the FunctionActivitySource, the activity does land in application insights, but child activities lose the operation_Name property (other relevant properties related to trace context are correctly filled in).

packages used:

<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.11.0-preview2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.0.0-preview3" />

Edit: Maybe it is not in the scope of this package to manage it? Should we create our own listener that does a start/stop operation on a TelemetryClient with the Name field in the Tags filled in ourselves?

@jviau
Copy link
Contributor

jviau commented Oct 14, 2022

I think there may be some work for us to do here. If I am remembering correctly, operation_Name is typically the name of the most immediate parent RequestTelemetry, and child DependencyTelemetry pick that up. But I think it requires us to use explicit AppInsights APIs to start the outer operation, and not just AcitivtySource. We will take a look at this. In the meantime, you may be able to work-around this yourself via listening to the activity start/stop events and calling the appropriate AppInsights API to set this context/name.

@wkoeter
Copy link
Author

wkoeter commented Oct 16, 2022

Alright, will do that. Thanks.

@jviau
Copy link
Contributor

jviau commented May 11, 2023

@wkoeter
Copy link
Author

wkoeter commented May 15, 2023

@jviau I'm currently on leave and am not able to test that right now. Will be able to try that in June.

@jviau
Copy link
Contributor

jviau commented Jun 28, 2023

I looked into this, operation_Name will still be null. However, you can add your own ITelemetryInitializer and set telemetry.Context.Operation.Name with a value of your choosing, which will populate operation_Name.

We will consider setting this value at a later date when we revisit our telemetry schema.

@ghost ghost added the no-recent-activity label Jul 3, 2023
@ghost
Copy link

ghost commented Jul 3, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@wkoeter
Copy link
Author

wkoeter commented Jul 5, 2023

Ok thanks for checking. We are adding it ourselves and will keep doing so until no longer needed.

@jviau
Copy link
Contributor

jviau commented Jul 5, 2023

Closing this for now as we will evaluate adding operation_Name at a later date.

@jviau jviau closed this as completed Jul 5, 2023
@andrw
Copy link

andrw commented Feb 6, 2024

@jviau is there something we can track? Closing this feels like it's put in an icebox, and this seems like a really fundamental platform value.

@the-rule
Copy link

the-rule commented Mar 25, 2024

We are also experiencing the same issue which is crucial in my opinion and is more like a bug since the default Azure Functions logging supports custom log entries connected to operation_Name. @jviau could we reopen or link an issue?

@jviau
Copy link
Contributor

jviau commented Mar 25, 2024

We will capture this work as part of OTel efforts Azure/azure-functions-host#9273. OTel will support (and improve upon) Application Insights through the Azure Monitor exporter.

@btull89
Copy link

btull89 commented Jun 4, 2024

I'm also missing having the operation_Name available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants