Telemetry Core Bootstrap (v1 · 2025-11-19)

Audience: developers wiring a Stella Ops service host (web or worker).
Goal: the minimal host wiring for StellaOps.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

Next steps