Telemetry ingestion and monitoring
Telemetry ingestion and monitoring turns application signals, runtime output, product events, scheduled job results, and health checks into data that engineers can inspect and act on. The system accepts OpenTelemetry data, collects logs and metrics, checks service and job health, evaluates alert rules, and sends notifications while keeping each data path scoped to its owner. See Observability and analytics for the wider observability model, Analytics products for product-facing analytics, and Status pages for public service status.
Telemetry signal model
The observability path treats metrics, traces, logs, and product events as related signals with different uses. Project, environment, deployment, service, source, and time context let an operator move from a broad health view to one operation or event.
| Signal | Main question | Main downstream use |
|---|---|---|
| Metrics | How is a resource or operation behaving over time? | Charts, aggregation, and threshold alerts |
| Traces | Which operations made up a request? | Trace search, timing, and service correlation |
| Logs | What did a service report while it ran? | Search, severity filtering, and trace links |
| Product events | Which product or instance action occurred? | Adoption, deployment, and product health views |
The write and read paths have different trust boundaries. Workloads use project, deployment, or service credentials to send telemetry. Operators use the authenticated application path to query data, and project access rules limit what they can read.
References: crates/…/plugin.rs• L343-517 crates/…/query_handler.rs• L422-492 crates/…/global_traces.rs• L139-242
OpenTelemetry ingestion
OpenTelemetry Protocol (OTLP) is the main application telemetry interface. The API accepts metrics, traces, and logs over OTLP/HTTP at routes such as /otel/v1/metrics, with optional project, environment, and deployment context.
When an exporter sends a batch, the ingest path authenticates the owner, checks rate and storage limits, decodes the payload, and sends each signal to its storage path. Bounded permits and queues keep exporter retry storms from exhausting the server. Cloud-primary data first reaches a durable local handoff before background shipping.
This diagram shows the common path from an exporter to signal storage and later queries.
flowchart LR
E[OTel exporter] --> H[OTLP HTTP endpoint]
H --> A[Authenticate owner]
A --> G[Rate and quota checks]
G --> D[Decode batch]
D --> S{Signal}
S --> M[Metrics]
S --> T[Traces]
S --> L[Logs]
M --> Q[Queries and alerts]
T --> Q
L --> Q
References: crates/…/mod.rs• L27-104 crates/…/otel_service.rs• L421-513 crates/…/otel_service.rs• L557-701 crates/…/otel_service.rs• L753-1027 crates/…/plugin.rs• L896-939
Metrics ingestion
Metrics ingestion stores numeric and distribution observations for applications, deployments, services, nodes, and containers. The query path can filter labels, group series, and aggregate points over time. Cumulative values keep their source meaning so the read path does not apply counter logic twice.
Metrics can remain local or use a linked Temps Cloud service as the primary store. Each point follows the policy for its project, and Cloud-primary points use a durable local handoff before shipping.
References: crates/…/otel_service.rs• L557-735 crates/…/query_handler.rs• L422-492 crates/…/mod.rs• L511-710
Trace ingestion
Trace ingestion stores the spans received from client SDKs and preserves trace and span relationships. The UI uses those relationships to show request trees, operation timing, errors, service links, and logs related to a trace.
Spans can also create a small local discovery reference for cross-project lookup. A Cloud-primary span is accepted only after its durable handoff is recorded. Client sampling decides which spans arrive; the server does not recreate spans that were sampled out.
References: crates/…/otel_service.rs• L753-970 crates/…/plugin.rs• L911-941 crates/…/mod.rs• L277-292
Cross-project traces
Cross-project trace support joins spans that share a trace ID across projects. A local trace reference records which projects saw the trace. The read path then applies project access and sharing consent before it builds a shared waterfall.
The result marks private spans as redacted and reports truncation when a trace is too large. This lets engineers follow one request across service boundaries without making private project data visible.
References: crates/…/cross_project.rs• L207-225 crates/…/cross_project.rs• L328-412 crates/…/query_handler.rs• L716-896
Log ingestion
OTLP log ingestion serves hot search and optional archive retention. Every accepted record enters the query store for search and trace correlation. When archival storage is configured, the same record also goes to the archive path.
Archive delivery is separate from the hot write. A cold-storage outage can remove the archive copy without preventing recent log search.
References: crates/…/otel_service.rs• L972-1027 crates/…/timescaledb.rs• L840-877 crates/…/mod.rs• L140-155
Cloud telemetry routing
A linked Temps Cloud service can become the primary store for project spans or analytics metrics. Span routing and metric routing are independent, so a project can change one without changing the other.
Cloud routing records source intervals and cutovers. Reads use those intervals to select the correct local or Cloud source and report the effective window. A Cloud read failure is returned as an error rather than as an empty result that could look like missing telemetry.
References: crates/…/cloud_routed.rs• L31-54 crates/…/cloud_routed.rs• L390-511 crates/…/cloud_routed.rs• L615-753 crates/…/global_traces.rs• L40-90
Event collection
The telemetry API collects anonymous product events about instance life cycle, deployment progress, project setup, and observability use. These events describe product behavior rather than individual application requests.
An event may be sent alone or in a bounded batch. The API validates the event name, checks the anonymous instance ID, normalizes the event time, removes common sensitive property keys, and stores a compact activity record for later active-instance queries.
References: telemetry-api/…/index.ts• L23-64 telemetry-api/…/events.ts• L7-18 telemetry-api/…/events.ts• L107-188 telemetry-api/…/001_create_telemetry_tables.sql• L4-43
Anonymous product telemetry
The instance reporter is the outbound side of product event collection. Feature code uses a shared reporter contract, while the telemetry plugin supplies the concrete reporter and registers it for the server. If the reporter cannot start, the server continues with a no-op reporter and reports telemetry as unavailable.
Each installation uses a stable random instance ID. Local installations keep it in the data directory. Stateless control planes use a random ID stored in PostgreSQL so replicas share one identity. Events carry a known event name, a small set of non-identifying properties, and the running Temps version.
The effective state uses three inputs in order: TEMPS_TELEMETRY=0, false, off, no, or disabled forces telemetry off; otherwise the stored admin preference applies; otherwise the built-in default applies. Normal sends run in the background with a short timeout. First-touch milestones use a durable database claim when available, so one milestone is not emitted again after a restart or by another replica.
This diagram shows the boundary between a running instance and the central event API.
flowchart LR
F[Feature event] --> R[Telemetry reporter]
O[Telemetry setting] --> R
R --> I[Stable anonymous identity]
R --> P[Privacy-safe payload]
P --> Q[Background timed send]
Q --> A[Central event API]
R --> D[Durable milestone claim]
References: crates/…/telemetry.rs• L4-25 crates/…/telemetry.rs• L27-129 crates/…/plugin.rs• L49-117 crates/…/service.rs• L47-75 crates/…/service.rs• L107-190 crates/…/service.rs• L316-423 crates/…/service.rs• L426-508 crates/…/settings.rs• L6-19
Telemetry settings API
The telemetry settings API gives operators a clear view of the current consent state and controls the stored admin preference. GET /settings/telemetry requires settings-read access and returns the effective state, its source, the environment kill-switch status, the event catalog, the endpoint host, the anonymous ID, and the privacy documentation link.
PATCH /settings/telemetry is limited to instance administrators. It saves the preference, changes the local reporter without a restart, and records an audit event. Other processes refresh the shared preference on a short interval. A reporter that failed to initialize is shown as unavailable rather than enabled.
References: crates/…/handlers.rs• L30-85 crates/…/handlers.rs• L184-287 crates/…/settings.rs• L32-49 crates/…/settings.rs• L108-155 crates/…/settings.rs• L157-267
Log aggregation
Log aggregation combines deployment output, worker-node output, imported service output, and OTLP log records. Collectors parse each line into a shared record and send it through common live-tail and storage paths with project, service, node, and deployment context.
Collected runtime logs use immutable compressed chunks. A manifest describes each chunk and its time range. The writer protects the active window with a write-ahead log, so a restart can recover lines that were not yet committed.
References: crates/…/collector.rs• L104-183 crates/…/collector.rs• L437-707 crates/…/remote_collector.rs• L11-15 crates/…/chunk_writer.rs• L89-117 crates/…/chunk_writer.rs• L419-508
Log parsing and search
Log parsing turns JSON, logfmt, and plain text into bounded records. It keeps useful severity, message, request, HTTP, duration, and trace fields so runtime logs can join observability views without allowing one line to grow the index without bound.
Search plans from chunk metadata, then reads only candidate chunks and blocks. Time, level, text, and attribute filters narrow the work. A bounded search can return a partial page with a continuation cursor instead of holding a shared resource without limit.
References: crates/…/parser.rs• L187-273 crates/…/parser.rs• L384-655 crates/…/chunk_store.rs• L517-705 crates/…/chunk_store.rs• L825-967
Log exploration
The project log view turns the search path into a focused investigation tool. Operators can filter by time, severity, service, and message text, then expand a record to inspect context and follow its trace when one exists.
A trace-pinned log search uses the trace ID as the main scope and does not discard matching records because of the selected time range. Filters and the current page remain in the URL so an investigation can be refreshed or shared.
References: web/…/LogsList.tsx• L84-179 web/…/LogsList.tsx• L219-245 web/…/LogsList.tsx• L247-291 web/…/LogsList.tsx• L313-420
Log analytics and lifecycle
Log analytics adds attribute keys, facets, histograms, grouped counts, and pointer search to the chunk path. The derived line index narrows queries but does not replace the chunk data that remains the source of message content.
Retention removes old chunks from normal reads before later garbage collection removes their objects. Compaction merges small chunks. Reindex and forget workers keep derived rows aligned with chunk creation, retention, and deletion.
References: crates/…/analytics.rs• L4-17 crates/…/analytics.rs• L164-224 crates/…/compactor.rs• L409-573 crates/…/retention.rs• L77-141 crates/…/forget_sweeper.rs• L4-20
Metrics collection
Metrics collection covers pushed application data, pulled infrastructure data, and sampled deployment-container data. External service collectors, host samplers, and container health checks provide the data used by monitoring pages and alert rules. Container checks can write CPU, memory, and network metrics without making alarm evaluation depend on the metrics store.
The host view can cover CPU, memory, disk, load, file descriptors, block I/O, and network I/O. Container CPU alarms use utilization against the container limit or host capacity, while raw CPU values remain available for core-use views. Container network values are emitted as per-poll byte deltas, including safe handling for counter resets. A missing source affects that series or cycle, not the whole sampling loop. Worker checks use the worker's own runtime and skip that worker when it cannot be resolved or checked within its time bound.
References: crates/…/node.rs• L11-64 crates/…/node.rs• L115-166 crates/…/container_health.rs• L328-347 crates/…/container_health.rs• L446-600 crates/…/container_health.rs• L629-697 crates/…/container_health.rs• L1262-1537 web/…/ServerMonitoring.tsx• L430-689
Metric views
Metric views show time-bucketed values for one metric or for grouped label series. A tile reuses the same query and value rules as the metric explorer, marks the exact metric and aggregation when an alert is active, and shows a latest value or a bounded set of grouped series.
Anomaly bands apply to one aggregate metric. Grouped views omit the band rather than attach one aggregate expectation to the wrong series. A tile also shows when more grouped series exist than the view displays.
References: web/…/MetricTile.tsx• L61-71 web/…/MetricTile.tsx• L84-164 web/…/MetricTile.tsx• L166-260
Monitoring and health
Monitoring turns metrics, traces, logs, status checks, scheduled job results, and telemetry pipeline signals into operator views. The query surface supports metric ranges, label discovery, trace lists and summaries, operation statistics, log search, health summaries, ingest statistics, and recent ingest errors.
Project views focus on one project's runtime. Global views apply authorization before they combine projects. Server monitoring makes missing or stale collection visible instead of treating an empty chart as healthy. Pipeline statistics distinguish received, stored, dropped, rate-limited, quota-limited, and relay-dropped data.
References: crates/…/query_handler.rs• L486-673 crates/…/query_handler.rs• L759-1062 crates/…/mod.rs• L157-193 web/…/GlobalPage.tsx• L81-225 web/…/GlobalLogs.tsx• L21-100
Trace exploration
The trace view helps an operator find a request and move from a summary to its spans, operations, and related logs. It supports time, service, status, environment, deployment, span-name, trace-ID, sort, and registered-attribute filters while keeping the query state in the URL.
The view separates “no traces in this window” from “this project has never received a trace.” Its setup guide provides framework-specific OpenTelemetry instructions and checks for the first received trace. A Cloud-primary backlog banner makes delayed or missing handoff data visible instead of presenting it as application silence.
References: web/…/TracesList.tsx• L710-955 web/…/TracesList.tsx• L969-1087 web/…/TracesList.tsx• L1090-1235
Alert evaluation
The alert evaluator checks enabled metric rules on a repeating cycle. It groups rules by metric source, reads the latest values for that source, compares each value with its threshold, and tracks how long a breach lasts before firing an alarm. Built-in ratio and percentile rules use a volume gate so low-traffic data does not create noise.
An in-progress breach window is stored so a restart can resume a recent, enabled, unsilenced breach. The evaluator rejects future or stale windows and clears windows for rules that are disabled, silenced, or no longer evaluated. Active alarms are restored at startup so the evaluator does not create duplicate alarms. Startup also back-seeds missing service rules and seeds control-plane proxy, OTel rejection, and node resource rules.
Alarm cooldown and silence use the alert rule identity when an alarm came from a rule. That identity includes the rule source and dynamic series when needed, so one rule or series does not suppress another rule that happens to share its alarm type and scope. Cron failure alarms add the monitor identity to this scope, so one scheduled job does not suppress another job's alarm. Runtime health alarms also validate the live assignment and coordinator before they enter the same alarm and notification path.
Alarms can be scoped to a project, deployment, container, service, or the control plane. The alarm service applies cooldowns to the full scope, so one service does not suppress another service's alarm. Operators can acknowledge or resolve one alarm or a bounded bulk set. Bulk resolution emits integration jobs without sending a recovery message for every cleared row.
The alarm lifecycle separates detection from operator action:
| State | Meaning |
|---|---|
| Firing | The condition crossed its threshold for the required duration. |
| Acknowledged | An operator saw the alarm, but the condition remains unresolved. |
| Resolved | The condition returned to the safe side or an operator resolved it. |
| Silenced | The status remains, but matching re-fires are muted until a chosen time. |
References: crates/…/evaluator.rs• L211-309 crates/…/evaluator.rs• L370-575 crates/…/evaluator.rs• L619-721 crates/…/evaluator.rs• L824-1081 crates/…/alarm_service.rs• L287-373 crates/…/alarm_service.rs• L584-661 crates/…/alarm_service.rs• L989-1189 crates/…/alarm_service.rs• L1406-1466
Alert rule exploration
The metric explorer helps an operator decide whether an alert rule matches real behavior. An anomaly backtest replays the same expected band used by evaluation over recent history, reports whether the rule would have fired, and distinguishes one sustained shift from several separate breach episodes.
AI alert suggestions query the project’s real metrics and existing rules before proposing a change. Each proposal remains a reviewable action until the operator confirms it. The entry point checks whether an AI provider is configured and sends the operator to setup when it is not.
References: web/…/AnomalyBacktest.tsx• L46-105 web/…/AnomalyBacktest.tsx• L137-242 web/…/SuggestAlertsButton.tsx• L54-160 web/…/suggest-alerts-state.ts• L4-18
Alarm API
The alarms API gives project operators and system administrators one read and action surface for alarm history. It supports filtered, paginated lists and summaries, single-alarm acknowledge, resolve, silence, and unsilence actions, plus bounded bulk acknowledge or resolve operations.
Project routes require project access and deployment permissions. System routes require system-admin access. Mutating requests record audit events, while bulk responses report changed, skipped, and remaining alarms so a large backlog can be handled in more than one bounded request.
References: crates/…/alarm_handlers.rs• L523-615 crates/…/alarm_handlers.rs• L617-850 crates/…/alarm_handlers.rs• L894-927 crates/…/alarm_handlers.rs• L936-1252 crates/…/alarm_service.rs• L989-1189
Scheduled job monitoring
Scheduled job monitoring tracks work that runs outside a request and reports whether each expected run starts, finishes, or misses its deadline. A monitor belongs to a project and optional environment, accepts SDK check-ins, and uses a schedule, check-in margin, maximum runtime, and failure and recovery thresholds to turn run history into health state.
The monitoring service is shared with the alarm service and runs its deadline and alarm passes in the background. Management routes let authorized project operators create, inspect, update, pause, resume, and delete monitors, while run history remains available for diagnosis.
This diagram shows how a scheduled job check-in becomes health state and, when needed, an alarm.
flowchart LR
J[Scheduled job] --> C[Check-in]
C --> I[Monitor state and run history]
I --> D[Deadline and missed-run checks]
D --> S{Health state}
S --> O[Healthy or unknown]
S --> F[Failing]
F --> A[Cron failure alarm]
A --> N[Existing notification paths]
References: crates/…/cron_monitors.rs• L4-8 crates/…/cron_monitors.rs• L305-335 crates/…/cron_monitors.rs• L597-729 crates/…/plugin.rs• L78-105
Cron monitor configuration
A cron monitor defines when a job is expected and how much delay or run time is acceptable. Schedules support crontab expressions and fixed intervals with a named time zone. A monitor can be configured by the SDK until an operator edits it in Temps; an operator edit then remains authoritative.
Operators can pause a monitor without losing check-in history. Resuming starts a fresh schedule, and changing its configuration resets the health window so old failures do not define the new schedule.
References: crates/…/cron_monitors.rs• L123-203 crates/…/management.rs• L20-68 crates/…/management.rs• L228-329 crates/…/handlers.rs• L102-217
Cron check-in processing
Each check-in identifies a monitor and a run. A job can report in_progress, ok, or error, with optional release, environment, duration, and trace context. Repeated terminal check-ins are safe to retry, while a late completion cannot undo a timeout or missed run.
The deadline worker coalesces overdue schedule occurrences into bounded failure records. Consecutive failures move a monitor to failing, and the configured number of successful runs moves it back to ok. A durable pending flag lets alarm publication retry after a process or storage failure, and alarm identity includes the monitor so separate jobs keep separate alert paths.
References: crates/…/cron_monitors.rs• L205-257 crates/…/cron_monitors.rs• L312-510 crates/…/cron_monitors.rs• L555-629 crates/…/cron_monitors.rs• L663-729 crates/…/alarm_service.rs• L1449-1466
Cron monitor API
The project-scoped cron monitor API exposes monitor configuration and paginated run history. Read routes require environment-read access and project access. Create, update, and delete routes require environment-write access and record audit events.
The check-in path validates project, environment, deployment, schedule, status, and trace ownership before it accepts data. This keeps a job's history inside its project and prevents a check-in from creating an unbounded monitor or run set.
References: crates/…/handlers.rs• L102-241 crates/…/handlers.rs• L243-272 crates/…/management.rs• L98-226 crates/…/cron_monitors.rs• L349-377
Container health monitoring adds alarms for restart, crash, out-of-memory, CPU, and memory conditions. It ignores exits caused by an intentional stop, a paused or sleeping environment, or a deployment that no longer serves the environment. A container that runs again is reconciled with its current runtime data before its route is restored. Resource alarms require consecutive threshold breaches and use capacity-aware CPU values. Metric writes remain optional, so a metrics-store outage does not stop health alarms.
References: crates/…/evaluator.rs• L211-309 crates/…/evaluator.rs• L370-575 crates/…/evaluator.rs• L619-721 crates/…/evaluator.rs• L824-1081 crates/…/alarm_service.rs• L27-94 crates/…/alarm_service.rs• L584-661 crates/…/alarm_service.rs• L776-1015 crates/…/alarm_service.rs• L1018-1059 crates/…/alarm_service.rs• L1192-1487 crates/…/container_health.rs• L254-347 crates/…/container_health.rs• L501-697 crates/…/container_health.rs• L700-799 crates/…/container_health.rs• L890-1095 crates/…/container_health.rs• L1138-1255 crates/…/container_health.rs• L1279-1597
Outage detection
Status monitoring turns completed checks into operational states and incidents. A monitor can be operational, degraded, or down. A state change can create or resolve an incident, alarm, notification, and optional downtime workflow.
Completed status-check jobs are the primary real-time input. A fallback scan reads the latest check for each active monitor for recovery or diagnosis. Outage state is kept per monitor so repeated checks do not create repeated incidents.
Paused deployments are excluded. Outage processing checks the pause while creating the incident under an environment lock, then checks the incident again before each notification, alarm, or workflow side effect. This prevents an intentional pause from creating a late notification or workflow trigger. A status result that is not applicable to a background worker retires old HTTP-monitor state without claiming a recovery. Notifications include a human-readable project name when available, with a safe fallback when the project no longer exists.
References: crates/…/outage.rs• L139-229 crates/…/outage.rs• L252-395 crates/…/outage.rs• L397-521 crates/…/outage.rs• L524-551 crates/…/outage.rs• L946-1001 crates/…/outage.rs• L1004-1105
HTTP checks
HTTP checks verify project credentials and local credential expiry. An HTTP check sends a selected credential to its intended public service endpoint. A local check inspects certificates, SSH certificates, OpenPGP keys, kubeconfigs, or JWTs without network access. Both kinds store their recipe safely, run on a schedule or on demand, record a health result, and notify on meaningful state changes.
The HTTP transport accepts only validated public HTTPS destinations. It blocks private or local targets, pins validated DNS addresses, does not use ambient proxies, does not follow redirects, limits response size, and applies request time limits. A write-only secret can reach only its value-recognized provider endpoint. History records detection and verification without exposing stored values.
Unknown results are recorded as inconclusive rather than as healthy or failed. The first unknown result waits for another attempt, while repeated unknown results use a short retry interval and can notify operators. A notification fingerprint prevents repeated messages for the same result, and a failed delivery leaves the fingerprint unchanged so a later run can retry it.
This diagram shows the path from project settings to a protected result and an optional notification.
flowchart LR
U[Project check settings] --> V[Validate kind and credential source]
V --> S[Encrypted stored recipe]
S --> L[Leased scheduled or manual run]
L --> K{Check kind}
K --> T[Safe HTTPS transport]
K --> X[Local credential inspection]
T --> R[Health result]
X --> R
R --> H[Check history]
R --> N[Deduplicated notification]
References: crates/…/handlers.rs• L107-198 crates/…/handlers.rs• L201-425 crates/…/mod.rs• L77-198 crates/…/mod.rs• L282-483 crates/…/mod.rs• L484-871 crates/…/mod.rs• L871-909 crates/…/transport.rs• L12-117 crates/…/variable_history.rs• L6-145 crates/…/secret_history.rs• L23-140
Automatic credential checks
Automatic credential checks keep monitoring aligned with credential changes. A short background cycle scans bounded batches of environment variables and secrets, detects known providers or expiring artifacts, and commits the detection marker with the matching automatic check so multiple control-plane processes do not duplicate work.
Manual checks take precedence. Explicit deletions suppress a matching automatic check, and a paused automatic check stays paused. Unreadable values are retried later. Values above the inspection bound are not decrypted or used to create a check. A changed value or key can replace an obsolete provider check, reset its result, or remove it.
References: crates/…/automatic.rs• L9-86 crates/…/variable_history.rs• L42-145 crates/…/secret_history.rs• L9-140 crates/…/http_checks.rs• L154-340 crates/…/http_checks.rs• L599-786
HTTP check API
The project-scoped API lets authorized operators list checks and provider presets, detect credential candidates, create or update checks, run a check, pause or resume it, and inspect variable or secret history. Detection responses expose candidates and artifact metadata without returning credential values.
Check mutations and detection actions produce audit records. Resuming a check requires secret-read permission because it can cause a stored credential to be used, while pausing does not. The API keeps history paginated and scoped to the project that owns the credential.
References: crates/…/handlers.rs• L107-169 crates/…/handlers.rs• L171-320 crates/…/handlers.rs• L323-424 crates/…/http_checks.rs• L561-641
Notifications
Notifications carry alarms, outage changes, HTTP check changes, scheduled job failures, and other important system events to configured providers. The source event is stored first. Delivery is best-effort, so a provider outage does not erase the alarm or its operator history.
Routes select providers by severity range and de-duplicate providers when several routes match. Supported provider types include email, Slack, generic webhooks, and managed Cloud delivery. Critical events use higher urgency, while recovery events use an informational priority. Alarm bursts can store each alarm while sending one digest, and bulk alarm resolution keeps integration jobs without sending a separate recovery message for each operator-cleared alarm.
References: crates/…/routing.rs• L16-35 crates/…/routing.rs• L585-639 crates/…/alarm_service.rs• L471-581 crates/…/alarm_service.rs• L989-1189 crates/…/alarm_service.rs• L1545-1679 crates/…/mod.rs• L655-811 crates/…/outage.rs• L758-847 web/…/MonitoringSettings.tsx• L1027-1162 web/…/ProviderForm.tsx• L143-218
Observability data paths
The repository uses separate storage roles because recent query speed, long-term retention, and product analytics have different needs. Relational time-series storage supports common control-plane data. ClickHouse supports native span and metric paths. Chunk storage keeps collected runtime log bytes, while a derived line index supports log attributes and facets. Object storage can keep an archive copy of OTLP logs.
Cloud routing is applied at the storage boundary. Span and analytics metric ledgers select their source, while logs, health summaries, ingest errors, and control data remain local. Cross-project trace references remain local so Cloud-primary spans stay discoverable. Global reads merge authorized source streams only when their data can be compared safely.
Product event analytics remains a separate anonymous path. It measures instance and product behavior, not application runtime behavior.
References: crates/…/mod.rs• L93-193 crates/…/timescaledb.rs• L563-588 crates/…/mod.rs• L10-37 crates/…/global_traces.rs• L219-250 crates/…/cloud_routed.rs• L31-54 crates/…/cloud_routed.rs• L960-1009 crates/…/analytics.rs• L164-224 crates/…/global_search.rs• L228-279
Change checklist
When these files or sections are changed, remember to consider these:
- Keep OTLP routes, authentication context, decoded signal models, storage contracts, and generated UI types aligned for metrics, traces, and logs.
- Keep authenticated source context as the owner of project, environment, deployment, and service identity. Do not let payload fields override it.
- When adding a product event, update the Rust event vocabulary and telemetry-api/…/events.ts together.
- Keep telemetry consent precedence, status disclosure, audit records, live reporter state, and cross-process preference refresh aligned across crates/…/handlers.rs, crates/…/settings.rs, and crates/…/service.rs.
- When changing milestone telemetry, keep the in-process guard, durable claim store, and stateless control-plane identity path aligned.
- When changing a pipeline counter, update its snapshot, metric name, delta sampler, query response, chart series, and monitoring rule seed together.
- When changing metric counter, histogram, label, or Cloud-routing semantics, review the collector, local query path, storage row shape, and chart identity together.
- When changing collected-log parsing or chunks, keep canonical fields, parser bounds, footer and trailer rules, WAL recovery, manifest offsets, indexes, range reads, and legacy reads aligned.
- When changing log search or retention, keep access checks, chunk metadata, scan budgets, cursor ordering, live heads, derived index rows, and forget cleanup aligned.
- When changing global trace scope, keep project access, sharing consent, source windows, per-source totals, pagination, and effective-window UI state aligned.
- When changing Cloud telemetry routing, review local writes, durable outboxes, signal ledgers, cutover windows, read routing, and health computation together.
- When changing alert severity, type, or scope, update rule evaluation, alarm cooldowns, alarm persistence, bulk actions, outage handling, notification priority, and route matching as one contract.
- When changing alarm rule metadata, keep rule source, rule ID, dynamic series identity, cooldown matching, silence matching, and alarm display data aligned.
- When changing runtime health alarms, keep assignment identity, event ownership, coordinator terms, live deployment state, alarm persistence, and resolution matching aligned.
- When changing the alarms API, keep project versus system scope, permission guards, filter semantics, bulk limits, remaining counts, audit records, and generated client schemas aligned.
- When changing alarm routes or bulk actions, preserve project versus system scope, permission checks, status transitions, audit records, update caps, and remaining-count behavior.
- When changing container health rules, keep intentional-stop markers and restart-time detection, current-deployment checks, pause and sleep suppression, remote runtime selection and time bounds, runtime metadata and route restoration, resource thresholds, delta metric semantics, optional metric writes, and alarm scopes aligned.
- When changing cron monitor schedules, check-in states, thresholds, or ownership, keep the check-in API, monitor management API, deadline worker, run history, pending alarm flag, monitor-specific cooldown, and audit events aligned.
- When changing cron monitor configuration ownership, preserve the rule that operator edits are authoritative over later SDK configuration and that pause or resume resets the health window as intended.
- When changing outage side effects, keep the pause lock, incident status checks, alarm state, notification state, and downtime workflow trigger as one race-safe flow.
- When changing status-check meanings, keep
not_applicableretirement, HTTP monitor state, incident cleanup, alarm cleanup, and deployment-promotion locking aligned. - When changing metric explorer or dashboard views, keep query filters, grouping limits, alert identity, anomaly-band scope, and empty-state meaning aligned.
- When changing trace or log exploration, preserve URL filter state, trace-to-log links, time-window rules, pagination, and onboarding versus empty-result behavior.
- When changing HTTP checks, keep kind validation, encrypted recipes, credential-destination rules, automatic detection markers and suppressions, leases, result fingerprints, unknown-result retry, history details, and notification state aligned for both environment variables and secrets.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Missing or invalid OTLP credentials | The batch is rejected and is not stored. | Project, deployment, and service tokens are checked before decode and storage. |
| Ingest concurrency, rate limit, quota, or queue capacity is reached | The exporter receives a rejection or the optional relay drops data. | Bounded permits and queues expose rejection and drop counters. |
| Cloud-primary handoff is full or cannot be queued | Items are refused or the request fails so the exporter can retry. | Durable outbox caps distinguish refusal from accepted data. |
| A metric counter has no baseline after restart | The first cumulative reading is not shown as a false spike. | The collector establishes a new baseline. |
| A local or remote log stream loses its connection | Collection retries from a later position or stops after bounded failures. | Resume positions and bounded backoff limit duplicates and retry loops. |
| A collected-log WAL or chunk is damaged | The affected generation or chunk is held back while valid data remains readable. | Checksums, bounded recovery, format checks, and explicit recovery state protect readers. |
| A log search exceeds its time or decompression budget | The response is partial rather than falsely complete. | Bounded scans return a continuation cursor. |
| The line index is unavailable | Basic log search works, but facets and attribute analytics report unavailable. | Capabilities expose the missing backend or coverage state. |
| Operation statistics mix incomparable local and Cloud sources | The report is rejected instead of returning invalid aggregates. | The storage boundary detects mixed sources. |
| Alert condition has no current metric value | No new alarm fires and the breach state is cleared. | Rules require a current value before comparison. |
| A persisted breach window is stale, disabled, silenced, or from a future clock | The evaluator starts a fresh breach window. | Restore and claim checks age, enabled state, silence, and clock direction. |
| Two alert rules share an alarm type and scope but have different rule identity | One rule can suppress or silence another rule's alarm. | Cooldown and silence matching includes rule source, rule ID, and dynamic series where present. |
| Two scheduled jobs fail in the same project | One job must not suppress the other job's failure alarm. | Cron alarm cooldown matching includes the monitor identity. |
| A cron check-in is late, duplicated, or arrives after a timeout | The run can be counted twice or a completed run can hide a missed deadline. | Check-in IDs are idempotent, terminal runs are immutable, and each run has its own deadline. |
| A cron monitor has no configuration or is paused | The job can remain in history without creating a false schedule failure. | Unconfigured monitors park their deadline, and paused monitors skip health evaluation. |
| Cron alarm publication fails after monitor state changes | The monitor shows failure but no active alarm, or an old alarm remains open. | A durable pending flag retries synchronization and resolves alarms when the monitor recovers or pauses. |
| A runtime alarm event is stale, belongs to a retired assignment, or lacks the current coordinator term | A retired workload could create or retain a runtime alarm. | Alarm insert and resolution re-check assignment, deployment, outbox, and coordinator state. |
| A bulk alarm request selects more rows than its cap or races with another status change | Only eligible rows change and the caller must continue or retry with the reported remainder. | The request is bounded and the guarded update re-checks status and scope. |
| An alarm action uses a project route for a system alarm or the reverse | The request is rejected instead of changing an alarm outside its scope. | Project access and system-admin guards use separate scoped routes. |
| A container is intentionally stopped, paused, sleeping, orphaned, or on an old deployment | Monitoring reports a false crash or resource alarm. | Live environment and deployment checks distinguish expected exits from workload failures, including a stop marker that predates a later restart. |
A container runs again after its row still says exited or dead | The route table can keep the application unreachable or use stale runtime data. | Current ports and runtime metadata are persisted before a conditional status restore and route refresh. |
| A remote worker runtime cannot be resolved or responds too slowly | Health checks for that worker are skipped for the cycle. | Node-aware runtime resolution, per-cycle caching, fair bounded concurrency, and worker timeouts prevent local fallback. |
| Raw container CPU percent is compared directly with a flat threshold | A multi-core or uncapped container produces a false high-CPU alarm. | Alarm evaluation uses utilization relative to the configured limit or host capacity. |
| The container metrics store is unavailable | Resource metrics are missing, but container health alarms may still be evaluated. | Metric writes are optional and isolated from status and alarm processing. |
| A notification provider fails | The alarm or check result remains stored without external delivery. | Delivery is best-effort and source state is persisted first. |
| An HTTP check targets a private, plain HTTP, redirected, or oversized endpoint | The check fails without sending a credential through an unsafe path. | Public HTTPS validation, DNS pinning, no proxy, no redirects, timeouts, and response limits guard transport. |
| An automatic credential cannot be decrypted or exceeds the inspection bound | Detection is retried or skipped without creating a check from unsafe input. | Retry markers, bounded inspection, and value-free history protect the scan. |
| A manual check or suppression conflicts with automatic detection | Automatic reconciliation does not replace the user's choice. | Manual checks and explicit suppressions have precedence. |
| An HTTP check returns an unknown result or its notification fails | The result is retried and the same notification can be sent again after a delivery failure. | Unknown results use a short retry path, and fingerprints advance only after successful delivery. |
| A status check arrives after a deployment is paused | The event could create an incident, alarm, notification, or workflow for an intentional stop. | The incident insert and pause check share an environment lock, and each later side effect checks the incident state. |
A background worker reports not_applicable after a new deployment is active | Delayed retirement could clear the new deployment's HTTP state. | Retirement locks the environment and verifies the current deployment and worker shape before cleanup. |
An admin opts in while TEMPS_TELEMETRY is set to an opt-out value | The preference is saved, but events remain disabled. | The environment source has higher precedence and the API exposes it. |
| The anonymous telemetry identity cannot be loaded or created | Product telemetry is disabled for that run, but server startup continues. | The plugin registers a no-op reporter. |
| The telemetry endpoint is slow or unavailable | Product events are not delivered without affecting the user-facing operation. | Sends are detached and time-limited. |
| A durable first-touch telemetry claim fails or already exists | The milestone is skipped instead of being emitted more than once. | The in-process guard runs first and the database claim is conflict-safe. |
| A trace or log query has no data in its selected window | The operator can mistake a quiet window for an unconfigured signal. | The UI distinguishes no data in range from never received and keeps trace correlation explicit. |
Key files
| File | Why to read it |
|---|---|
| crates/…/mod.rs | Shows the OTLP write and observability query API surface. |
| crates/…/otel_service.rs | Shows how accepted metrics, spans, and logs enter storage and pipeline accounting. |
| crates/…/plugin.rs | Connects storage, Cloud routing, samplers, health, and alert services. |
| crates/…/query_handler.rs | Defines metric, trace, log, health, and ingest-status reads. |
| crates/…/global_traces.rs | Defines authorized cross-project trace reads and source windows. |
| crates/…/cloud_routed.rs | Defines local and Cloud source selection and cutover behavior. |
| crates/…/telemetry.rs | Defines the anonymous event vocabulary and reporter contract. |
| crates/…/service.rs | Defines instance identity, consent handling, timed sends, and milestone claims. |
| crates/…/settings.rs | Defines admin preferences, consent precedence, runtime refresh, and unavailable status. |
| crates/…/handlers.rs | Defines the operator-facing telemetry status and preference API. |
| telemetry-api/…/events.ts | Defines central product-event validation and storage. |
| crates/…/collector.rs | Shows runtime log collection and ownership checks. |
| crates/…/chunk_writer.rs | Shows durable collected-log storage and recovery boundaries. |
| crates/…/parser.rs | Defines structured log fields and input bounds. |
| crates/…/chunk_store.rs | Defines bounded search, cursors, live heads, and chunk reads. |
| crates/…/analytics.rs | Defines attribute analytics over collected logs. |
| web/…/LogsList.tsx | Shows project log filters, trace correlation, URL state, and paging. |
| web/…/TracesList.tsx | Shows trace search, setup verification, empty-state meaning, and Cloud backlog disclosure. |
| web/…/MetricTile.tsx | Shows dashboard metric queries, alert state, grouping, and anomaly-band display. |
| web/…/AnomalyBacktest.tsx | Shows how operators review recent anomaly behavior before enabling a rule. |
| web/…/SuggestAlertsButton.tsx | Shows the guarded entry point for AI alert suggestions. |
| web/…/suggest-alerts-state.ts | Defines readiness states for the alert suggestion entry point. |
| crates/…/evaluator.rs | Defines metric rule evaluation, persisted breach windows, default rules, and alarm transitions. |
| crates/…/alarm_service.rs | Defines alarm identity, scope, cooldown, lifecycle actions, runtime ownership, bulk behavior, and notification jobs. |
| crates/…/alarm_handlers.rs | Defines project and system alarm reads, actions, permissions, and audit records. |
| crates/…/cron_monitors.rs | Defines scheduled job check-ins, deadlines, run history, health state, and alarm synchronization. |
| crates/…/management.rs | Defines project monitor configuration, ownership, pause and resume behavior, and paginated views. |
| crates/…/handlers.rs | Defines the authenticated monitor management and run-history API. |
| crates/…/plugin.rs | Wires one shared alarm service, scheduled job monitoring, HTTP checks, and their routes into the application. |
| crates/…/container_health.rs | Defines container health signals, intentional-exit handling, runtime and route reconciliation, remote checks, capacity-aware alarms, and optional metric output. |
| crates/…/outage.rs | Defines event-driven status transitions, pause-safe incidents, HTTP monitor retirement, and workflow triggers. |
| crates/…/mod.rs | Defines check persistence, scheduling, result handling, credential rules, and notifications. |
| crates/…/handlers.rs | Defines the project-facing check, detection, history, and audit API. |
| crates/…/automatic.rs | Defines automatic provider-check reconciliation and suppression behavior. |
| crates/…/variable_history.rs | Defines variable detection and verification history. |
| crates/…/secret_history.rs | Defines secret detection retries and bounded inspection. |
| crates/…/routing.rs | Defines severity-based notification routing and provider selection. |