Skip to content

Commit

Permalink
Merge pull request #806 from cb372/datadog-remove-error-propagation
Browse files Browse the repository at this point in the history
Datadog: do not propagate error to root span
  • Loading branch information
mpilquist authored May 23, 2023
2 parents 1749110 + ec4c927 commit 7da9611
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions modules/datadog/src/main/scala/DDSpan.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.opentracing.propagation.{Format, TextMapAdapter}
import io.opentracing.tag.Tags
import natchez.TraceValue.{BooleanValue, NumberValue, StringValue}
import _root_.datadog.trace.api.DDTags
import _root_.datadog.trace.api.interceptor.MutableSpan
import natchez.Span.Options
import natchez.datadog.DDTracer.{addLink, addSpanKind}

Expand Down Expand Up @@ -101,17 +100,7 @@ final case class DDSpan[F[_]: Sync](
DDTags.ERROR_MSG -> err.getMessage,
DDTags.ERROR_TYPE -> err.getClass.getSimpleName,
DDTags.ERROR_STACK -> err.getStackTrace.mkString
) >> {
// Set error on root span
span match {
case ms: MutableSpan =>
Sync[F].delay {
val localRootSpan = ms.getLocalRootSpan
localRootSpan.setError(true)
}.void
case _ => Sync[F].unit
}
} >>
) >>
Sync[F].delay {
span.log(
(Map(
Expand Down

0 comments on commit 7da9611

Please sign in to comment.