equinix-labs / equinix-labs/otel-cli

Add Support for Array and Key-Value Attributes

Open
#366 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
718
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Hi,

Currently, there seems to be no way to add array or key-value attributes using the `--attrs` argument.
For example, the attribute `container.image.tags` has a type of `string[]` ([documentation](https://opentelemetry.io/docs/specs/semconv/attributes-registry/container/)).

It would be helpful to enable creating spans with array attributes such as `otel-cli span --attrs "container.image.tags=[aaa,bbb]"`

Alternatively, introducing a new argument such as `--attrs-json` to allow specifying attributes in JSON would also be a viable.

Contributor guide

Open the contributing guide

Research direction

Start by locating the --attrs argument parsing and the tests covering scalar attributes. Compare the requested array syntax with the alternative JSON form before choosing a supported input shape. Done means spans created through the CLI accept array and key-value attributes, with tests covering the new parsing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.