-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
(implicit F: MonadCancelThrow[F], | ||
L1: Local[F, Span[F]], | ||
L2: Logger[F]): F[A] = | ||
Resource.applyFull { (poll: Poll[F]) => |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thanks!
6050a42
to
985a00c
Compare
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.