Introducing a new way to review your PRs.

Read the announcement

tracer-cloud / opensre

The open-source agent for CI/CD reliability.

View on GitHub

25 documents · Updated Nov 23, 2026

docs / integration-platform

Integration platform

The integration platform connects OpenSRE to external systems through one shared service model. It discovers configured connections, turns them into runtime sources, checks access, and exposes bounded vendor capabilities for investigation or action across observability, infrastructure, communication, work management, coding, hosted gateway services, and external MCP servers.

System role

Integration categories

An integration is a named connection that gives OpenSRE access to a service. The platform supports both evidence gathering and selected external actions while keeping the service identity stable across setup, runtime use, and verification.

CategoryMain purposeExamples
ObservabilityRead logs, metrics, traces, alerts, and issue dataGrafana, Datadog, Sentry, Honeycomb, New Relic
Infrastructure and deliveryInspect resources, databases, clusters, builds, and deploymentsAWS, Kubernetes, Neon, Railway, Vercel
CommunicationReceive requests or send findings to a teamSlack, Discord, Telegram, Twilio
Work managementRead or update incidents and work recordsJira, PagerDuty, ServiceNow, incident.io
Coding and repositoriesInspect code and perform controlled repository workGitHub, GitLab, Bitbucket
Protocol servicesUse tools exposed by a remote protocol serverGitHub MCP, Sentry MCP, PostHog MCP, user-configured MCP servers
Hosted runtimeReach the organization's managed OpenSRE runtimeHosted gateway

One service can serve more than one category. For example, Neon supplies project and storage evidence, while ClickHouse supplies scoped telemetry evidence for incident analysis. See Integration catalog for the service catalog and registry rules.

References: integrations/registry.py• L10-25 integrations/registry.py• L34-462 integrations/alert_source_catalog.py• L26-130 integrations/…/client.py• L132-207 integrations/…/investigation_queries.py• L66-93

Integration contract

Each service has one canonical identity. Aliases and related service members resolve to that identity so discovery, management, runtime access, and verification do not use different names for the same connection.

The registry is the extension boundary. Built-in and external specifications declare identity, aliases, service families, classification, setup support, and verification support. Registration normalizes keys and rejects collisions before lookup tables are rebuilt. This prevents one package from silently taking control of another service's setup or runtime path.

The effective integration view is the shared runtime contract. It contains normalized configuration plus source and optional instance data. Shared flows use this view to decide which tools are available without knowing how a vendor stores credentials or implements its API. External integrations can add their own service key while still using this runtime contract.

References: integrations/registry.py• L464-520 integrations/registry.py• L544-677 integrations/effective_models.py• L12-29

Integration lifecycle

Discovery and runtime resolution

Resolution combines remote account connections, local store records, and environment configuration into the integrations available for a session. Remote records take precedence over local records, and local records take precedence over environment records. Named instances allow one service to represent several accounts or environments, including one configured MCP server per instance.

Environment sources can express several named instances in one record. Older single-instance records are normalized into a default instance before classification, while the flat service view remains for compatibility. Invalid vendor configuration is skipped and reported so one bad service does not hide the others.

The platform keeps startup discovery separate from runtime loading. A fast service-name view can show what appears configured without reading secrets or building full runtime models. Full resolution validates records and classifies them into vendor-ready configurations.

The harness adapter connects this resolution contract to the runtime host. It tracks account and workspace generations, so a new web-app connection or a change in member access causes the next session turn to resolve fresh data. This prevents one member's grants from carrying into another member's turn when they share a session.

The flow below shows how connection sources become the tool view used by a session.

flowchart LR
    A[Session or scheduled task] --> B[Read remote, local, and environment sources]
    B --> C[Apply scope and precedence]
    C --> D[Normalize service and instance records]
    D --> E[Build effective integration view]
    E --> F[Expose matching tools]

The multi-instance and source rules are described in Integration catalog.

References: integrations/_catalog_impl.py• L397-479 integrations/_catalog_impl.py• L566-634 integrations/_catalog_impl.py• L1912-2021 integrations/_catalog_impl.py• L2070-2107 integrations/effective_models.py• L12-29 integrations/harness_adapters.py• L35-55 integrations/harness_adapters.py• L75-106

Runtime access

The effective view controls which vendor tools OpenSRE can offer. Tool calls receive the resolved connection and return a common result shape with service availability and bounded evidence. The vendor client handles service-specific requests behind that boundary. This lets an investigation combine evidence from several services without carrying vendor-specific connection rules between tools.

Neon provides read-only project, branch, compute, operation, and object-storage diagnostics. ClickHouse provides fixed, bounded evidence operations over pinned incident windows. These operations return scoped results with status, limits, and evidence references rather than unrestricted source data.

AWS tools extend the same evidence model across cloud logs, change history, resource topology, and managed Kubernetes. CloudWatch log access searches a named log group or a selected stream, CloudTrail exposes bounded change events, and EC2 results group active instances by application tier. EKS tools cover cluster discovery, control-plane and node health, add-ons, namespaces, deployments, pod logs, and warning events.

References: integrations/…/client.py• L76-207 integrations/…/README.md• L3-13 integrations/…/investigation_queries.py• L108-147 integrations/…/investigation_queries.py• L149-344 integrations/…/__init__.py• L18-123 integrations/…/client.py• L36-197 integrations/…/cloudwatch_client.py• L28-181 integrations/…/tool.py• L34-164 integrations/…/__init__.py• L174-338 integrations/…/__init__.py• L58-197 integrations/…/__init__.py• L20-86 integrations/…/__init__.py• L40-140

Repository scope

Repository scope is the target that limits a repository tool call to one project. The platform derives it from explicit references first, then recent conversation or saved context, and finally from workspace or Git metadata. GitHub can confirm short names against repositories the connection can reach, while GitLab accepts project URLs and qualifiers for public or configured self-hosted hosts.

The scope then becomes part of the resolved vendor source. GitHub tools require an authorized app connection rather than ambient credentials. Their result envelope distinguishes a missing connection from a repository that the connection cannot reach, so a failed lookup does not look like a service outage.

The repository flow moves from user text to a bounded vendor target and then to a normalized tool result.

flowchart LR
    A[User request or workspace context] --> B[Infer repository scope]
    B --> C[Confirm reachable target when needed]
    C --> D[Attach scope and authorized connection]
    D --> E[Run repository tool]
    E --> F[Return available, unavailable, or no-match result]

References: integrations/…/repo_scope.py• L99-161 integrations/…/repo_scope.py• L223-372 integrations/…/accessible_repos.py• L67-131 integrations/…/agent_tools.py• L15-85 integrations/…/envelope.py• L37-123 integrations/…/repo_scope.py• L62-169 integrations/…/repo_scope.py• L201-260

Kubernetes investigation

The Kubernetes integration provides read-only cluster evidence for incident work. It supports a kubeconfig file or inline configuration, a selected context, and a default namespace with optional additional namespaces.

The tool set covers cluster and workload views. Engineers can list pods, deployments, StatefulSets, DaemonSets, services, ingresses, ConfigMaps, and nodes. They can then inspect one pod or resource, read recent pod logs, and review namespace events. AWS EKS adds account-level cluster discovery and managed-resource health. List results are limited, pod environment values are redacted, and namespace-scoped calls are denied outside the configured allowlist.

The investigation path moves from broad health data to focused evidence.

flowchart LR
    A[Configured cluster] --> B[Check namespace or cluster scope]
    B --> C[List workloads or cluster resources]
    C --> D[Inspect a named pod or resource]
    D --> E[Read logs and events]

References: integrations/…/setup.py• L1-93 integrations/…/__init__.py• L1-79 integrations/…/_namespace_allowlist.py• L12-35 integrations/…/tool.py• L17-122 integrations/…/tool.py• L17-141 integrations/…/__init__.py• L20-86 integrations/…/__init__.py• L18-116 integrations/…/__init__.py• L31-128

