@haatlabs-core/observability
Tracing for the projects: spans that carry only allowed attributes, and trace context handed
from one process to another as a traceparent string.
const tracing = startTracing({
serviceName: 'api',
tracerName: 'shop',
extraAttributes: ['source.id'], // a project's own, besides the shared list
otlpEndpoint: config.tracing.otlpEndpoint,
});
withSpan, currentTraceContext, runWithTraceContext and startHttpSpan work whether or
not tracing is on. Metrics stay in each project.
The metrics prefix is the project's name in snake case; a prefix with anything but lowercase letters, digits and underscores is refused at start.
@haatlabs-core/observability/context (0.12.1): currentTraceContext alone, on
@opentelemetry/api with no SDK and nothing of Node, for code a browser may also load
(@haatlabs-core/providers/contracts). Importing the root never throws where
node:async_hooks is absent either: asService's scope is made on first use.
Install
pnpm add @haatlabs-core/observability
It leaves one package to your app, so the app holds one copy: prom-client.