Skip to content
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

Adding or partially overriding attributes #358

Open
mechie opened this issue Aug 30, 2024 · 0 comments
Open

Adding or partially overriding attributes #358

mechie opened this issue Aug 30, 2024 · 0 comments

Comments

@mechie
Copy link

mechie commented Aug 30, 2024

Unsure whether I'm not spotting the right incantation/flag to do this, or it is a feature request.

Under the following circumstances, it would be useful to be able to append/override attributes instead of overwriting them:

  1. When calling span end on a span that already has attributes:
    TEST_SOCK=$(mktemp -d)
    otel-cli span background \
        --name "test" \
        --sockdir "${TEST_SOCK}" \
        --attr "color=red,size=large" \
        &
    # ...
    otel-cli span end \
        --sockdir "${TEST_SOCK}" \
        --attr "weight=100,size=small"
    # Want span with attributes { color=red, size=small, weight=100 }
  2. When calling any command with --attr when OTEL_CLI_ATTRIBUTES is non-empty:
    OTEL_CLI_ATTRIBUTES="color=red,size=large"
    otel-cli exec \
        --name "test" \
        --attr "weight=100,size=small" \
        work
    # Want span with attributes { color=red, size=small, weight=100 }

In OTel terms of other languages/instrumentations, it would give us Set Attributes-like capabilities. This could be an additional attribute argument (--add-attr and OTEL_CLI_ADDITIONAL_ATTRIBUTES?), or a flag (--preserve-attr and OTEL_CLI_PRESERVE_EXISTING_ATTRIBUTES?) modifying the behavior of --attr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant