Skip to content

Setting existing span's status code/description #197

@mechie

Description

@mechie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions