Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for span suppression and coalescing, simplify span creation API via builder pattern #665

Merged
merged 8 commits into from
Nov 24, 2022

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Nov 23, 2022

An idea I've been thinking about for a while. Could be useful to suppress span creation from a third party library (e.g. skunk).

Trace[F].span("getOrders", Span.Options.Suppress)(doSkunkQuery)

The above would result in all Skunk spans getting ignored entirely and all fields / events / errors ignored. Span.Options.Coalesce would instead merge all the fields / events / errors to the getOrders span.

Suppression / filtering can be done by various backends but not all. The approach in this PR allows application developers to opt-out of tracing done by a library, without requiring backend specific filtering.

This PR also switches to using the builder pattern for span creation, as otherwise we'll keep having to add various permutations of parameters to new span methods, each which breaks binary compatibility.

@mpilquist mpilquist marked this pull request as ready for review November 24, 2022 01:36
@mpilquist mpilquist changed the title Initial draft of span coalescing Add support for span suppression and coalescing, simplify span creation API via builder pattern Nov 24, 2022
@mpilquist mpilquist merged commit 9d74b8f into main Nov 24, 2022
@mpilquist mpilquist deleted the topic/coalesce branch November 24, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant