Skip to content

can configure otel service name #11425

@scrocquesel-ml150

Description

@scrocquesel-ml150

What problem would the feature you're requesting solve? Please describe.

Our function name are a bit meaningless and we use OTEL_SERVICE_NAME to override the value of service.name in the isolated worker process.
Unfortunately, FunctionsResourceDetector use WEBSITE_SITE_NAME which is a read-only settings.

string serviceName = Environment.GetEnvironmentVariable(OpenTelemetryConstants.SiteNameEnvVar);

When searching transaction in appInsights, we have two differents values for the service name depending the source of the trace (host or worker).

Describe the solution you'd like

Provide a configurable setting to override the WEBSITE_SITE_NAME. For example, the worker use WEBSITE_CLOUD_ROLENAME

https://github.com/Azure/azure-functions-dotnet-worker/blob/ab7b3f25a6cd706aa9906c11b2feced98f59e273/src/DotNetWorker.ApplicationInsights/Initializers/AppServiceOptionsInitializer.cs#L9

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions