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:
- 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 }
- 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.
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:
span endon a span that already has attributes:--attrwhenOTEL_CLI_ATTRIBUTESis non-empty:In OTel terms of other languages/instrumentations, it would give us Set Attributes-like capabilities. This could be an additional attribute argument (
--add-attrandOTEL_CLI_ADDITIONAL_ATTRIBUTES?), or a flag (--preserve-attrandOTEL_CLI_PRESERVE_EXISTING_ATTRIBUTES?) modifying the behavior of--attr.