Skip to content

Arguments not passed to span attributes #316

@tbrockman

Description

@tbrockman

Hey! Was just testing the tool, not sure if my expectations are incorrect or I've configured something incorrectly, but my spans don't appear to contain any attributes for the arguments passed to the command being executed, for example:

export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317
otel-cli exec --service "otel-cli" --name "echo" --attrs test.attr=abc -- echo "a" "b" "test"
a b test

And in a locally running otel-collector-contrib with debug logs enabled:

otel-collector-1  | 2024-03-30T16:39:11.684Z    info    TracesExporter  {"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 1} 
otel-collector-1  | 2024-03-30T16:39:11.684Z    info    ResourceSpans #0
otel-collector-1  | Resource SchemaURL: https://opentelemetry.io/schemas/1.17.0    
otel-collector-1  | Resource attributes:
otel-collector-1  |      -> service.name: Str(otel-cli)
otel-collector-1  | ScopeSpans #0
otel-collector-1  | ScopeSpans SchemaURL: https://opentelemetry.io/schemas/1.17.0  
otel-collector-1  | InstrumentationScope github.com/equinix-labs/otel-cli unknown  
otel-collector-1  | Span #0
otel-collector-1  |     Trace ID       : 1ff0a8598155a3557e3a5e1cc7cc85b7
otel-collector-1  |     Parent ID      :
otel-collector-1  |     ID             : a1b90937c0f99e17
otel-collector-1  |     Name           : echo
otel-collector-1  |     Kind           : Client
otel-collector-1  |     Start time     : 2024-03-30 16:39:11.675027667 +0000 UTC   
otel-collector-1  |     End time       : 2024-03-30 16:39:11.676319855 +0000 UTC   
otel-collector-1  |     Status code    : Unset
otel-collector-1  |     Status message :
otel-collector-1  | Attributes:
otel-collector-1  |      -> test.attr: Str(abc)
otel-collector-1  |     {"kind": "exporter", "data_type": "traces", "name": "debug"}
otel-collector-1  | 2024-03-30T16:39:11.686Z    info    zapgrpc/zapgrpc.go:178  [transport] [server-transport 0xc00076d1e0] Closing: EOF   {"grpc_log": true}
otel-collector-1  | 2024-03-30T16:39:11.686Z    info    zapgrpc/zapgrpc.go:178  [transport] [server-transport 0xc00076d1e0] loopyWriter exiting with error: connection error: desc = "transport is closing"   {"grpc_log": true}

Which only seems to contain the manually specified attribute (and will contains no attributes at all without it).

Is this expected?

No --version to share, but I installed it today with:

go install github.com/equinix-labs/otel-cli@latest

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