feat: shared observability kit - traces, logger, error capture - #1
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Phase 0b of the observability plan (vault: features/observability): ONE reusable kit every agentage service adopts for traces + logs + errors, replacing the private
web/packages/otelcopy and catalog's hand-rolledotel-bootstrap.mjs.What
./bootstrap-node --importpreload, ported verbatim fromweb/packages/otel(ESM loader hook viamodule.register(), opt-in onOTEL_EXPORTER_OTLP_ENDPOINT+OTEL_SERVICE_NAME, fs/net/dns instrumentations disabled, bounded flush on SIGTERM/SIGINT).createLogger({service})- NEW: pino preset, JSON to stdout only (no in-process shipping - the estate log agent tails containers),serviceon every line,trace_id/span_idinjected from the active span = log<->trace correlation in SigNoz.captureError(log, err, ctx)- NEW: structured error log +recordException+ ERROR span status in one call; safe without a tracer.How I verified
npm run verifygreen: type-check, lint, format, 14/14 tests, build, dist smoke.node --import ./dist/bootstrap.jswith env set printsotel: tracing enabled, logger emits{"service":...,"msg":...}JSON, unreachable collector neither crashes nor hangs the process.Verify (for human)
src/index.ts, README adoption checklist) - this is the contract all ~10 repos will pin.NPM_TOKENrepo secret (same as memory-core).