Skip to content

Parity with AX dcdfd0a: OpenTelemetry in rax-server, per-resource protos with buf, Substrate v1.0.0 - #16

Merged
h0ffmann merged 4 commits into
claude/project-thread-qrvp97from
claude/project-thread-mi5qax
Nov 10, 2026
Merged

h0ffmann merged 4 commits into
claude/project-thread-qrvp97from
claude/project-thread-mi5qax

Conversation

@h0ffmann

Copy link
Copy Markdown
Collaborator

Requested by Hoffmann · project thread

Brings RAX to parity with AX's main at dcdfd0a (2026-11-10). The previous parity point was 241bc4d. This PR is stacked on #14, which touches the same README, so its base is #14's branch. Once #14 merges it can be retargeted to main.

What changed in AX, and the RAX port

OpenTelemetry in the server (rax-server::telemetry, rax-server::axattr)

  • Traces go over OTLP/gRPC. 10% of new traces are sampled (parent based), and only W3C trace context is propagated, not baggage.
  • Metrics are pushed over OTLP and also served for Prometheus on --metrics-addr (default :9090; empty turns it off), with process metrics included.
  • Events (telemetry::emit) go to stdout as JSON lines by default. OTEL_LOGS_EXPORTER=otlp sends them as OTLP log records instead, and otlp,console does both.
  • Log lines are now JSON, using the keys AX's slog writes (time, level, msg, then the fields). While a span is active they also carry trace_id, span_id and trace_flags.
  • OTEL_TRACES_SAMPLER and OTEL_*_EXPORTER are resolved the way AX resolves them: an invalid value is logged and the default is kept.
  • AX's manifests, which just deploy renders, already have the ax-otel-config ConfigMap and the metrics port, so no manifest changes are needed. See docs/observability.md.

Protos split per resource, linted with buf

  • AX's common, task, workspace, model and ax.proto are copied unchanged to proto/pkg/apis/v1alpha1, where their imports resolve. The generated Rust types are the same.
  • AX's buf.yaml is added, with a just proto-lint recipe and a CI step (buf format --diff and buf lint, using the buf version AX pins). Code generation stays on protox and prost.

Substrate v1.0.0

  • ateapi.proto moves from v1.0.0-rc.1 to v1.0.0. Only comments changed.
  • just deploy now installs Substrate from its published release images, as AX's kind setup does. The WorkerPool worker image is pinned by digest. AX's setup refuses anything that isn't a clean release checkout; RAX's setup builds Substrate from source in that case instead.

Known differences (in the README)

  • OTLP export has no TLS, so the collector endpoint must be http://, as in AX's manifests. Turning on tonic's TLS features through opentelemetry-otlp made tonic refuse the https endpoint that rax-substrate dials with its own rustls connector. cargo test --all caught this in the TLS client test.
  • The resource's service name is service.name=rax-server. There are no Go runtime metrics (go_*), and OTEL_GO_X_CARDINALITY_LIMIT is not read, so the limit stays at 2000.

Tests

  • Ported AX's telemetry tests (9) against an in-process OTLP/gRPC collector, plus 5 unit tests.
  • cargo test --all: 191 passed. cargo clippy --all-targets -- -D warnings and cargo fmt --check are clean, and buf lint and buf format are clean.
  • shellcheck hack/local/*.sh is clean. I checked the release-image digest lookup against ghcr.io for all eight v1.0.0 images, but the cluster path has not been run, as before.

Generated by Claude Code

…s AX now does

AX moved its messages out of ax.proto into common, task, workspace and
model.proto, leaving the AX service in ax.proto, with no wire changes.
Copy the five files unchanged to proto/pkg/apis/v1alpha1, where their
repository-root-relative imports resolve, and compile them from there.
The generated Rust types are the same.

AX also formats and lints its protos with buf now. Add AX's buf.yaml
(module rooted at proto/), a `just proto-lint` recipe and the same check
in CI, with buf pinned at the version AX pins. RAX still generates code
with protox and prost, so there is no buf.gen.yaml.

Move proto/ateapi/v1/ateapi.proto to Substrate v1.0.0, which AX now
builds against. Only comments changed since v1.0.0-rc.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp2viybDSJp7DZcxhS9
…gs, as AX now does

AX's ax-server now sets up the OpenTelemetry SDK. Port it as the
telemetry module of rax-server:

- Traces export over OTLP/gRPC. New traces are sampled at 10%
  (parent based, trace-ID ratio), a caller's decision is followed, and
  only W3C trace context is propagated, not baggage.
- Metrics are pushed over OTLP and served for Prometheus on
  --metrics-addr (default :9090, empty disables it), with process
  metrics. Probes and the API stay on --addr.
- Events (Event, emit) go to stdout as JSON lines by default, over OTLP
  log records with OTEL_LOGS_EXPORTER=otlp, or both with otlp,console.
- Log lines are JSON in the shape of AX's slog output (time, level,
  msg, fields), with trace_id, span_id and trace_flags while a span is
  active. SDK errors are log lines too.
- OTEL_TRACES_SAMPLER and OTEL_*_EXPORTER are resolved by rax-server, as
  AX resolves them: an unknown or invalid value is logged and keeps the
  default. OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES override the
  resource (service.name rax-server, service.instance.id the hostname).

axattr names the attributes AX emits. As in AX, nothing records spans or
emits events yet. AX's manifests, which `just deploy` renders, already
carry the ax-otel-config ConfigMap and the metrics port.

Ports AX's telemetry tests against an in-process OTLP collector, and
adds docs/observability.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp2viybDSJp7DZcxhS9
…etup now does

AX's E2E setup no longer builds Substrate: it installs the published
release images from ghcr.io/agent-substrate/substrate through ate-setup's
ATE_IMAGE_REPO and ATE_IMAGE_TAG, and pins the WorkerPool's worker image
by digest, looked up with an anonymous registry token.

Do the same in `just deploy` when the Substrate checkout is a clean
release tag, its ate-setup has --image-repo and every image is
published (SUBSTRATE_IMAGE_REPO points at a mirror). Unlike AX's setup,
anything else still builds Substrate from source with ko, so a local
Substrate checkout keeps working. The registry status check reads the
last status line, so a proxy's CONNECT response does not hide a 401.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp2viybDSJp7DZcxhS9
README: the parity point moves to dcdfd0a (2026-11-10), with the
telemetry row, Substrate v1.0.0, the per-resource protos and buf lint,
/metrics on :9090, the counted Go lines and the test counts (191).

Turning on opentelemetry-otlp's TLS features also turned on tonic's,
and tonic then refuses the https endpoint rax-substrate dials through
its own rustls connector ("Connecting to HTTPS without TLS enabled"),
which `cargo test --all` caught in the TLS client test. Keep them off:
OTLP export is plaintext, which AX's manifests use. Listed among the
known differences and in docs/observability.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp2viybDSJp7DZcxhS9
@h0ffmann h0ffmann self-assigned this Nov 10, 2026
@h0ffmann
h0ffmann merged commit 1d1b623 into claude/project-thread-qrvp97 Nov 10, 2026
3 checks passed
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.

2 participants