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

[BUG] Azure Functions - Service Name can't be the Artifact Name #2320

Open
rfavreau opened this issue Apr 1, 2024 · 1 comment
Open

[BUG] Azure Functions - Service Name can't be the Artifact Name #2320

rfavreau opened this issue Apr 1, 2024 · 1 comment
Labels
agent-dotnet bug Something isn't working community question Further information is requested stale

Comments

@rfavreau
Copy link

rfavreau commented Apr 1, 2024

APM Agent version

The version of the Elastic.Apm nuget package used is 1.26

Environment

Operating system and version:
Azure Functions
.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) :
.Net Core 8
Application Target Framework(s) (e.g. net462, netcoreapp3.1):
dotnet-isolated

Describe the bug

It's not possible to set the service name with the discover default service name (Artifact name). It's always overwrite by the Azure Functions name.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy an Azure Function with the APM Agent like described in the documentation
  2. Then call your function trigger (for exemple an HttpTrigger)
  3. Then check the Service Name into the APM page
  4. This Service Name will be the Azure Functions name and not the Artifact name

Expected behavior

With the ELASTIC_APM_SERVICE_NAME environment variable, we can update this Service Name but never with the Artifact Name. To have the same namming convention that the .Net Applications (into the APM page), i expecte to have the Artifact Name.

@stevejgordon
Copy link
Contributor

Hi, @rfavreau. I'm sorry for not getting back to you sooner. I've been focusing on the Azure Functions instrumentation this week and noticed this issue.

The current behaviour is by design. When ELASTIC_APM_SERVICE_NAME is not configured, it prefers using the Function App name read from WEBSITE_SITE_NAME in Azure. When running locally, you can set that via the local.settings.json. There is a bug right now that I'll address to ensure that when it is null in local development, we handle it, probably by falling back to the discovered service name.

The expectation is that generally, you should explicitly set ELASTIC_APM_SERVICE_NAME in Azure if you want a name different from the name of the Function App the function lives under. Is that possible in your case?

I see you opened a PR to add a new config. I don't think that achieves what you intended, and I'm also reluctant to add another configuration option specifically for this scenario. ELASTIC_APM_SERVICE_NAME should be sufficient to control the service name explicitly.

@stevejgordon stevejgordon added question Further information is requested stale and removed triage labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-dotnet bug Something isn't working community question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants