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

Fixes and enhancements for Azure Functions (isolated worker) #2505

Merged
merged 13 commits into from
Nov 29, 2024

Conversation

stevejgordon
Copy link
Contributor

@stevejgordon stevejgordon commented Nov 29, 2024

This PR fixes several things in Azure Functions (isolated worker) which occur when using the latest templates for Azure Functions.

  • Newer versions of the Functions library prefer the gRPC-based implementation, which throws when Url is accessed. Instead, we read these from other data on the FunctionContext.
  • Address Functions library changes that break distributed tracing. We now parse the original headers from the BindingContext instead of the request, which may contain a traceparent with the sampling flag set to false when the user request does not include a specific traceparent.
  • We explicitly don't record activities from the Azure functions library as these are pretty broken (Tracing is now very broken in Azure Functions Azure/azure-functions-dotnet-worker#2733) and are redundant when using our middleware.
  • Downgrade several packages as the newer ones are now deprecated (thanks for the confusion, Microsoft!).
  • Update some outdated compiler pre-processor directives.
  • The final few commits focus on CI integration test hangs on Linux. We don't have a perfect solution for those, but after reviewing the hang dumps, I've avoided some of the potential causes of the hangs. We'll monitor subsequent PRs, and if they remain stable, we will readdress the original causes.

A follow-up PR will update our documentation.

Closes #2407
Closes #2311
Closes #2218

Due to implementation changes in the Functions libraries we have to
attempt a different method to collect the HTTP information we need.
This also wraps the code in a try/catch to avoid potential exceptions
from breaking the entire Function invocation.
When developing locally, various headers we expect to use to get
meta data for the service are not available. We should still set what
we can so that in local development the APM server does not return a
400 error.
@stevejgordon stevejgordon changed the title Azure functions url exception Fixes and enhancements for Azure Functions (isolated worker) Nov 29, 2024
@stevejgordon stevejgordon requested review from a team and Mpdreamz November 29, 2024 13:12
@stevejgordon stevejgordon marked this pull request as ready for review November 29, 2024 13:12
@stevejgordon stevejgordon merged commit 8edcb49 into main Nov 29, 2024
16 checks passed
@stevejgordon stevejgordon deleted the azure-functions-url-exception branch November 29, 2024 14:28
@alaeddineG
Copy link

alaeddineG commented Nov 29, 2024

@stevejgordon Thank you for handling this. we were experiencing the issue #2311 in my organization (we figured it out the same day you have decided to tackle it ... strange coincidence)
Im sorry if it's the wrong place to ask this but when are we expecting a new release for the agent with this fix ? is there a way to get it from the pre pr-elease channel ?

@stevejgordon
Copy link
Contributor Author

You're welcome, @alaeddineG. I'm afraid there's no preview channel. I can't commit fully, but I aim to release it next week.

@stevejgordon
Copy link
Contributor Author

@alaeddineG 1.31.0 was released today and includes the fixes that I hope address the issues above.

@alaeddineG
Copy link

alaeddineG commented Dec 2, 2024

@stevejgordon Thank you a lot, my team have switched to the new version and they told me the Issue #2311 is fixed !

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