Skip to content

[SpringBoot Starter] Ability to exclude specific KafkaListener from traces  #12470

@yddimitrov

Description

@yddimitrov

Is your feature request related to a problem? Please describe.

In our applications we have some Kafka Listeners that run on Application start and bootstrap caches by reading topics from the beginning.
This causes enormous spike in unnecessary traces during application boot. The Listeners are stopped after initial bootstrap so they do not provide any meaning after the boot is completed anyway.

Describe the solution you'd like

We want to have the ability to exclude specific Kafka Listeners or specific classes by Spring Configuration and/or a specific annotation.

Proposed solutions:

  • Ideally we want to have the ability to exclude classes and/or methods from producing traces.
    E.g.: otel.exclude-classes="my.package.MyClass,my.package2.*"
    E.g 2: otel.instrumentation.kafka.exclude-classes="my.package.MyClass,my.package2.*"

  • Have the ability to annotate methods and/or classes that should be ignored by OTEL exporters
    E.g: @WithoutSpan or @IgnoreSpan

Or any alternative that does not include JavaAgent and is compatible with the SpringBoot Starter for OTEL.

Describe alternatives you've considered

We considered migrating over to JavaAgent but that is not an ideal solution ATM.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions