Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
A diagnostics bus over node:diagnostics_channel for AdonisJS — @agora/diagnostics
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗@adonis-agora/diagnosticsA standard convention for Agora AdonisJS libs to emit observability events over
node:diagnostics_channel— recorded by a single generic Telescope watcher, with zero coupling between emitter and observer.
Every Agora lib publishes on agora:<lib>:<event>. Anything that wants to observe
(Telescope, a metrics exporter, your own handler) subscribes — there is no import
between them, only the channel-name wire contract.
npm i @adonis-agora/diagnostics
node ace configure @adonis-agora/diagnostics
configure registers the provider and publishes two files: config/diagnostics.ts
(the otel flag and the cross-process transports) and start/diagnostics.ts
(preloaded), where you register handlers.
import { emit, trace } from '@adonis-agora/diagnostics'
// POINT event — free when nothing is subscribed:
emit('billing', 'invoice-paid', { invoiceId: 'inv_123', amount: 4200 })
// SPAN — start/end/error with timing (sync or async):
const decision = trace('authz', 'decision', () => evaluate(req), { subject })
traceId auto-fills from @adonis-agora/context when installed (the context provider
soft-registers its accessor). Declare typed payloads via the ChannelRegistry
augmentation for compile-time checks.
import { onDiagnostic } from '@adonis-agora/diagnostics'
onDiagnostic('resilience', (event) => log(event)) // every resilience event
onDiagnostic('authz', 'decision', (event) => audit(event)) // one exact channel
| Package | What |
|---|---|
@adonis-agora/diagnostics | emit / trace / onDiagnostic over node:diagnostics_channel, plus the OpenTelemetry bridge and the cross-process Redis / @adonisjs/queue transports (selected in config/diagnostics.ts) |
AdonisJS port of the aviary NestJS ecosystem.
Built on @adonis-agora/context for
trace correlation; recorded by @adonis-agora/telescope.
Every Agora library is MIT and stays free. The work is funded by partners and sponsors — become one.
MIT © Davi Carvalho