Skip to content

Commit

Permalink
improve rusoto exec_atomic_write errors
Browse files Browse the repository at this point in the history
* manually attach an `error.message` to subspans (on per-op errors) and
  to the main span. Unfortunately, `#[tracing(err)]` -> Datadog span
  export loses the error message (see
  <tokio-rs/tracing#2648>), so the manual
  approach is better for now. (Would be nice to have a proc macro that
  produces the right format but doesn't seem worth it just for
  keyvaluestore-rs's stuff.)

  (It'd be worthwhile to do the same on other operations, but small
  steps...)

* also fill in `otel.status_code` and `otel.kind`, which
  `tracing-opentelemetry` translates to the OpenTelemetry magic,
  and opentelemetry-datadog passes along.
  https://github.com/tokio-rs/tracing-opentelemetry/blob/f5f898b47e086659a7a78b495ef77661781895cd/src/layer.rs#L330
  https://github.com/open-telemetry/opentelemetry-rust/blob/1f1a4fe0540b5df92b7cf5b289d6e89c2e1c02a8/opentelemetry-datadog/src/exporter/model/v05.rs#L183

* on `AtomicWriteConflict`, mention the offending key.

* if there is an error that isn't a condition failure or write conflict,
  pass it back to the caller rather than erroneously claiming write
  conflict.

We could further modify the interface to pass any errors back per-op
rather than just condition failure, but I went with the more modest
change for now.
  • Loading branch information
scottlamb committed Jul 13, 2023
1 parent e357bc4 commit 184bcd1
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 144 deletions.

0 comments on commit 184bcd1

Please sign in to comment.