Skip to content

feat: add ShouldStartFilter to control span creation in Instrumenter#15495

Closed
steverao wants to merge 5 commits intoopen-telemetry:mainfrom
steverao:filter
Closed

feat: add ShouldStartFilter to control span creation in Instrumenter#15495
steverao wants to merge 5 commits intoopen-telemetry:mainfrom
steverao:filter

Conversation

@steverao
Copy link
Copy Markdown
Contributor

@steverao steverao commented Dec 1, 2025

Related #15477

@steverao steverao requested a review from a team as a code owner December 1, 2025 05:46
@steverao steverao marked this pull request as draft December 1, 2025 08:09
@steverao steverao marked this pull request as ready for review December 1, 2025 11:22
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
GENERIC TEMPLATES: === REQUEST:java.lang.Object, === RESPONSE:java.lang.Object
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder<REQUEST,RESPONSE> addShouldStartFilter(io.opentelemetry.instrumentation.api.internal.InternalShouldStartFilter<? super REQUEST>)
Copy link
Copy Markdown
Contributor Author

@steverao steverao Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this extension, I added new method addShouldStartFilter in InstrumenterBuilder. Do you have any comment or guidance about this point?

final List<AttributesExtractor<? super REQUEST, ? super RESPONSE>>
operationListenerAttributesExtractors = new ArrayList<>();
final List<ContextCustomizer<? super REQUEST>> contextCustomizers = new ArrayList<>();
final List<InternalShouldStartFilter<? super REQUEST>> shouldStartFilters = new ArrayList<>();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it set as a global filter for all instrumentations or an InstrumenterBuilder-level filter?

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 14 days.

@github-actions github-actions Bot added the stale label Mar 11, 2026
@github-actions github-actions Bot closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant