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

feat: Add instrumentation for In-Process Azure Functions #3003

Merged
merged 33 commits into from
Mar 6, 2025

Conversation

tippmar-nr
Copy link
Member

@tippmar-nr tippmar-nr commented Feb 21, 2025

Description

  • Adds instrumentation for In-Process (Windows only, .NET 6 or .NET 8) Azure Functions
  • Adds Distributed Tracing support for In-Process Azure Functions for the following cases:
    • HttpTrigger functions will read incoming distributed trace headers if the trigger method has a parameter of type System.Net.Http.HttpRequest, Microsoft.AspNetCore.Http.DefaultHttpRequest or Microsoft.AspNetCore.Http.HttpRequest.
    • ServiceBusTrigger functions will read incoming distributed trace headers if the trigger method has a parameter of type Azure.Messaging.ServiceBus.ServiceBusReceivedMessage. Trace headers are expected to be in the ApplicationProperties collection.
    • Distributed trace headers will be inserted into the ApplicationProperties collection for Triggers with return a type of Azure.Messaging.ServiceBus.ServiceBusMessage.
  • Adds two new supportability metrics for Azure Functions:
    • Supportability/DotNet/AzureFunction/Worker/InProcess (or /Isolated)
    • Supportability/DotNet/AzureFunction/Trigger/{TriggerType} where {TriggerType} is the name of the trigger attribute (minus the TriggerAttribute suffix).
  • Existing Supportability/DotNet/AzureFunctionMode/Enabled metric has been replaced with Supportability/DotNet/AzureFunctionMode/enabled and Supportability/DotNet/AzureFunctionMode/disabled.

Includes integration tests.

Author Checklist

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required)

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@tippmar-nr tippmar-nr changed the title **DRAFT** feat: Add instrumentation for In-Process Azure Functions feat: Add instrumentation for In-Process Azure Functions Feb 27, 2025
@tippmar-nr tippmar-nr marked this pull request as ready for review February 27, 2025 20:42
@tippmar-nr tippmar-nr requested a review from a team as a code owner February 27, 2025 20:42
tippmar-nr and others added 5 commits February 28, 2025 12:59
jaffinito
jaffinito previously approved these changes Mar 4, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.17%. Comparing base (7ab30d7) to head (7fdbf7b).

Files with missing lines Patch % Lines
...nt/NewRelic/Agent/Core/Transactions/Transaction.cs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3003      +/-   ##
==========================================
+ Coverage   82.11%   82.17%   +0.06%     
==========================================
  Files         476      476              
  Lines       30536    30553      +17     
  Branches     3416     3418       +2     
==========================================
+ Hits        25075    25108      +33     
+ Misses       4661     4644      -17     
- Partials      800      801       +1     
Flag Coverage Δ
Agent 83.23% <90.00%> (+0.06%) ⬆️
Profiler 72.49% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...elic/Agent/Core/AgentHealth/AgentHealthReporter.cs 89.23% <100.00%> (+0.66%) ⬆️
...c/Agent/NewRelic/Agent/Core/Metrics/MetricNames.cs 92.51% <100.00%> (+0.05%) ⬆️
...nt/NewRelic/Profiler/Configuration/Configuration.h 71.26% <100.00%> (+0.86%) ⬆️
...nt/NewRelic/Agent/Core/Transactions/Transaction.cs 80.70% <75.00%> (-0.03%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tippmar-nr tippmar-nr merged commit 47d22a1 into main Mar 6, 2025
97 checks passed
@tippmar-nr tippmar-nr deleted the feature/azure-functions-in-process-support branch March 6, 2025 22:04
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.

5 participants