Setup and credential flow

Setup gives users several entry points while preserving one connection contract. The onboarding wizard, integration CLI, and interactive actions collect values, then pass them to the shared setup flow for validation, verification, and persistence.

The resulting connection can span the integration store, protected secret storage, and project environment values. A setup mode can select one valid configuration path and clear fields from other paths. A failed verification is not saved. GitHub may use an app handoff rather than collecting a token in the local prompt. Named MCP server setup is store-only and updates one server while keeping the other server instances.

For credential tiers, setup modes, persistence, and hosted account setup, see Integration setup and credentials. For named MCP server setup, see MCP server integrations.

References: integrations/cli.py• L286-377 integrations/cli.py• L420-435 integrations/cli.py• L595-627 integrations/setup_flow.py• L1-29 integrations/setup_flow.py• L94-280 integrations/harness_adapters.py• L9-18 integrations/…/setup.py• L80-149

Verification and health

Verification checks whether a configured connection can reach its service and perform the access OpenSRE needs. It is the main definition of usable access after setup. Startup health is lighter. It reports obvious missing pieces without network calls so the application can start quickly.

The result of verification controls tool availability and command status. A service can therefore be present in the catalog but unavailable to tools when its required credential is missing or its live probe fails. MCP verification lists the tools that one server exposes under its current allowlist and read-only policy, and the platform can report each named server separately. See Integration verification for probe registration, result states, and command outcomes.

References: integrations/registry.py• L10-31 integrations/registry.py• L589-611 integrations/catalog.py• L305-385 integrations/verify.py• L146-216 integrations/…/verifier.py• L20-47 integrations/…/discovery.py• L79-159

Alert-source routing

Alert-source routing connects an alert's service label and words to tool sources that can add useful context. Relevance aliases identify related services, while seed lists control which sources enter planning before the model chooses further tools.

The routing table keeps these two decisions distinct. For example, a Neon alert can seed Neon and PostgreSQL tools, while an ArgoCD alert can seed Kubernetes and EKS context. This gives investigations a useful starting set without treating every related service as equally relevant.

The harness installs detectors, routing aliases, and seed sources as one explicit startup contract. It also installs parsers for incident anchors, such as incident-start times, so integrations can pass reliable time context into later investigation work.

References: integrations/alert_source_catalog.py• L26-72 integrations/alert_source_catalog.py• L74-130 integrations/harness_adapters.py• L200-237

Scheduled work and delivery

Integrations extend beyond interactive sessions into scheduled reports, watches, sweeps, and recurring skills. A source-keyed runner selects the headless task and declares whether that task uses a model turn, which lets the scheduler account for deterministic reports separately from model work.

Scheduled delivery then maps each communication provider to its delivery adapter. The scheduler uses this bundle instead of importing vendor packages directly, so provider-specific delivery stays within the integration layer while the scheduler keeps a stable host-facing interface.

The scheduled flow moves from a task source to a provider-specific result and then to a delivery channel.

flowchart LR
    A[Scheduled payload] --> B[Source-keyed runner]
    B --> C[Report or task result]
    C --> D[Provider delivery adapter]
    D --> E[Slack, Telegram, Discord, Rocket.Chat, email, or shell]

References: integrations/scheduled_agent_bootstrap.py• L47-89 integrations/scheduled_delivery.py• L1-48

Extensibility model

Vendor boundaries

Each vendor integration owns the connection model, client behavior, verifier, setup declaration, and tool surface for that service. Shared OpenSRE flows consume registered metadata and normalized sources instead of importing vendor behavior directly. External packages can join this boundary through the same registry without changing the shared flows.

This boundary keeps new service support additive. A vendor can add a classifier and tools for a new read path without adding a new investigation loop. The registry then makes the service visible to catalog, setup, verification, and runtime selection paths.

The harness is the host-facing assembly point for these extensions. It installs provider adapters, alert routing, prompt fragments, repository scopes, runbook sources, and prerequisite checks in one boot step. Vendor modules remain responsible for their behavior. The harness defines which extensions the running host can use.

References: integrations/registry.py• L10-25 integrations/registry.py• L464-499 integrations/registry.py• L614-677 integrations/_catalog_impl.py• L482-563 integrations/harness_adapters.py• L75-123

External MCP server connectivity

An external MCP server is a user-configured source of tools that OpenSRE can add to a session. Each named server uses either an HTTP endpoint or a local stdio command, keeps authentication in its connection settings, and can restrict which advertised tools are exposed.

OpenSRE discovers the server's tools before it builds the turn's tool list. It filters the list by the server allowlist and read-only setting, preserves the server's input contract, and gives each exposed tool a namespaced name. A read-only hint keeps a tool in the read path; other tools use the normal external-action approval boundary.

Discovery is bounded and cached per server. A slow or failed server contributes no tools for the current pass rather than blocking all other integrations. Each call returns a normalized result with text, structured content, and an explicit error state when the remote tool fails.

The MCP path moves from a named connection to discovered tools and then to a gated agent call.

flowchart LR
    A[Named MCP server] --> B[Validate transport and credentials]
    B --> C[Discover advertised tools]
    C --> D[Apply allowlist and read-only policy]
    D --> E[Bridge typed tools into the session]
    E --> F[Call remote tool with bounded result]

For the server configuration, discovery, and runtime rules, see MCP server integrations.

References: integrations/…/config.py• L35-131 integrations/…/setup.py• L80-149 integrations/…/discovery.py• L35-63 integrations/…/discovery.py• L79-159 integrations/…/bridge.py• L39-120 integrations/…/schema.py• L99-112 integrations/mcp_client.py• L65-151 integrations/mcp_client.py• L180-286 integrations/harness_adapters.py• L75-106

Hosted gateway connectivity

The hosted gateway connects an account-scoped OpenSRE session to an organization's managed runtime. The client uses the signed-in account scope and keeps organization selection outside the local tool call.

Gateway operations cover runtime health, lifecycle, prompts, cancellation, and synchronization with hosted scheduled work. Results distinguish authentication, authorization, transport, capacity, prerequisite, and response-shape failures so users can fix the right connection or account. See Hosted gateway integration for the full remote state and request flow.

References: integrations/…/client.py• L32-101 integrations/…/client.py• L128-415 integrations/…/results.py• L35-136

Tool safety boundaries

The integration layer limits the effect of external actions at the tool boundary. Read-only operations are marked separately from mutating operations. Credentials are injected from the resolved source, and clients validate resource identifiers before placing them in service paths.

Neon illustrates this boundary for a read-only control-plane client. It accepts only bounded project, branch, and bucket identifiers, limits error detail, redacts tokens, and turns access failures into probe results. ClickHouse illustrates it for evidence reads. It pins service, environment, and time windows so callers cannot widen the query through operation arguments.

GitHub CLI access applies the same pattern to a command-capable integration. OpenSRE supplies scoped credentials, blocks credential and host-configuration commands, caps output, redacts accidental token echoes, and rejects cut JSON results. The tool can still support repository, issue, and pull-request work without giving the subprocess unrestricted credential control.

External MCP servers apply the same boundary to remote tools. The server configuration can allow only selected tools or only read-only tools, advertised non-read-only tools use the external-action approval level, and authentication values stay out of tool arguments. Transport and tool calls have time limits so one remote server cannot hold a turn indefinitely.

References: integrations/…/client.py• L21-73 integrations/…/client.py• L106-130 integrations/…/investigation_queries.py• L36-57 integrations/…/runner.py• L23-47 integrations/…/runner.py• L169-300 integrations/…/config.py• L114-131 integrations/…/bridge.py• L105-120 integrations/mcp_client.py• L84-149 integrations/mcp_client.py• L246-286

Change checklist

When these files or sections are changed, remember to consider these:

  • A service name must remain aligned across registry identity, aliases, catalog classification, setup, verification, tool sources, and alert routing.
  • A new external registry entry must use unique service, alias, and family keys so runtime lookup cannot change silently.
  • A new integration must provide the same normalized source contract to startup discovery, full resolution, tool availability, and verification.
  • A setup change must keep collected fields, secret tiers, environment values, store records, verifier rules, and runtime classification consistent.
  • A new tool must preserve injected credential scope, side-effect labeling, bounded output, evidence mapping, and unavailable-result behavior.
  • AWS, CloudWatch, CloudTrail, EC2, and EKS tools must keep resource scope, read-only labels, result caps, evidence mapping, and unavailable-result behavior aligned with their source contracts.
  • A telemetry evidence change must preserve pinned service, environment, and window scope, typed result status, truncation signals, and redaction limits.
  • A multi-instance change must preserve default-instance compatibility and family-level instance selection.
  • Environment instance parsing must preserve the v1 single-instance shape, v2 named-instance shape, and safe fallback when JSON is invalid.
  • An MCP server change must keep transport validation, named-instance selection, tool discovery, schema bridging, allowlists, read-only policy, and tool-call result handling aligned.
  • A hosted gateway change must preserve account scope, stable failure categories, request identity, and safe retry behavior.
  • Alert routing changes must keep relevance aliases separate from pre-investigation seed sources.
  • A scheduled task source must remain mapped to both its runner and its model-turn cost rule.
  • A scheduled delivery provider must remain mapped to an adapter that matches the scheduler's provider contract.
  • A harness adapter change must preserve lazy loading and generation-based invalidation where connection or member scope can change during a session.
  • GitHub scope inference must keep explicit repository references ahead of history, workspace defaults, and accessible-name guesses. GitLab scope parsing must keep configured self-hosted hosts within the same boundary.
  • GitHub tool discovery and execution must continue to require the authorized app connection and preserve the missing-connection and no-match result envelopes.
  • Kubernetes and EKS setup, classification, and tools must keep connection source selection, namespace behavior, resource scope, and AWS credential handoff aligned.

Important failure modes

TriggerConsequenceGuard
A plugin claims a built-in service, alias, or family keySetup or runtime lookup can route to the wrong integrationRegistry normalization and collision checks reject the registration
Remote, local, and environment records disagreeDifferent entry points can use different credentialsResolution applies fixed remote-over-local-over-environment precedence
A stored service has only part of its required configurationThe service appears connected but its tools cannot workStartup health marks obvious incomplete records and live verification checks access
A vendor classifier fails while loading environment valuesOther configured integrations disappear from discoveryThe loader reports the failure and skips only the invalid vendor record
An instance environment variable is invalid JSONThe intended multi-instance connection is ignored or can fall back to legacy valuesThe parser logs only safe position data and falls back without exposing the raw value
A tool receives an unbounded service responseThe model gets incomplete or unusable evidenceVendor tools cap results, report truncation, or require pagination
A telemetry reader receives an invalid scope, identifier, or limitThe query can cross an intended boundary or fail after partial workInput validation rejects the request before source access
A telemetry result is mistaken for complete evidenceAn investigation can infer absence from sampled, late, or out-of-window dataTyped results expose scope, truncation, and limitations
A model-supplied identifier adds path traversal or an extra path segmentThe client can request an unintended resourceClient path validation accepts only bounded identifier forms
GitHub work starts without an authorized app connectionThe operation could use an ambient token or produce an unsafe retry loopDiscovery and execution require the app token and return a stop envelope with setup guidance
GitHub answers 404 for a repository outside the connectionA valid connection can be mistaken for an outageThe result marks no-match and can list reachable repositories instead of asking for reconnection
GitHub CLI runs a credential, extension, or repository-mutating command outside policyA token or repository state can be exposed or changed unexpectedlyThe runner blocks denied commands, injects scoped auth, caps output, and redacts tokens
A cut JSON response is treated as completeAn action can rely on missing recordsThe GitHub runner rejects truncated JSON and asks the caller to narrow the query
Alert routing seeds every related source equallyInvestigation context becomes noisy or targets an unrelated serviceRouting keeps relevance aliases and seed lists as separate contracts
A scheduled source has no registered runnerThe scheduler rejects the task instead of producing a reportThe source-to-runner registry fails clearly when a mapping is missing
A scheduled delivery provider has no adapterA scheduled result cannot reach its selected channelThe installed delivery bundle provides one adapter for each supported provider
Account or member scope changes without a generation updateA session can reuse stale integrations or another member's grantsResolution generations invalidate the cache on account, workspace, or member changes
A Kubernetes request names a namespace outside the configured allowlistThe cluster call is blocked even when the kubeconfig is validEvery namespace-scoped tool checks the effective allowlist before access
A Kubernetes or EKS connection lacks its required config or AWS accessCluster tools report unavailable instead of evidenceSetup and runtime classification require the selected connection source and credentials
An MCP server has neither a valid HTTP URL nor a stdio commandThe server is skipped and contributes no toolsTransport validation requires the fields for the selected mode
MCP discovery times out or the server fails to list toolsThat server has no tools for the pass, while other servers can still loadDiscovery uses per-server bounds, a pass-wide wait, and short failure caching
Two MCP instances use the same server nameOne server's tools could be paired with another server's connectionConfiguration order is kept and later duplicate names are skipped
An MCP server advertises a tool outside its allowlist or read-only policyThe tool becomes available with broader access than the user selectedDiscovery filters by allowed names and the read-only gate before bridging
An MCP input schema contains local references that a model provider cannot readThe bridged tool can receive an incomplete argument contractThe bridge inlines bounded local schema references before registration
CloudWatch, CloudTrail, EC2, or EKS pagination stops before all records are returnedAn investigation can mistake partial evidence for a complete cloud viewResults expose truncation where supported and apply a safety cap

Key files

FileWhy to read it
integrations/registry.pyDefines canonical service identity, aliases, families, setup and verification support, and external registration.
integrations/catalog.pyProvides the public discovery, service-name, health, and effective-resolution facade.
integrations/_catalog_impl.pyShows how store, environment, remote, legacy, and multi-instance records become normalized service and instance sources.
integrations/effective_models.pyDefines the effective runtime entry and its source metadata.
integrations/harness_adapters.pyAssembles integration resolution, host adapters, alert routing, and runtime extension points.
integrations/cli.pyShows the user-facing setup, list, show, remove, and verify lifecycle.
integrations/setup_flow.pyDefines the shared setup contract used by the wizard, CLI, and interactive actions.
integrations/store.pyDefines the local multi-instance credential store and compatibility migration.
integrations/verify.pyRuns service and named-instance verification and maps results to command status.
integrations/…/cloudwatch_client.pyIllustrates AWS metric and log access through the shared AWS client.
integrations/…/tool.pyIllustrates bounded CloudWatch log investigation.
integrations/…/__init__.pyIllustrates bounded AWS change forensics and truncation-aware evidence.
integrations/…/__init__.pyIllustrates cloud topology discovery grouped by application tier.
integrations/…/__init__.pyIllustrates EKS account-level cluster discovery.
integrations/…/__init__.pyIllustrates EKS workload health and degraded deployment reporting.
integrations/…/__init__.pyIllustrates focused EKS pod evidence.
integrations/mcp_client.pyDefines shared MCP transports, sessions, tool listing, calls, and result normalization.
integrations/…/config.pyDefines one user-configured MCP server and its transport, credential, and exposure rules.
integrations/…/setup.pyDefines named MCP server setup modes and update behavior.
integrations/…/discovery.pyDefines bounded, cached discovery for server-advertised tools.
integrations/…/bridge.pyTurns discovered MCP tools into typed, namespaced agent tools with side-effect gates.
integrations/…/schema.pyMakes local MCP input schemas usable across model provider routes.
integrations/…/client.pyDefines account-scoped hosted runtime access and gateway failure behavior.