Skip to content

Add otel collect and otel send-mock-trace - #65

Merged
esnible merged 1 commit into
mainfrom
otel-collect
Aug 17, 2026
Merged

Add otel collect and otel send-mock-trace#65
esnible merged 1 commit into
mainfrom
otel-collect

Conversation

@esnible

@esnible esnible commented Aug 17, 2026

Copy link
Copy Markdown
Member

Two commands for looking at an agent's traces without a hosted backend.

otel collect generates an OpenTelemetry collector config under ~/.config/rossoctl/otel, starts otel/opentelemetry-collector-contrib with it mounted, and publishes OTLP on 4317/4318. --traces_endpoint sets where spans are forwarded (default http://host.containers.internal:5001/v1/traces). The generated path and the receiver endpoint are recorded in ~/.config/rossoctl/otel-config.yaml.

otel send-mock-trace posts one span there — random trace/span IDs, service.name from --serviceName — to check the path to MLflow without an instrumented workload.

rossoctl otel collect
rossoctl otel send-mock-trace --serviceName my-agent
  • The config goes under $HOME because a runtime on macOS/Windows can only bind-mount paths its VM shares; an XDG_CONFIG_HOME outside it is ignored, and reported.
  • A missing MLflow is a warning, not an error — the exporter retries. The OTLP ports are checked up front, since they are fixed and the runtime would otherwise fail after writing a config.
  • containers.RunSpec gains PortMappings for fixed host ports.

Verified against the real collector image: a generated config loads clean, and a mock span traverses the pipeline with the timestamps and service.name intended.

Assisted by Claude.

`otel collect` generates an OpenTelemetry collector config, writes it under
~/.config/rossoctl/otel, and starts otel/opentelemetry-collector-contrib with
that file mounted, publishing OTLP on 4317 and 4318. Spans are forwarded to
the MLflow traces endpoint named by --traces_endpoint. The generated path and
the receiver's HTTP endpoint are recorded in ~/.config/rossoctl/otel-config.yaml.

The config lives under the home directory rather than a temp dir or an
arbitrary XDG_CONFIG_HOME: a runtime on macOS or Windows can only bind-mount
the host paths its VM shares, and the home directory is the one both podman
machine and Docker Desktop share by default. An XDG_CONFIG_HOME outside it is
ignored, and said so, because honoring it would write the file successfully and
then fail to mount.

Nothing listening on the endpoint's port is a warning rather than an error: the
exporter retries, so MLflow can be started afterwards. The OTLP ports are
checked first and refused up front, since they are published on fixed host
ports and the runtime would otherwise fail at `run` having already written a
config for a collector that never started.

`otel send-mock-trace` posts one span there, with random trace and span IDs and
service.name from --serviceName, ending now and starting a second earlier. It
checks the path to MLflow without an instrumented workload. Timestamps are sent
as JSON strings, which OTLP requires for 64-bit integers: as numbers a receiver
may parse them through a float64 and shift the span in time. A 200 that reports
rejected spans fails the command, so an exit status does not call a dropped span
a success.

containers.RunSpec gains PortMappings for fixed host ports; the existing
PublishPorts only asks for an ephemeral one, which an SDK configured to reach
4318 cannot discover.

Assisted by Claude.

Signed-off-by: Ed Snible <snible@us.ibm.com>
@esnible
esnible merged commit 37d0bca into main Aug 17, 2026
2 checks passed
@esnible
esnible deleted the otel-collect branch August 17, 2026 18:56
@esnible esnible mentioned this pull request Aug 17, 2026
1 task
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

Successfully merging this pull request may close these issues.

1 participant