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

Adding a null check before initiating the internal Activity #2765

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

RohitRanjanMS
Copy link
Member

Adding a null check before starting the internal Activity in the InvokeFunctionAsync method. This will help in scenarios where customers want to consume the request telemetry emitted by AspNetCoreInstrumentation. Adding this null check ensures that if a request telemetry already exists (generated by AspNetCoreInstrumentation), the internal Activity won’t be started.

resolves #2733

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Copy link
Contributor

@jviau jviau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Something I realize we are missing with our approach of new'ing up the activity manually: we are missing out on a perf optimization to not do this at all if the user is not listening to activities. How we will do this I am unsure, but it is a behavior with the ActivitySource API: if no one is listening to the source, it no-ops on activity creation.

@RohitRanjanMS RohitRanjanMS merged commit f2c700d into main Oct 14, 2024
29 checks passed
@RohitRanjanMS RohitRanjanMS deleted the roranjan/NullCheckForInternalActivity branch October 14, 2024 23:45
jviau added a commit that referenced this pull request Oct 23, 2024
* Generators package version update (#2755)

* Generator tests: Add transitive dependency for System.Text.Json v8.0.5 & bump extension versions (#2760)

* Fixing Function Executor test

* Refactor WebJobs extension info  (#2762)

* skipBuildTagsForGitHubPullRequests when the PR is a fork (#2770)

* Bump System.Text.Json from 8.0.4 to 8.0.5 in /host/src/FunctionsNetHost (#2768)

Bumps [System.Text.Json](https://github.com/dotnet/runtime) from 8.0.4 to 8.0.5.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](dotnet/runtime@v8.0.4...v8.0.5)

---
updated-dependencies:
- dependency-name: System.Text.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* re-use FunctionsWorkerApplicationBuilder if called multiple times (#2774)

* Add worker extension validation to CI (#2764)

* ignore rider temp files

* Support SignalR trigger return value (#2771)

* add skipBuildTagsForGitHubPullRequests for extensions (#2779)

* Fix typos in CI referencing test projects (#2773)

* Adding a null check before initiating the internal Activity (#2765)

* Adding a null check for the internal Activity.

* Bump System.Text.Json to 8.0.5 (#2783)

* Use full namespace for Task.FromResult in function metadata provider generator to avoid namespace conflict (#2681)

* Analyzer for Multiple-Output Binding Scenarios with ASP.NET Core Integration (#2706)

* Remove documentation tag (#2751)

The parameter does not exist.

* Update global.json .net8 value (#2795)

* initial fix of duplicate registrations if AddFunctionsWorkerCore called twice (#2790)

* Ignoring fatal exceptions in InvocationHandler (#2789)

* Update nethost global json, update sample (#2797)

* Set extension RPC max message length (#2772)

* Set max message length for RPC client

* Update Rpc version and release notes

* Update packages (#2800)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Surbhi Gupta <surgupta@microsoft.com>
Co-authored-by: Lilian Kasem <likasem@microsoft.com>
Co-authored-by: Fabio Cavalcante <facaval@microsoft.com>
Co-authored-by: sarah <35204912+satvu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brett Samblanet <brettsam@microsoft.com>
Co-authored-by: Simon Cropp <simon.cropp@gmail.com>
Co-authored-by: yzt <zityang@microsoft.com>
Co-authored-by: Rohit Ranjan <90008725+RohitRanjanMS@users.noreply.github.com>
Co-authored-by: David Lee <10739819+DL444@users.noreply.github.com>
Co-authored-by: Jonathan <vanillajonathan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracing is now very broken in Azure Functions
2 participants