Skip to content

Add support for OpenTelemetry Trace sampling to the host #11496

@openPablo

Description

@openPablo

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

Currently, it's not possible whatsoever to sample traces originating from the function host, if OpenTelemetry is enabled.
This makes Opentelemetry de facto unusable on a busy functionapp (unsampled traces can easily inflict thousands of $ worth of data ingestion).

Describe the solution you'd like

OpenTelemetry has two config flags to configure sampling See: docs:

  • OTEL_TRACES_SAMPLER
  • OTEL_TRACES_SAMPLER_ARG

These config flags are supported by the dotnet and by the azure-functions-dotnet-worker implementation of OpenTelemetry.

Logic can be added in the Opentelemetry instrumentation to set the correct tracing Sampler and Arg.

Describe alternatives you've considered

Maybe there's a method to enable ALL OTEL_* config flags supported by dotnet, but it looks like that would conflict with the current way that OpenTelemetry is instrumented in the function host.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions