8000 Add observability integration with CloudWatch Omni · Issue #56 · awslabs/loom · GitHub
[go: up one dir, main page]

Skip to content

Add observability integration with CloudWatch Omni #56

Open

Description

@heeki

Overview

Amazon CloudWatch launched Omni, an AI-powered observability experience for generative AI and agentic workloads, built on an OpenTelemetry-native ingestion path (Introducing Amazon CloudWatch Omni). Instrumentation uses open standards (OpenInference and ADOT); telemetry can be kept local during development and optionally connected to AWS ("Cloud Login") to land in CloudWatch. Once connected, Omni provides a dedicated web experience — Trace Explorer, Session Explorer, Agent Topology, and AI-assisted investigations — separate from the standard CloudWatch console.

Loom already ships every deployed agent with OTLP-based OpenTelemetry instrumentation (opentelemetry-instrument wraps src/handler.py, OTEL_TRACES_EXPORTER=otlp is set today) and Loom's own backend independently parses the resulting spans out of a CloudWatch log stream to power a self-built Trace Explorer (traces.py, TraceGraph.tsx, TraceList.tsx). This issue is about pointing that existing OTLP pipeline at an admin-configured Omni endpoint instead of (or alongside) Loom's own log-parsing path, and surfacing Omni's own dashboard experience rather than continuing to hand-build one.

Open question flagged for implementation: the source blog post does not publish the concrete OTLP ingestion endpoint URL format, auth mechanism (API key vs SigV4 vs IAM role), or a stable per-account "connect to CloudWatch Omni" API/CLI operation — it describes an IDE/dev-tool experience ("Cloud Login") rather than a documented server-to-server integration contract. R3 in particular cannot be implemented until AWS publishes (or support confirms) the actual OTLP endpoint/auth contract for connecting a headless backend service (as opposed to a local IDE) to Omni; treat that as a blocking dependency to resolve before starting R3, not an implementation detail to guess at.

Context

Current State

OTEL instrumentation already in place (backend/app/routers/agents.py)

  • Every agent's runtime env vars already include OTEL_SERVICE_NAME, OTEL_TRACES_EXPORTER=otlp, OTEL_PROPAGATORS=xray,tracecontext,b3 (set at agent-registration time, L1399-1401 and L1763-1765) — there is currently no OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_HEADERS set anywhere, so the OTLP exporter falls back to its default target (the ADOT/X-Ray pipeline AgentCore Runtime wires up automatically)
  • backend/app/services/deployment.py L243 and L429 both hard-code entryPoint: ["opentelemetry-instrument", "src/handler.py"] — the instrumentation wrapper is unconditional today, independent of any Omni configuration

Loom's self-built trace viewer (superseded by this issue's R2)

  • backend/app/services/otel.py — fetch_otel_events, parse_otel_traces, parse_otel_trace_detail parse raw OTEL log records out of the otel-rt-logs CloudWatch stream
  • backend/app/routers/traces.py exposes this via GET /api/traces/..., consumed by frontend/src/hooks/useTraces.ts, frontend/src/api/traces.ts, and rendered in frontend/src/components/TraceGraph.tsx / TraceList.tsx
  • This is a hand-rolled, log-scraping equivalent of exactly what Omni's Trace Explorer/Session Explorer/Agent Topology already provide natively — R2 is about surfacing Omni's dashboard instead of (or in addition to) this path, not rebuilding Omni inside Loom

Existing admin-configuration pattern to mirror (backend/app/routers/settings.py)

  • GET/PUT /api/settings/registry (L332-390) and GET/PUT /api/settings/litellm-proxy (L407-440+) are the established pattern for "admin configures an external service endpoint, Loom validates and persists it, then reconfigures an in-memory client singleton" — RegistryConfigRequest/RegistryConfigResponse and the SiteSetting key/value table (db.query(SiteSetting).filter(SiteSetting.key == ...)) are the model to follow for R1's Omni config, rather than inventing a new persistence mechanism
  • backend/app/services/registry.py's configure_registry()/singleton-client pattern is the template for an equivalent configure_omni() in a new backend/app/services/omni.py

Observability enablement already wired per-resource (backend/app/services/observability.py)

  • enable_runtime_observability, enable_code_interpreter_observability, enable_memory_observability already run automatically at deploy time (called from agents.py L1502-1511, L1330-1338, L2470+) to provision CloudWatch log groups — this is the existing "automatic, no user action needed" pattern R3 should follow for wiring in Omni export

Key Files

  • backend/app/routers/settings.py — RegistryConfigRequest/Response, LitellmProxyConfigRequest/Response (pattern for R1)
  • backend/app/services/registry.py — configure_registry() singleton pattern (pattern for R1)
  • backend/app/routers/agents.py L1399-1401, L1763-1765 — where OTEL env vars are currently set on every agent
  • backend/app/services/deployment.py L182-266 (create_runtime), L374-443 (update_runtime) — where platformVersion-style automatic env var injection would land (see Update Runtime to use v2 #53 for the most recent precedent of adding an automatic runtime-level default here)
  • backend/app/services/otel.py, backend/app/routers/traces.py, frontend/src/components/TraceGraph.tsx, TraceList.tsx, frontend/src/hooks/useTraces.ts — Loom's existing self-built trace viewer, relevant to R2
  • backend/app/models/settings.py (or wherever SiteSetting is defined) — persistence table for admin config

Requirements

R1: Admin configuration for Omni integration

  • Add GET/PUT /api/settings/omni following the RegistryConfigRequest/Response pattern in settings.py: an admin-supplied Omni OTLP endpoint URL, region, and auth credential (API key or IAM role ARN, once AWS publishes which mechanism applies — see the blocking open question above), persisted via SiteSetting (e.g. loom_omni_endpoint, loom_omni_enabled)
  • Gate the settings routes behind require_scopes("settings:read")/require_scopes("settings:write"), matching every other settings sub-resource
  • Add a frontend admin panel (new tab under the existing Settings page, alongside tagging/registry/LiteLLM proxy) for entering and testing the Omni connection, with a "test connection" action before saving, mirroring the UX of the LiteLLM proxy settings panel

R2: Leverage the Omni dashboard experience

  • Once R1's config is saved and enabled, surface a deep link (or embedded iframe, if Omni's web experience supports embedding — verify before committing to this approach) to Omni's own Trace Explorer/Session Explorer for the current agent/session, replacing or supplementing the self-built TraceGraph.tsx/TraceList.tsx views in the agent detail page
  • Do not duplicate Omni's Agent Topology or AI-assisted investigation features in Loom's own UI — link out to Omni for those rather than reimplementing them
  • If Omni's web experience requires its own separate authentication/SSO flow distinct from Loom's Cognito-based auth (the blog post describes "SSO with no AWS console needed" as a separate flow), document that hand-off clearly in the UI rather than assuming a seamless single-sign-on

R3: Automatically export telemetry to the configured Omni endpoint

  • Blocked on the open question above until AWS's actual OTLP ingestion contract for Omni (endpoint format, auth) is confirmed
  • Once confirmed: when R1's Omni config is enabled, automatically set OTEL_EXPORTER_OTLP_ENDPOINT (and OTEL_EXPORTER_OTLP_HEADERS or equivalent auth env var) in the env vars passed to create_runtime/update_runtime (backend/app/services/deployment.py), alongside the existing OTEL_SERVICE_NAME/OTEL_TRACES_EXPORTER vars set in agents.py L1399-1401/L1763-1765 — no per-agent toggle, this should be automatic for every agent once the admin-level Omni config is enabled, mirroring how enable_runtime_observability already runs unconditionally at deploy time
  • Redeploying an existing agent after Omni is newly enabled should pick up the new export target via the existing update_runtime redeploy path (redeploy_agent_endpoint/redeploy_deploy_agent/redeploy_harness_agent in agents.py), with no new parameter threaded through those call sites
  • Add a unit test asserting the OTLP endpoint env vars are present in create_runtime/update_runtime params only when Omni is configured and enabled, and absent otherwise

Activity

  1. self-assigned this
    on Sep 27, 2026
  2. added
    enhancement
    on Sep 27, 2026
  3. added this to the v1.9.0 milestone on Sep 27, 2026
  4. modified the milestones: v1.10.0, v1.11.0 on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0