equinix-labs/otel-cli

Setting existing span's status code/description

mechie opened this issue ยท 4 comments

A fairly common use case in our non-otel-cli-instrumented code is:

  1. Open a span
  2. Do work
  3. If a failure occurs, record it as an event and then set the span's status to Error
  4. Close the span

I don't see a way to modify an existing background span via the cli commands, maybe span could have a new subcommand, modify, existing, or status? Or, although not as flexible, span end could take span's optional --status-code/--status-description flags, since a caller could reasonably store the outcome of their background span and set it at the end.

Alternatively, this might already a feature and I'm not finding the way to do so ๐Ÿ˜… If so, would appreciate an example.

I like the idea of adding the --status-code and --status-description flags to otel-cli span end. It makes sense and isn't super hard to add. I'll take a look.

I got it working in #201, I'm gonna sleep on it so I can review the PR with fresher eyes and likely merge tomorrow.

Merged :) I'll try to do a release next week, week after at the latest. I have a couple more things I want to clean up post-#175 before releasing.

tobert commented

release v0.3.0, please reopen if there's still an issue