One telemetry contract for every service.
libo11y specifies the resource attributes, logs, spans, metrics and events a service emits, and how sensitive each attribute is. Reference libraries apply it in one setup call, on plain OpenTelemetry.
An example request: one trace, its log records and a metric exemplar share the trace ID 4bf92f3577b34da6.
- spec version
- 1.2.0
- attributes defined
- 33
- metrics
- 10
- events
- 7
- span shapes
- 5
- semconv pinned
- 1.41.0
The parts OpenTelemetry leaves to you.
OpenTelemetry standardises the wire format and the common attributes. libo11y adds the house rules a team writes down sooner or later, as a versioned registry that code is generated from.
Resource taxonomy
Four tiers, from the identity a service must resolve before telemetry starts to opt-in tenancy, plus the keys that are forbidden by default.
Sensitivity classification
Every attribute is labelled public, internal, pii or secret. Each library redacts by that label, and the label is generated into every language from one registry.
Event catalog
Named events with the attributes each one requires, so a summary record means the same thing in every service.
Generated code
The registry generates typed keys, closed enums and the validation tables the runtime and test harness share.
Six rules the libraries keep.
Each one is a property you can check. The bundled test harness asserts them in your own test suite.
Pure OpenTelemetry
OTLP for all three signals. Standard OTEL_* variables are honoured and never shadowed.
One identity, three surfaces
Logs, spans and outgoing headers read the active span context. There is no second copy of the trace ID.
Wrap setup, not instrumentation
One call wires the providers. After that you use the vanilla OTEL API and your language's own logger.
Owned lifecycle
Setup returns a handle with a bounded, idempotent Shutdown. The library never panics and never blocks startup on a collector.
Locally testable
A hermetic harness records every signal in memory and asserts conformance, with no global state touched.
Safe in the dark
With no configuration at all the application runs normally, and telemetry degrades instead of crashing the host.
The spec, applied in one call.
Each library implements the same design contract in its language's own idiom. Go is released. TypeScript is in development.
func main() {
ctx := context.Background()
sdk, err := o11y.Setup(ctx,
o11y.WithServiceName("checkout"),
o11y.WithEnvironment(spec.EnvironmentProduction),
)
if err != nil {
log.Fatal(err)
}
defer sdk.Shutdown(context.Background())
// Vanilla OTEL and log/slog from here on.
ctx, span := otel.Tracer("checkout").Start(ctx, "startup")
defer span.End()
slog.InfoContext(ctx, "ready") // correlated with the span, exported
}Every resource the libraries build carries this URL. Each published version is immutable, so tools can translate telemetry between spec versions.