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

Best-Effort Tracing #65

Merged
merged 2 commits into from
Dec 4, 2023
Merged

Best-Effort Tracing #65

merged 2 commits into from
Dec 4, 2023

Conversation

bpholt
Copy link
Member

@bpholt bpholt commented Dec 4, 2023

If tracing is unavailable for some reason, we don't want the overall program to fail; rather, we just want to ignore the tracing failure and continue on. This does so, emitting a log message when the failure occurs.

@bpholt bpholt self-assigned this Dec 4, 2023
@bpholt bpholt requested a review from a team as a code owner December 4, 2023 22:12
@mergify mergify bot added the core label Dec 4, 2023
(implicit F: MonadCancelThrow[F],
L1: Local[F, Span[F]],
L2: Logger[F]): F[A] =
Resource.applyFull { (poll: Poll[F]) =>
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main bit; the rest of this is tests and preserving binary compatibility with previous releases.

@@ -42,16 +43,21 @@ class TraceResourceLifecycleOps[F[_], A](val resource: Resource[F, A]) extends A
* and finalization phases of the passed `Resource[F, A]` are traced in
* separate root spans.
*
* Unfortunately on Scala 2.12, because of the way extention methods are
* encoded, it is not possible to add an implicit Logger[F] to warng if
Copy link

Choose a reason for hiding this comment

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

nit small typo here - warng instead of warn

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch, thanks!

gorskilauren
gorskilauren previously approved these changes Dec 4, 2023
@bpholt bpholt merged commit 956e600 into main Dec 4, 2023
18 checks passed
@bpholt bpholt deleted the best-effort-tracing branch December 4, 2023 23:05
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.

3 participants