Repository navigation
Description
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 noOTEL_EXPORTER_OTLP_ENDPOINTorOTEL_EXPORTER_OTLP_HEADERSset 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.pyL243 and L429 both hard-codeentryPoint: ["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_detailparse raw OTEL log records out of theotel-rt-logsCloudWatch streambackend/app/routers/traces.pyexposes this viaGET /api/traces/..., consumed byfrontend/src/hooks/useTraces.ts,frontend/src/api/traces.ts, and rendered infrontend/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) andGET/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/RegistryConfigResponseand theSiteSettingkey/value table (db.query(SiteSetting).filter(SiteSetting.key == ...)) are the model to follow for R1's Omni config, rather than inventing a new persistence mechanismbackend/app/services/registry.py'sconfigure_registry()/singleton-client pattern is the template for an equivalentconfigure_omni()in a newbackend/app/services/omni.py
Observability enablement already wired per-resource (backend/app/services/observability.py)
enable_runtime_observability,enable_code_interpreter_observability,enable_memory_observabilityalready run automatically at deploy time (called fromagents.pyL1502-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.pyL1399-1401, L1763-1765 — where OTEL env vars are currently set on every agentbackend/app/services/deployment.pyL182-266 (create_runtime), L374-443 (update_runtime) — whereplatformVersion-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 R2backend/app/models/settings.py(or whereverSiteSettingis defined) — persistence table for admin config
Requirements
R1: Admin configuration for Omni integration
- Add
GET/PUT /api/settings/omnifollowing theRegistryConfigRequest/Responsepattern insettings.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 viaSiteSetting(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.tsxviews 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(andOTEL_EXPORTER_OTLP_HEADERSor equivalent auth env var) in the env vars passed tocreate_runtime/update_runtime(backend/app/services/deployment.py), alongside the existingOTEL_SERVICE_NAME/OTEL_TRACES_EXPORTERvars set inagents.pyL1399-1401/L1763-1765 — no per-agent toggle, this should be automatic for every agent once the admin-level Omni config is enabled, mirroring howenable_runtime_observabilityalready 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_runtimeredeploy path (redeploy_agent_endpoint/redeploy_deploy_agent/redeploy_harness_agentinagents.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_runtimeparams only when Omni is configured and enabled, and absent otherwise
Activity