Telemetry Core Bootstrap (v1 · 2025-11-19)
Audience: developers wiring a Stella Ops service host (web or worker).
Goal: the minimal host wiring forStellaOps.Telemetry.Core, with deterministic defaults and sealed-mode friendliness.
Add AddStellaOpsTelemetry(...) once during host startup and the helper registers OpenTelemetry tracing, metrics, and context propagation for the service. The snippets below show the registration call, the matching appsettings.json block, and the determinism guarantees the helper preserves. For the authoritative DI surface and full configuration-key table, see the Telemetry architecture.
Sample (web/worker host)
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddStellaOpsTelemetry(
builder.Configuration,
serviceName: "StellaOps.SampleService",
serviceVersion: builder.Configuration["VERSION"],
configureOptions: options =>
{
// Disable collector in sealed mode / air-gap
options.Collector.Enabled = builder.Configuration.GetValue<bool>("Telemetry:Collector:Enabled", true);
options.Collector.Endpoint = builder.Configuration["Telemetry:Collector:Endpoint"];
options.Collector.Protocol = TelemetryCollectorProtocol.Grpc;
},
configureMetrics: m => m.AddAspNetCoreInstrumentation(),
configureTracing: t => t.AddHttpClientInstrumentation());
Configuration (appsettings.json)
{
"Telemetry": {
"Collector": {
"Enabled": true,
"Endpoint": "https://otel-collector.example:4317",
"Protocol": "Grpc",
"Component": "sample-service",
"Intent": "telemetry-export",
"DisableOnViolation": true
}
}
}
Determinism & safety
- UTC timestamps only; the helper introduces no random IDs of its own.
- The exporter is skipped when the endpoint is missing or egress policy denies it (sealed/air-gap mode).
- Set
VSTEST_DISABLE_APPDOMAIN=1for tests that follow thetools/linksets-ci.shpattern.
Next steps
- Propagation contract (TELEMETRY-OBS-51-001) — trace/context propagation that builds on this bootstrap.
- Scrubbing contract (TELEMETRY-OBS-51-002) — redaction rules applied before export.
- Sealed-mode helpers (TELEMETRY-OBS-56-001) — behavior when
Sealed=true.
