Add otel collect and otel send-mock-trace - #65
Merged
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commands for looking at an agent's traces without a hosted backend.
otel collectgenerates an OpenTelemetry collector config under~/.config/rossoctl/otel, startsotel/opentelemetry-collector-contribwith it mounted, and publishes OTLP on 4317/4318.--traces_endpointsets where spans are forwarded (defaulthttp://host.containers.internal:5001/v1/traces). The generated path and the receiver endpoint are recorded in~/.config/rossoctl/otel-config.yaml.otel send-mock-traceposts one span there — random trace/span IDs,service.namefrom--serviceName— to check the path to MLflow without an instrumented workload.$HOMEbecause a runtime on macOS/Windows can only bind-mount paths its VM shares; anXDG_CONFIG_HOMEoutside it is ignored, and reported.containers.RunSpecgainsPortMappingsfor 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.nameintended.Assisted by Claude.