Telemetry Architecture

Audience: developers instrumenting Stella Ops services, and operators reasoning about what telemetry the platform emits today versus what remains on the roadmap. For the module overview and quick links, see ./README.md.

Telemetry is the shared observability foundation for the Stella Ops release control plane: OpenTelemetry instrumentation, the platform metric families, log redaction, sealed/incident-mode guardrails, and opt-in federated telemetry — all consumed in-process by other modules.

Aligned with Epic 15 (Observability & Forensics). Implementation status (2026-05-29): src/Telemetry/ ships as a set of in-process .NET libraries that Stella Ops services consume via dependency injection — not a standalone collector/storage deployment. This document describes the implemented library surface first, then records the still-unbuilt Epic 15 collector/storage roadmap as explicitly marked forward specs.

0) What is implemented vs. roadmap

The Telemetry module today consists of three libraries plus consuming endpoints owned by other modules:

ComponentPathRole
StellaOps.Telemetry.Coresrc/Telemetry/StellaOps.Telemetry.Core/StellaOps.Telemetry.Core/OpenTelemetry instrumentation, context propagation, redaction, metric-label guard, sealed/incident-mode services, and the metric families (DORA, NIS2, golden signals, TTFS/TTE, proof coverage, etc.).
StellaOps.Telemetry.Federationsrc/Telemetry/StellaOps.Telemetry.Federation/Opt-in federated telemetry: DSSE-signed consent, k-anonymity + differential-privacy aggregation, bundle build/verify, privacy budget, sync background service.
StellaOps.Telemetry.Analyzerssrc/Telemetry/StellaOps.Telemetry.Analyzers/Roslyn analyzers (MetricLabelAnalyzer, CredentialExceptionLoggingAnalyzer) enforcing telemetry hygiene at build time.
Federation/NIS2 HTTP endpointssrc/Platform/StellaOps.Platform.WebService/Endpoints/The HTTP surface for federation consent/bundles and NIS2 effectiveness is owned by Platform WebService, not this module.

Roadmap (NOT YET IMPLEMENTED). A deployed OpenTelemetry Collector tier, Prometheus/Tempo/Loki storage backends, collector config profiles (default/forensic/airgap), forensic OTLP archive bundles, and stella telemetry CLI verbs are tracked in README.md (Phases 1-6) and remain planned. They are described in section 7 below and are clearly tagged so readers do not mistake them for shipped behaviour.

1) Service-side instrumentation (AddStellaOpsTelemetry)

The core entry point is TelemetryServiceCollectionExtensions.AddStellaOpsTelemetry(...), which wires the OpenTelemetry SDK (tracing, metrics, logging) for a host service and returns the OpenTelemetryBuilder for further chaining. Behaviour:

Additional opt-in DI extensions (all in TelemetryServiceCollectionExtensions):

Collector exporter (OTLP target, not a deployed tier)

StellaOpsTelemetryOptions.CollectorOptions configures the OTLP exporter that ships traces/metrics out of the process. It is not a deployed OpenTelemetry Collector. Keys:

Key (Telemetry:Collector:*)DefaultMeaning
EnabledtrueEnables the OTLP exporter.
Endpoint(none)Absolute URI of the OTLP receiver; exporter is disabled if unset/unparseable.
ProtocolGrpcGrpc or HttpProtobuf.
Componenttelemetry (defaults to the service name)Component label for egress-policy evaluation.
Intenttelemetry-exportIntent label for egress-policy evaluation.
DisableOnViolationtrueDisables the exporter when TelemetryExporterGuard / egress policy blocks the endpoint.

When an IEgressPolicy is registered, the exporter’s HttpClientFactory routes through EgressHttpClientFactory so air-gap egress rules apply to telemetry export.

Propagation context

TelemetryContext carries CorrelationId/TraceId, TenantId, Actor, and ImposedRule across HTTP, gRPC, background jobs, and CLI. PropagationOptions configures the header names (X-StellaOps-TenantId, x-stella-actor, x-stella-imposed-rule, X-StellaOps-TraceId). Cardinality is bounded by MetricLabelGuard (Labels:MaxDistinctValuesPerLabel default 50, Labels:MaxLabelLength default 64).

2) Metric families (StellaOps.Telemetry.Core)

Each family creates its own System.Diagnostics.Metrics.Meter; there is no shared Prometheus/Tempo/Loki storage in this module. Emission is via the OTLP exporter configured above (or the sealed-mode file exporter when offline). Implemented meters:

Meter nameSourcePurpose
StellaOps.GoldenSignalsGoldenSignalMetrics.csLatency histogram, error/request counters, saturation gauge.
StellaOps.DORADoraMetrics.csDORA delivery metrics (see section 7).
StellaOps.NIS2Nis2AreaMetrics.csNIS2 thirteen-area KPI gauges (see section 8).
StellaOps.TimeToFirstSignal, StellaOps.TimeToEvidence, StellaOps.TimeToEvidence.PercentilesTimeToFirstSignalMetrics.cs, TimeToEvidenceMetrics.cs, TtePercentileExporter.csTriage latency SLOs.
StellaOps.ProofCoverage, StellaOps.ProofGenerationProofCoverageMetrics.cs, ProofGenerationMetrics.csAttestation/proof coverage and generation.
StellaOps.FidelityFidelityMetricsTelemetry.csFidelity SLO metrics (FidelitySloAlertingService).
StellaOps.P0MetricsP0ProductMetrics.csP0 product metrics.
StellaOps.UnknownsBurndownUnknownsBurndownMetrics.csUnknowns burndown.
StellaOps.TriageTriage/TriageMetrics.csTriage workflow.
StellaOps.Attestations, StellaOps.DeploymentsMetrics/AttestationMetrics.cs, Metrics/DeploymentMetrics.csAttestation completeness/quality (created/verified/failed counters, TTFE + verification-duration histograms) and deployment/reversion counters; both registered by AddAttestationMetrics() and created via IMeterFactory.
StellaOps.Telemetry.SealedModeSealedModeTelemetryService.csSeal/unseal/drift/blocked-export counters (see section 3).

3) Sealed mode, incident mode, and redaction (guardrails)

4) APIs & integration

The Telemetry libraries expose no HTTP surface of their own. Consuming HTTP endpoints live in StellaOps.Platform.WebService.

Federated telemetryFederationTelemetryEndpoints.MapFederationTelemetryEndpoints, base path /api/v1/telemetry/federation. /participation/* is current-tenant state and requires tenant participation scopes; /installation/* is Platform installation state and requires installation-operator federation scopes without manufacturing tenant context.

Verb + pathPolicy / scopePurpose
GET /participation/consenttelemetry.participation.read (telemetry:participation:read)Current tenant consent state.
POST /participation/consent/granttelemetry.participation.write (telemetry:participation:write)Grant current-tenant consent as the authenticated actor.
POST /participation/consent/revoketelemetry.participation.writeRevoke current-tenant consent as the authenticated actor.
POST /participation/factstelemetry.facts.write (telemetry:facts:write)Persist a fact attributed to the authenticated tenant and actor.
GET /installation/statusplatform.federation.read (platform:federation:read)Installation sealed mode, site id, epsilon budget, and bundle count.
GET /installation/bundles, GET /installation/bundles/{id:guid}platform.federation.readInstallation bundle list/detail (detail re-verifies DSSE).
GET /installation/intelligenceplatform.federation.readDurable installation shared exploit-intelligence corpus.
GET /installation/privacy-budgetplatform.federation.readInstallation privacy-budget snapshot.
POST /installation/triggerplatform.federation.manage (platform:federation:write)Invoke local aggregation and durable outbox enqueue; this is not peer delivery.

NIS2 effectivenessNis2TelemetryEndpoints.MapNis2TelemetryEndpoints:

Verb + pathPolicy / scopePurpose
GET /api/telemetry/nis2/effectiveness?tenantId=&window=rolling-30d|rolling-90dplatform.analytics.read (analytics.read)Tenant-scoped NIS2 thirteen-area KPI dashboard read model (nis2-effectiveness-dashboard-v1).

Platform persists consent, eligible facts, installation privacy accounting, consent-set commitments, bundles, peer delivery receipts, and imported aggregate intelligence in PostgreSQL. Local Synced means durable outbox acceptance. When the optional peer lane is enabled, only a destination-bound, mTLS-authenticated HTTPS response carrying the deterministic signed-bundle receipt changes an outbox row to delivered.

CLI integration today is limited to: telemetry instrumentation of the CLI itself (src/Cli/StellaOps.Cli/Telemetry/CliMetrics, CliActivitySource, SealedModeTelemetry, TraceparentHttpMessageHandler), a setup-wizard TelemetrySetupStep, and the DoraIncidentCommandGroup (DORA incident reporting). There is no stella telemetry deploy/capture/profile command group; those remain roadmap (see section 7).

5) Persistence

Telemetry ships as in-process libraries and owns no standalone PostgreSQL schema. Platform migration 007 owns installation identity, consent, facts, privacy, bundle, and local outbox state. Migration 008 adds durable imported aggregate intelligence; migration 009 adds leased outbox claims, peer acknowledgements, and digest-bound inbox receipts. The current-tenant /participation/facts route supplies authenticated durable ingress. Sealed mode skips both aggregation and peer delivery.

6) Federation pipeline (StellaOps.Telemetry.Federation)

FederationServiceCollectionExtensions.AddFederatedTelemetry(...) registers the federation services; AddFederatedTelemetrySync() adds the FederatedTelemetrySyncService background worker. Pipeline:

  1. Consent (ConsentManager) — grant/revoke/verify per tenant. Grants produce a DSSE-signed ConsentProof (predicate stella.ops/federatedConsent@v1); Platform’s production store persists proofs and retained revocations.
  2. Aggregation (TelemetryAggregator) — groups TelemetryFacts by CVE, bounds each consenting tenant’s contribution, suppresses buckets below KAnonymityThreshold distinct tenants, adds cryptographically sampled Laplacian noise sized from the contribution sensitivity, and atomically spends from the installation privacy ledger.
  3. Privacy budget (PostgresFederationPrivacyBudgetTracker in Platform) — persists installation epsilon spend against EpsilonBudget and resets it by configured period without concurrent overspend.
  4. Bundle build/verify (FederatedTelemetryBundleBuilder) — canonicalises non-suppressed buckets, derives a deterministic bundle GUID from a SHA-256 seed, and DSSE-signs the payload (predicate stella.ops/federatedTelemetry@v1). Verification re-checks the envelope digest, payload type, signer key, consent-set commitment, aggregate totals, privacy spend, timestamps, and the complete public bucket projection before any peer intelligence is accepted.
  5. Synchronization boundary (FederatedTelemetrySyncService) — disabled by default. Enabled production startup fails with federation.startup.durable_prerequisites_unavailable if a process-local fallback store/outbox remains selected. A cycle atomically claims eligible facts, builds and persists a signed installation bundle, and enqueues a pending local outbox row. It does not claim peer delivery.

Platform binds FederatedTelemetryOptions exclusively from Platform:TelemetryFederation, not Platform:Federation (the latter belongs to ReleaseOrchestrator regional federation). Options include Enabled (default false), KAnonymityThreshold, EpsilonBudget, BudgetResetPeriod, AggregationInterval, SealedModeEnabled, SiteId, predicate types, and DSSE material. DSSE security posture is detailed in section 9.

7) Roadmap — collector, storage, and forensic capture (NOT YET IMPLEMENTED)

The following Epic 15 capabilities are specified in README.md (Phases 1-6) but are not present in src/Telemetry/as of 2026-05-29. They are retained here as forward specs:

8) Observability of the telemetry stack (implemented)

9) DORA Metrics

Stella Ops tracks the four key DORA (DevOps Research and Assessment) metrics for software delivery performance:

9.1) Metrics Tracked

Implementation note: metric names above are emitted by DoraMetrics (meter StellaOps.DORA) via instruments including dora_deployments_total, dora_deployment_duration_seconds, dora_lead_time_hours, dora_deployment_success_total, dora_deployment_failure_total, dora_incidents_total, dora_incidents_resolved_total, dora_time_to_recovery_hours, and dora_slo_breach_total.

9.2) Performance Classification

DoraMetrics.ClassifyPerformance(deploymentFrequencyPerDay, leadTimeHours, changeFailureRatePercent, mttrHours) classifies teams into DoraPerformanceLevel (Elite=4, High=3, Medium=2, Low=1, Unknown=0). The thresholds below reflect the implemented conditional (the in-code comment + DoraPerformanceLevel.Elite XML doc were reconciled to <24h on 2026-07-12, CLO-7):

9.3) Integration Points

9.4) SLO Tracking

Configurable SLO targets via DoraMetricsOptions:

SLO breaches are recorded as dora_slo_breach_total with metric label.

9.5) Outcome Analytics and Attribution (Sprint 20260208_065)

Telemetry now includes deterministic executive outcome attribution built on top of the existing DORA event stream:

Outcome attribution behavior:

Dependency injection integration:

Verification coverage:

9.6) DORA ICT Incident Classification (Sprint 20260430_111)

Telemetry Core exposes a deterministic DORA ICT incident classifier:

Classifier behavior:

Verification coverage:

10) NIS2 Area Metrics (Sprint 20260430_060)

Telemetry Core exposes the NIS2 thirteen-area KPI metric family for effectiveness reporting:

Contract:

Verification coverage:

Direct Policy, Findings, Authority, and Crypto call-site adoption is downstream module work; Telemetry Core owns the metric catalog, bounded emission, and deterministic reporting surface.

11) Federation DSSE Security Posture (Updated 2026-04-28)

Status:

Implemented contract:

Signer/verifier integration and fallback:

Verification evidence:

Tracking sprint:

12) Decisions & Risks