Skip to content

Support for ignoring specific HTTP paths in auto-instrumentation #2329

Open
@apshada

Description

@apshada

Is your feature request related to a problem? Please describe.
I'm often frustrated because my services have endpoints like /ping and /health that generate many HTTP requests but provide little value when traced. Currently, the OpenTelemetry Go auto-instrumentation agent does not have a way to exclude these endpoints from creating spans, causing unnecessary noise in tracing data and increased overhead.

Describe the solution you'd like
I would like the auto-instrumentation agent to support a configuration option—such as an environment variable OTEL_GO_AUTO_HTTP_IGNORE_PATHS—to specify HTTP paths (or patterns) that should be excluded from tracing. This would prevent spans from being created for those paths and reduce noise in telemetry data.

Describe alternatives you've considered
The only alternatives are manual instrumentation with custom filters in code (e.g., using otelhttp.WithFilter), or filtering spans downstream in the OpenTelemetry Collector. However, these approaches add complexity or overhead and do not solve the problem directly in the auto-instrumentation layer.

Additional context
Many other OpenTelemetry instrumentation libraries for different languages support path-based span filtering or ignoring, so it would be great to have this feature in the Go auto-instrumentation as well. This is especially helpful in microservices with health and readiness endpoints frequently polled by load balancers or orchestration systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions