Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized function calls.
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled

This commit is contained in:
master
2025-11-20 07:50:52 +02:00
parent 616ec73133
commit 10212d67c0
473 changed files with 316758 additions and 388 deletions

View File

@@ -0,0 +1,48 @@
# Telemetry Core Bootstrap (v1 · 2025-11-19)
## Goal
Show minimal host wiring for `StellaOps.Telemetry.Core` with deterministic defaults and sealed-mode friendliness.
## Sample (web/worker host)
```csharp
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)
```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; no random IDs introduced by the helper.
- Exporter is skipped when endpoint missing or egress policy denies.
- `VSTEST_DISABLE_APPDOMAIN=1` recommended for tests with `tools/linksets-ci.sh` pattern.
## Next
- Propagation adapters (50-002) will build on this bootstrap.
- Scrub/analyzer policies live under upcoming 51-001/51-002 tasks.