Skip to content

[FEATURE] support OTel-aligned telemetry (traces/metrics exporters) in Agent CRD #153

Description

Summary

Follow-up from adl-cli PR #281 (merged), which extended the ADL spec.telemetry from a single enabled boolean into an OpenTelemetry-aligned structure and now generates the matching A2A_OTEL_* (Go) / OTEL_* (TypeScript) env vars into the scaffolded .env.example.

The operator's Agent CRD hasn't caught up: it still models telemetry as {enabled, metrics:{enabled, port}} and its controller only injects TELEMETRY_ENABLED. Agents deployed via the operator therefore can't express or receive the new exporter configuration. Bring the Agent CRD and its controller in line with ADL schema v0.19.0 so operator-deployed agents can configure OTLP/Prometheus trace and metric exporters.

New ADL shape (schema v0.19.0)

telemetry:
  enabled: true
  traces:
    exporter:
      otlp:
        endpoint: http://localhost:4318
        protocol: http/protobuf
  metrics:
    exporter:
      prometheus:
        port: 9464
      # or:
      # otlp:
      #   endpoint: http://localhost:4318
      #   protocol: http/protobuf

Current operator state

  • api/v1alpha1/gateway_types.go:151 - TelemetrySpec (reused by the Agent CRD via agent_types.go) only has Enabled + Metrics{Enabled, Port}.
  • internal/controller/agent_controller.go:394 - only emits TELEMETRY_ENABLED.

Notes / limitations (carried from PR #281)

  • The Go ADK exposes a single shared OTLP endpoint, so a manifest pushing traces + metrics to different OTLP endpoints can't be expressed - emit the traces endpoint (adl-cli does the same).
  • The A2A_ prefix is Go-only; the operator deploys Go ADK images, so that's the correct prefix here (the bare OTEL_* form is TypeScript-only).

Acceptance Criteria

  • TelemetrySpec / MetricsSpec in api/v1alpha1 extended with traces.exporter.otlp{endpoint,protocol} and metrics.exporter.{otlp{endpoint,protocol}, prometheus{port}} to match ADL v0.19.0.
  • CRDs + deepcopy regenerated (task manifests generate) -> config/crd/bases/core.inference-gateway.com_agents.yaml, manifests/crds.yaml, zz_generated.deepcopy.go.
  • agent_controller.go env injection emits the Go-ADK A2A_OTEL_* vars, mirroring adl-cli's internal/templates/telemetry_env.go mapping:
    • A2A_OTEL_TRACES_EXPORTER, A2A_OTEL_METRICS_EXPORTER
    • A2A_OTEL_EXPORTER_OTLP_ENDPOINT, A2A_OTEL_EXPORTER_OTLP_PROTOCOL (shared pair - the Go ADK has no per-signal OTLP fields)
    • A2A_OTEL_EXPORTER_PROMETHEUS_PORT
  • Telemetry-enable var name reconciled: the operator emits TELEMETRY_ENABLED, but the Go ADK (per PR [TASK] Bump Go toolchain to 1.26.8 #281) reads A2A_TELEMETRY_ENABLE. Confirm what the agent image actually reads and align.
  • config/samples/core_v1alpha1_agent.yaml + examples/ and controller tests updated.

Follow-up requested in adl-cli PR #281.

Activity

  1. changed the title [-]feat: support OTel-aligned telemetry (traces/metrics exporters) in Agent CRD[/-] [+][FEATURE] support OTel-aligned telemetry (traces/metrics exporters) in Agent CRD[/+] on Jul 15, 2026
  2. moved this to Todo in 2026on Jul 15, 2026
  3. edenreich commented on Jul 15, 2026

    @edenreich
    Contributor

    @claude Can you implement this?

  4. inference-gateway-maintainer commented on Jul 15, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    OTel-aligned telemetry in Agent CRD

    Working on it

    • Read code & adl-cli reference mapping (internal/templates/telemetry_env.go, schema v0.19.0)
    • Extend TelemetrySpec/MetricsSpec with traces.exporter.otlp and metrics.exporter.{otlp,prometheus}
    • Emit A2A_OTEL_* env vars in agent_controller.go
    • Reconcile telemetry-enable var: TELEMETRY_ENABLED → A2A_TELEMETRY_ENABLE (what the Go ADK reads)
    • Regenerate CRDs + deepcopy + manifests/{crds,install}.yaml
    • Update samples/examples + tests
    • Run task fmt vet lint test
    • Commit & open PR

    View job run

  5. moved this from Todo to In progress in 2026on Jul 15, 2026
  6. added a commit that references this issue on Jul 15, 2026
    e784bf8
  7. added a commit that references this issue on Jul 15, 2026
    f28d85c
  8. moved this from In progress to Done in 2026on Jul 15, 2026
  9. inference-gateway-releaser commented on Jul 17, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.18.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions