@powerhousedao/opentelemetry-instrumentation-reactor 6.2.0 → 6.2.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InProcessReactorModule } from "@powerhousedao/reactor";
|
|
2
2
|
import * as _opentelemetry_api0 from "@opentelemetry/api";
|
|
3
3
|
|
|
4
4
|
//#region src/instrumentation.d.ts
|
|
@@ -10,7 +10,7 @@ declare class ReactorInstrumentation {
|
|
|
10
10
|
private pendingTimestamps;
|
|
11
11
|
private runningTimestamps;
|
|
12
12
|
private writeReadyTimestamps;
|
|
13
|
-
constructor(module:
|
|
13
|
+
constructor(module: InProcessReactorModule);
|
|
14
14
|
start(): void;
|
|
15
15
|
stop(): void;
|
|
16
16
|
private subscribeJobPending;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/instrumentation.ts","../src/metrics.ts"],"mappings":";;;;cA4Ba,sBAAA;EAAA,iBACM,MAAA;EAAA,QACT,OAAA;EAAA,QACA,YAAA;EAAA,QACA,mBAAA;EAAA,QAGA,iBAAA;EAAA,QACA,iBAAA;EAAA,QACA,oBAAA;cAEI,MAAA,EAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/instrumentation.ts","../src/metrics.ts"],"mappings":";;;;cA4Ba,sBAAA;EAAA,iBACM,MAAA;EAAA,QACT,OAAA;EAAA,QACA,YAAA;EAAA,QACA,mBAAA;EAAA,QAGA,iBAAA;EAAA,QACA,iBAAA;EAAA,QACA,oBAAA;cAEI,MAAA,EAAQ,sBAAA;EAIpB,KAAA,CAAA;EAuBA,IAAA,CAAA;EAAA,QAeQ,mBAAA;EAAA,QAgBA,mBAAA;EAAA,QAgBA,sBAAA;EAAA,QAgBA,qBAAA;EAAA,QA6BA,kBAAA;EAAA,QAuBA,6BAAA;EAAA,QA4BA,0BAAA;EAAA,QA4BA,gCAAA;EAAA,QA8BA,yBAAA;EAAA,QAmBA,wBAAA;EAAA,QAiBA,wBAAA;EAAA,QAoEA,2BAAA;EAAA,QA2CA,OAAA;AAAA;;;iBC1ZM,aAAA,CAAA;iDAAa,mBAAA,CAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;KA0JjB,cAAA,GAAiB,UAAA,QAAkB,aAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/metrics.ts","../src/instrumentation.ts"],"sourcesContent":["import { metrics } from \"@opentelemetry/api\";\n\nconst METER_NAME = \"@powerhousedao/reactor\";\n\nexport function createMetrics() {\n const meter = metrics.getMeter(METER_NAME);\n\n return {\n // Queue metrics\n queueJobsEnqueued: meter.createCounter(\"reactor.queue.jobs.enqueued\", {\n description: \"Jobs enqueued\",\n unit: \"{job}\",\n }),\n queueJobsDequeued: meter.createCounter(\"reactor.queue.jobs.dequeued\", {\n description: \"Jobs dequeued for execution\",\n unit: \"{job}\",\n }),\n queueJobsCompleted: meter.createCounter(\"reactor.queue.jobs.completed\", {\n description: \"Jobs completed (READ_READY)\",\n unit: \"{job}\",\n }),\n queueJobsFailed: meter.createCounter(\"reactor.queue.jobs.failed\", {\n description: \"Jobs permanently failed\",\n unit: \"{job}\",\n }),\n queueDepth: meter.createObservableGauge(\"reactor.queue.depth\", {\n description: \"Pending jobs across all queues\",\n unit: \"{job}\",\n }),\n\n // Executor metrics\n executorJobDuration: meter.createHistogram(\n \"reactor.executor.job.duration\",\n {\n description: \"Job execution time (RUNNING to WRITE_READY)\",\n unit: \"ms\",\n },\n ),\n executorActiveJobs: meter.createObservableGauge(\n \"reactor.executor.active_jobs\",\n {\n description: \"Currently executing jobs\",\n unit: \"{job}\",\n },\n ),\n executorTotalProcessed: meter.createCounter(\"reactor.executor.processed\", {\n description: \"Total jobs processed\",\n unit: \"{job}\",\n }),\n executorOperationsGenerated: meter.createCounter(\n \"reactor.executor.operations_generated\",\n {\n description: \"Operations produced by executors\",\n unit: \"{operation}\",\n },\n ),\n\n // Job lifecycle metrics\n jobTotalDuration: meter.createHistogram(\"reactor.job.total.duration\", {\n description: \"Full job lifecycle (PENDING to READ_READY/FAILED)\",\n unit: \"ms\",\n }),\n\n // Read model metrics\n readmodelIndexDuration: meter.createHistogram(\n \"reactor.readmodel.index.duration\",\n {\n description: \"Read model indexing time (WRITE_READY to READ_READY)\",\n unit: \"ms\",\n },\n ),\n readmodelCoordinatorChainDepth: meter.createObservableGauge(\n \"reactor.readmodel.coordinator.chain_depth\",\n {\n description:\n \"In-flight per-queueKey projection chains in the coordinator\",\n unit: \"{chain}\",\n },\n ),\n readmodelCoordinatorStageDuration: meter.createHistogram(\n \"reactor.readmodel.coordinator.stage.duration\",\n {\n description:\n \"Wall time per stage in ReadModelCoordinator.runChain (pre_ready, emit, post_ready)\",\n unit: \"ms\",\n },\n ),\n readmodelIndexingDuration: meter.createHistogram(\n \"reactor.readmodel.indexing.duration\",\n {\n description:\n \"Per-read-model indexing duration within a coordinator chain\",\n unit: \"ms\",\n },\n ),\n readmodelCoordinatorBatchSize: meter.createHistogram(\n \"reactor.readmodel.coordinator.batch.size\",\n {\n description: \"Operations per batch processed by the coordinator chain\",\n unit: \"{operation}\",\n },\n ),\n readmodelCoordinatorChainWaitDuration: meter.createHistogram(\n \"reactor.readmodel.coordinator.chain.wait_duration\",\n {\n description:\n \"Time a batch sat in the per-queueKey chain before runChain started\",\n unit: \"ms\",\n },\n ),\n\n // Postgres pool metrics\n dbPoolAcquireWaitDuration: meter.createHistogram(\n \"reactor.db.pool.acquire.wait_duration\",\n {\n description:\n \"Time spent waiting for a pg.Pool to hand out a client (pool.connect resolve latency)\",\n unit: \"ms\",\n },\n ),\n dbPoolSize: meter.createObservableGauge(\"reactor.db.pool.size\", {\n description: \"pg.Pool totalCount — connections currently open\",\n unit: \"{connection}\",\n }),\n dbPoolIdle: meter.createObservableGauge(\"reactor.db.pool.idle\", {\n description: \"pg.Pool idleCount — open connections not currently in use\",\n unit: \"{connection}\",\n }),\n dbPoolWaiting: meter.createObservableGauge(\"reactor.db.pool.waiting\", {\n description:\n \"pg.Pool waitingCount — callers queued waiting to acquire a connection\",\n unit: \"{request}\",\n }),\n\n // Event bus metrics\n eventbusEventsEmitted: meter.createCounter(\n \"reactor.eventbus.events.emitted\",\n {\n description: \"Events emitted\",\n unit: \"{event}\",\n },\n ),\n\n // Sync metrics\n syncRemotes: meter.createObservableGauge(\"reactor.sync.remotes\", {\n description: \"Active remote count\",\n unit: \"{remote}\",\n }),\n syncDeadLettersAdded: meter.createCounter(\n \"reactor.sync.dead_letters.added\",\n {\n description: \"Sync operations moved to dead letter storage\",\n unit: \"{operation}\",\n },\n ),\n };\n}\n\nexport type ReactorMetrics = ReturnType<typeof createMetrics>;\n","import {\n JobExecutorEventTypes,\n ReactorEventTypes,\n SyncEventTypes,\n} from \"@powerhousedao/reactor\";\nimport type {\n DeadLetterAddedEvent,\n IEventBus,\n IJobExecutorManager,\n IQueue,\n JobCompletedEvent,\n JobFailedEvent as ExecutorJobFailedEvent,\n JobPendingEvent,\n JobReadReadyEvent,\n JobRunningEvent,\n JobWriteReadyEvent,\n PoolInstrumentation,\n ReactorJobFailedEvent,\n ReadModelBatchCompletedEvent,\n ReadModelIndexedEvent,\n IReadModelCoordinator,\n ReactorModule,\n SyncModule,\n Unsubscribe,\n} from \"@powerhousedao/reactor\";\nimport type { ObservableCallback, ObservableGauge } from \"@opentelemetry/api\";\nimport { createMetrics, type ReactorMetrics } from \"./metrics.js\";\n\nexport class ReactorInstrumentation {\n private readonly module: ReactorModule;\n private metrics: ReactorMetrics | undefined;\n private unsubscribes: Unsubscribe[] = [];\n private observableCallbacks: Array<[ObservableGauge, ObservableCallback]> =\n [];\n\n private pendingTimestamps = new Map<string, number>();\n private runningTimestamps = new Map<string, number>();\n private writeReadyTimestamps = new Map<string, number>();\n\n constructor(module: ReactorModule) {\n this.module = module;\n }\n\n start(): void {\n this.metrics = createMetrics();\n const { eventBus, queue, executorManager, syncModule, pools } = this.module;\n\n this.subscribeJobPending(eventBus);\n this.subscribeJobRunning(eventBus);\n this.subscribeJobWriteReady(eventBus);\n this.subscribeJobReadReady(eventBus);\n this.subscribeJobFailed(eventBus);\n this.subscribeExecutorJobCompleted(eventBus);\n this.subscribeExecutorJobFailed(eventBus);\n this.subscribeDeadLetterAdded(eventBus);\n this.subscribeReadModelBatchCompleted(eventBus);\n this.subscribeReadModelIndexed(eventBus);\n this.registerObservableGauges(\n queue,\n executorManager,\n this.module.readModelCoordinator,\n syncModule,\n );\n this.registerPoolInstrumentation(pools);\n }\n\n stop(): void {\n for (const unsub of this.unsubscribes) {\n unsub();\n }\n this.unsubscribes = [];\n for (const [gauge, cb] of this.observableCallbacks) {\n gauge.removeCallback(cb);\n }\n this.observableCallbacks = [];\n this.pendingTimestamps.clear();\n this.runningTimestamps.clear();\n this.writeReadyTimestamps.clear();\n this.metrics = undefined;\n }\n\n private subscribeJobPending(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobPendingEvent>(\n ReactorEventTypes.JOB_PENDING,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsEnqueued.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_PENDING\",\n });\n this.pendingTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobRunning(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobRunningEvent>(\n ReactorEventTypes.JOB_RUNNING,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsDequeued.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_RUNNING\",\n });\n this.runningTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobWriteReady(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobWriteReadyEvent>(\n ReactorEventTypes.JOB_WRITE_READY,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.executorOperationsGenerated.add(event.operations.length);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_WRITE_READY\",\n });\n this.writeReadyTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobReadReady(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobReadReadyEvent>(\n ReactorEventTypes.JOB_READ_READY,\n (_type, event) => {\n if (!this.metrics) return;\n const writeReadyTs = this.writeReadyTimestamps.get(event.jobId);\n if (writeReadyTs !== undefined) {\n this.metrics.readmodelIndexDuration.record(\n performance.now() - writeReadyTs,\n );\n }\n const pendingTs = this.pendingTimestamps.get(event.jobId);\n if (pendingTs !== undefined) {\n this.metrics.jobTotalDuration.record(\n performance.now() - pendingTs,\n { \"job.success\": \"true\" },\n );\n }\n this.metrics.queueJobsCompleted.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_READ_READY\",\n });\n this.cleanup(event.jobId);\n },\n ),\n );\n }\n\n private subscribeJobFailed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReactorJobFailedEvent>(\n ReactorEventTypes.JOB_FAILED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsFailed.add(1);\n const pendingTs = this.pendingTimestamps.get(event.jobId);\n if (pendingTs !== undefined) {\n this.metrics.jobTotalDuration.record(\n performance.now() - pendingTs,\n { \"job.success\": \"false\" },\n );\n }\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_FAILED\",\n });\n this.cleanup(event.jobId);\n },\n ),\n );\n }\n\n private subscribeExecutorJobCompleted(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobCompletedEvent>(\n JobExecutorEventTypes.JOB_COMPLETED,\n (_type, event) => {\n if (!this.metrics) return;\n const workerId = event.workerId ?? \"unknown\";\n const jobId = event.job.id;\n const runningTs = this.runningTimestamps.get(jobId);\n if (runningTs !== undefined) {\n this.metrics.executorJobDuration.record(\n performance.now() - runningTs,\n { \"job.success\": \"true\", \"worker.id\": workerId },\n );\n this.runningTimestamps.delete(jobId);\n }\n this.metrics.executorTotalProcessed.add(1, {\n \"job.success\": \"true\",\n \"worker.id\": workerId,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"EXECUTOR_JOB_COMPLETED\",\n });\n },\n ),\n );\n }\n\n private subscribeExecutorJobFailed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ExecutorJobFailedEvent>(\n JobExecutorEventTypes.JOB_FAILED,\n (_type, event) => {\n if (!this.metrics) return;\n const workerId = event.workerId ?? \"unknown\";\n const jobId = event.job.id;\n const runningTs = this.runningTimestamps.get(jobId);\n if (runningTs !== undefined) {\n this.metrics.executorJobDuration.record(\n performance.now() - runningTs,\n { \"job.success\": \"false\", \"worker.id\": workerId },\n );\n this.runningTimestamps.delete(jobId);\n }\n this.metrics.executorTotalProcessed.add(1, {\n \"job.success\": \"false\",\n \"worker.id\": workerId,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"EXECUTOR_JOB_FAILED\",\n });\n },\n ),\n );\n }\n\n private subscribeReadModelBatchCompleted(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReadModelBatchCompletedEvent>(\n ReactorEventTypes.READMODEL_BATCH_COMPLETED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.readmodelCoordinatorChainWaitDuration.record(\n event.chainWaitDurationMs,\n );\n this.metrics.readmodelCoordinatorBatchSize.record(event.batchSize);\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.preReadyDurationMs,\n { stage: \"pre_ready\" },\n );\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.emitDurationMs,\n { stage: \"emit\" },\n );\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.postReadyDurationMs,\n { stage: \"post_ready\" },\n );\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"READMODEL_BATCH_COMPLETED\",\n });\n },\n ),\n );\n }\n\n private subscribeReadModelIndexed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReadModelIndexedEvent>(\n ReactorEventTypes.READMODEL_INDEXED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.readmodelIndexingDuration.record(event.durationMs, {\n \"read_model.name\": event.readModelName,\n stage: event.stage,\n \"indexing.success\": event.success ? \"true\" : \"false\",\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"READMODEL_INDEXED\",\n });\n },\n ),\n );\n }\n\n private subscribeDeadLetterAdded(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<DeadLetterAddedEvent>(\n SyncEventTypes.DEAD_LETTER_ADDED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.syncDeadLettersAdded.add(1, {\n \"remote.name\": event.remoteName,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"DEAD_LETTER_ADDED\",\n });\n },\n ),\n );\n }\n\n private registerObservableGauges(\n queue: IQueue,\n executorManager: IJobExecutorManager,\n readModelCoordinator: IReadModelCoordinator,\n syncModule: SyncModule | undefined,\n ): void {\n if (!this.metrics) return;\n\n const depthCb: ObservableCallback = async (result) => {\n if (!this.metrics) return;\n // queue.totalSize() is a DB query. If it exceeds the OTel collection\n // window the observation is silently dropped, making the gauge appear\n // to drop to zero under load. The timeout makes the failure explicit.\n const TIMEOUT_MS = 2_000;\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n try {\n const depth = await Promise.race([\n queue.totalSize(),\n new Promise<never>((_, reject) => {\n timeoutId = setTimeout(\n () => reject(new Error(\"queue.totalSize() timed out\")),\n TIMEOUT_MS,\n );\n }),\n ]);\n result.observe(depth);\n } catch (err) {\n console.warn(\n \"[ReactorInstrumentation] queueDepth observation failed:\",\n err,\n );\n } finally {\n clearTimeout(timeoutId);\n }\n };\n this.metrics.queueDepth.addCallback(depthCb);\n this.observableCallbacks.push([this.metrics.queueDepth, depthCb]);\n\n const activeJobsCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n const status = executorManager.getStatus();\n result.observe(status.activeJobs);\n };\n this.metrics.executorActiveJobs.addCallback(activeJobsCb);\n this.observableCallbacks.push([\n this.metrics.executorActiveJobs,\n activeJobsCb,\n ]);\n\n const chainDepthCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n result.observe(readModelCoordinator.getChainDepth());\n };\n this.metrics.readmodelCoordinatorChainDepth.addCallback(chainDepthCb);\n this.observableCallbacks.push([\n this.metrics.readmodelCoordinatorChainDepth,\n chainDepthCb,\n ]);\n\n const remotesCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n const count = syncModule?.syncManager.list().length ?? 0;\n result.observe(count);\n };\n this.metrics.syncRemotes.addCallback(remotesCb);\n this.observableCallbacks.push([this.metrics.syncRemotes, remotesCb]);\n }\n\n private registerPoolInstrumentation(pools: PoolInstrumentation[]): void {\n if (!this.metrics || pools.length === 0) return;\n\n for (const pool of pools) {\n const attrs = { pool: pool.name };\n const unsub = pool.onAcquire((durationMs) => {\n if (!this.metrics) return;\n this.metrics.dbPoolAcquireWaitDuration.record(durationMs, attrs);\n });\n this.unsubscribes.push(unsub);\n }\n\n const sizeCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.size, { pool: pool.name });\n }\n };\n this.metrics.dbPoolSize.addCallback(sizeCb);\n this.observableCallbacks.push([this.metrics.dbPoolSize, sizeCb]);\n\n const idleCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.idle, { pool: pool.name });\n }\n };\n this.metrics.dbPoolIdle.addCallback(idleCb);\n this.observableCallbacks.push([this.metrics.dbPoolIdle, idleCb]);\n\n const waitingCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.waiting, { pool: pool.name });\n }\n };\n this.metrics.dbPoolWaiting.addCallback(waitingCb);\n this.observableCallbacks.push([this.metrics.dbPoolWaiting, waitingCb]);\n }\n\n private cleanup(jobId: string): void {\n this.pendingTimestamps.delete(jobId);\n this.runningTimestamps.delete(jobId);\n this.writeReadyTimestamps.delete(jobId);\n }\n}\n"],"mappings":";;;AAEA,MAAM,aAAa;AAEnB,SAAgB,gBAAgB;CAC9B,MAAM,QAAQ,QAAQ,SAAS,WAAW;AAE1C,QAAO;EAEL,mBAAmB,MAAM,cAAc,+BAA+B;GACpE,aAAa;GACb,MAAM;GACP,CAAC;EACF,mBAAmB,MAAM,cAAc,+BAA+B;GACpE,aAAa;GACb,MAAM;GACP,CAAC;EACF,oBAAoB,MAAM,cAAc,gCAAgC;GACtE,aAAa;GACb,MAAM;GACP,CAAC;EACF,iBAAiB,MAAM,cAAc,6BAA6B;GAChE,aAAa;GACb,MAAM;GACP,CAAC;EACF,YAAY,MAAM,sBAAsB,uBAAuB;GAC7D,aAAa;GACb,MAAM;GACP,CAAC;EAGF,qBAAqB,MAAM,gBACzB,iCACA;GACE,aAAa;GACb,MAAM;GACP,CACF;EACD,oBAAoB,MAAM,sBACxB,gCACA;GACE,aAAa;GACb,MAAM;GACP,CACF;EACD,wBAAwB,MAAM,cAAc,8BAA8B;GACxE,aAAa;GACb,MAAM;GACP,CAAC;EACF,6BAA6B,MAAM,cACjC,yCACA;GACE,aAAa;GACb,MAAM;GACP,CACF;EAGD,kBAAkB,MAAM,gBAAgB,8BAA8B;GACpE,aAAa;GACb,MAAM;GACP,CAAC;EAGF,wBAAwB,MAAM,gBAC5B,oCACA;GACE,aAAa;GACb,MAAM;GACP,CACF;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OAAO;AAC3C,OAAK,oBAAoB,KAAK,CAAC,KAAK,QAAQ,YAAY,OAAO,CAAC;EAEhE,MAAM,UAA8B,WAAW;AAC7C,OAAI,CAAC,KAAK,QAAS;AACnB,QAAK,MAAM,QAAQ,OAAO;IACxB,MAAM,QAAQ,KAAK,UAAU;AAC7B,WAAO,QAAQ,MAAM,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;;;AAGnD,OAAK,QAAQ,WAAW,YAAY,OAAO;AAC3C,OAAK,oBAAoB,KAAK,CAAC,KAAK,QAAQ,YAAY,OAAO,CAAC;EAEhE,MAAM,aAAiC,WAAW;AAChD,OAAI,CAAC,KAAK,QAAS;AACnB,QAAK,MAAM,QAAQ,OAAO;IACxB,MAAM,QAAQ,KAAK,UAAU;AAC7B,WAAO,QAAQ,MAAM,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;;;AAGtD,OAAK,QAAQ,cAAc,YAAY,UAAU;AACjD,OAAK,oBAAoB,KAAK,CAAC,KAAK,QAAQ,eAAe,UAAU,CAAC;;CAGxE,QAAgB,OAAqB;AACnC,OAAK,kBAAkB,OAAO,MAAM;AACpC,OAAK,kBAAkB,OAAO,MAAM;AACpC,OAAK,qBAAqB,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/metrics.ts","../src/instrumentation.ts"],"sourcesContent":["import { metrics } from \"@opentelemetry/api\";\n\nconst METER_NAME = \"@powerhousedao/reactor\";\n\nexport function createMetrics() {\n const meter = metrics.getMeter(METER_NAME);\n\n return {\n // Queue metrics\n queueJobsEnqueued: meter.createCounter(\"reactor.queue.jobs.enqueued\", {\n description: \"Jobs enqueued\",\n unit: \"{job}\",\n }),\n queueJobsDequeued: meter.createCounter(\"reactor.queue.jobs.dequeued\", {\n description: \"Jobs dequeued for execution\",\n unit: \"{job}\",\n }),\n queueJobsCompleted: meter.createCounter(\"reactor.queue.jobs.completed\", {\n description: \"Jobs completed (READ_READY)\",\n unit: \"{job}\",\n }),\n queueJobsFailed: meter.createCounter(\"reactor.queue.jobs.failed\", {\n description: \"Jobs permanently failed\",\n unit: \"{job}\",\n }),\n queueDepth: meter.createObservableGauge(\"reactor.queue.depth\", {\n description: \"Pending jobs across all queues\",\n unit: \"{job}\",\n }),\n\n // Executor metrics\n executorJobDuration: meter.createHistogram(\n \"reactor.executor.job.duration\",\n {\n description: \"Job execution time (RUNNING to WRITE_READY)\",\n unit: \"ms\",\n },\n ),\n executorActiveJobs: meter.createObservableGauge(\n \"reactor.executor.active_jobs\",\n {\n description: \"Currently executing jobs\",\n unit: \"{job}\",\n },\n ),\n executorTotalProcessed: meter.createCounter(\"reactor.executor.processed\", {\n description: \"Total jobs processed\",\n unit: \"{job}\",\n }),\n executorOperationsGenerated: meter.createCounter(\n \"reactor.executor.operations_generated\",\n {\n description: \"Operations produced by executors\",\n unit: \"{operation}\",\n },\n ),\n\n // Job lifecycle metrics\n jobTotalDuration: meter.createHistogram(\"reactor.job.total.duration\", {\n description: \"Full job lifecycle (PENDING to READ_READY/FAILED)\",\n unit: \"ms\",\n }),\n\n // Read model metrics\n readmodelIndexDuration: meter.createHistogram(\n \"reactor.readmodel.index.duration\",\n {\n description: \"Read model indexing time (WRITE_READY to READ_READY)\",\n unit: \"ms\",\n },\n ),\n readmodelCoordinatorChainDepth: meter.createObservableGauge(\n \"reactor.readmodel.coordinator.chain_depth\",\n {\n description:\n \"In-flight per-queueKey projection chains in the coordinator\",\n unit: \"{chain}\",\n },\n ),\n readmodelCoordinatorStageDuration: meter.createHistogram(\n \"reactor.readmodel.coordinator.stage.duration\",\n {\n description:\n \"Wall time per stage in ReadModelCoordinator.runChain (pre_ready, emit, post_ready)\",\n unit: \"ms\",\n },\n ),\n readmodelIndexingDuration: meter.createHistogram(\n \"reactor.readmodel.indexing.duration\",\n {\n description:\n \"Per-read-model indexing duration within a coordinator chain\",\n unit: \"ms\",\n },\n ),\n readmodelCoordinatorBatchSize: meter.createHistogram(\n \"reactor.readmodel.coordinator.batch.size\",\n {\n description: \"Operations per batch processed by the coordinator chain\",\n unit: \"{operation}\",\n },\n ),\n readmodelCoordinatorChainWaitDuration: meter.createHistogram(\n \"reactor.readmodel.coordinator.chain.wait_duration\",\n {\n description:\n \"Time a batch sat in the per-queueKey chain before runChain started\",\n unit: \"ms\",\n },\n ),\n\n // Postgres pool metrics\n dbPoolAcquireWaitDuration: meter.createHistogram(\n \"reactor.db.pool.acquire.wait_duration\",\n {\n description:\n \"Time spent waiting for a pg.Pool to hand out a client (pool.connect resolve latency)\",\n unit: \"ms\",\n },\n ),\n dbPoolSize: meter.createObservableGauge(\"reactor.db.pool.size\", {\n description: \"pg.Pool totalCount — connections currently open\",\n unit: \"{connection}\",\n }),\n dbPoolIdle: meter.createObservableGauge(\"reactor.db.pool.idle\", {\n description: \"pg.Pool idleCount — open connections not currently in use\",\n unit: \"{connection}\",\n }),\n dbPoolWaiting: meter.createObservableGauge(\"reactor.db.pool.waiting\", {\n description:\n \"pg.Pool waitingCount — callers queued waiting to acquire a connection\",\n unit: \"{request}\",\n }),\n\n // Event bus metrics\n eventbusEventsEmitted: meter.createCounter(\n \"reactor.eventbus.events.emitted\",\n {\n description: \"Events emitted\",\n unit: \"{event}\",\n },\n ),\n\n // Sync metrics\n syncRemotes: meter.createObservableGauge(\"reactor.sync.remotes\", {\n description: \"Active remote count\",\n unit: \"{remote}\",\n }),\n syncDeadLettersAdded: meter.createCounter(\n \"reactor.sync.dead_letters.added\",\n {\n description: \"Sync operations moved to dead letter storage\",\n unit: \"{operation}\",\n },\n ),\n };\n}\n\nexport type ReactorMetrics = ReturnType<typeof createMetrics>;\n","import {\n JobExecutorEventTypes,\n ReactorEventTypes,\n SyncEventTypes,\n} from \"@powerhousedao/reactor\";\nimport type {\n DeadLetterAddedEvent,\n IEventBus,\n IJobExecutorManager,\n IQueue,\n JobCompletedEvent,\n JobFailedEvent as ExecutorJobFailedEvent,\n JobPendingEvent,\n JobReadReadyEvent,\n JobRunningEvent,\n JobWriteReadyEvent,\n PoolInstrumentation,\n ReactorJobFailedEvent,\n ReadModelBatchCompletedEvent,\n ReadModelIndexedEvent,\n IReadModelCoordinator,\n InProcessReactorModule,\n SyncModule,\n Unsubscribe,\n} from \"@powerhousedao/reactor\";\nimport type { ObservableCallback, ObservableGauge } from \"@opentelemetry/api\";\nimport { createMetrics, type ReactorMetrics } from \"./metrics.js\";\n\nexport class ReactorInstrumentation {\n private readonly module: InProcessReactorModule;\n private metrics: ReactorMetrics | undefined;\n private unsubscribes: Unsubscribe[] = [];\n private observableCallbacks: Array<[ObservableGauge, ObservableCallback]> =\n [];\n\n private pendingTimestamps = new Map<string, number>();\n private runningTimestamps = new Map<string, number>();\n private writeReadyTimestamps = new Map<string, number>();\n\n constructor(module: InProcessReactorModule) {\n this.module = module;\n }\n\n start(): void {\n this.metrics = createMetrics();\n const { eventBus, queue, executorManager, syncModule, pools } = this.module;\n\n this.subscribeJobPending(eventBus);\n this.subscribeJobRunning(eventBus);\n this.subscribeJobWriteReady(eventBus);\n this.subscribeJobReadReady(eventBus);\n this.subscribeJobFailed(eventBus);\n this.subscribeExecutorJobCompleted(eventBus);\n this.subscribeExecutorJobFailed(eventBus);\n this.subscribeDeadLetterAdded(eventBus);\n this.subscribeReadModelBatchCompleted(eventBus);\n this.subscribeReadModelIndexed(eventBus);\n this.registerObservableGauges(\n queue,\n executorManager,\n this.module.readModelCoordinator,\n syncModule,\n );\n this.registerPoolInstrumentation(pools);\n }\n\n stop(): void {\n for (const unsub of this.unsubscribes) {\n unsub();\n }\n this.unsubscribes = [];\n for (const [gauge, cb] of this.observableCallbacks) {\n gauge.removeCallback(cb);\n }\n this.observableCallbacks = [];\n this.pendingTimestamps.clear();\n this.runningTimestamps.clear();\n this.writeReadyTimestamps.clear();\n this.metrics = undefined;\n }\n\n private subscribeJobPending(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobPendingEvent>(\n ReactorEventTypes.JOB_PENDING,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsEnqueued.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_PENDING\",\n });\n this.pendingTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobRunning(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobRunningEvent>(\n ReactorEventTypes.JOB_RUNNING,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsDequeued.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_RUNNING\",\n });\n this.runningTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobWriteReady(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobWriteReadyEvent>(\n ReactorEventTypes.JOB_WRITE_READY,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.executorOperationsGenerated.add(event.operations.length);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_WRITE_READY\",\n });\n this.writeReadyTimestamps.set(event.jobId, performance.now());\n },\n ),\n );\n }\n\n private subscribeJobReadReady(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobReadReadyEvent>(\n ReactorEventTypes.JOB_READ_READY,\n (_type, event) => {\n if (!this.metrics) return;\n const writeReadyTs = this.writeReadyTimestamps.get(event.jobId);\n if (writeReadyTs !== undefined) {\n this.metrics.readmodelIndexDuration.record(\n performance.now() - writeReadyTs,\n );\n }\n const pendingTs = this.pendingTimestamps.get(event.jobId);\n if (pendingTs !== undefined) {\n this.metrics.jobTotalDuration.record(\n performance.now() - pendingTs,\n { \"job.success\": \"true\" },\n );\n }\n this.metrics.queueJobsCompleted.add(1);\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_READ_READY\",\n });\n this.cleanup(event.jobId);\n },\n ),\n );\n }\n\n private subscribeJobFailed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReactorJobFailedEvent>(\n ReactorEventTypes.JOB_FAILED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.queueJobsFailed.add(1);\n const pendingTs = this.pendingTimestamps.get(event.jobId);\n if (pendingTs !== undefined) {\n this.metrics.jobTotalDuration.record(\n performance.now() - pendingTs,\n { \"job.success\": \"false\" },\n );\n }\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"JOB_FAILED\",\n });\n this.cleanup(event.jobId);\n },\n ),\n );\n }\n\n private subscribeExecutorJobCompleted(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<JobCompletedEvent>(\n JobExecutorEventTypes.JOB_COMPLETED,\n (_type, event) => {\n if (!this.metrics) return;\n const workerId = event.workerId ?? \"unknown\";\n const jobId = event.job.id;\n const runningTs = this.runningTimestamps.get(jobId);\n if (runningTs !== undefined) {\n this.metrics.executorJobDuration.record(\n performance.now() - runningTs,\n { \"job.success\": \"true\", \"worker.id\": workerId },\n );\n this.runningTimestamps.delete(jobId);\n }\n this.metrics.executorTotalProcessed.add(1, {\n \"job.success\": \"true\",\n \"worker.id\": workerId,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"EXECUTOR_JOB_COMPLETED\",\n });\n },\n ),\n );\n }\n\n private subscribeExecutorJobFailed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ExecutorJobFailedEvent>(\n JobExecutorEventTypes.JOB_FAILED,\n (_type, event) => {\n if (!this.metrics) return;\n const workerId = event.workerId ?? \"unknown\";\n const jobId = event.job.id;\n const runningTs = this.runningTimestamps.get(jobId);\n if (runningTs !== undefined) {\n this.metrics.executorJobDuration.record(\n performance.now() - runningTs,\n { \"job.success\": \"false\", \"worker.id\": workerId },\n );\n this.runningTimestamps.delete(jobId);\n }\n this.metrics.executorTotalProcessed.add(1, {\n \"job.success\": \"false\",\n \"worker.id\": workerId,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"EXECUTOR_JOB_FAILED\",\n });\n },\n ),\n );\n }\n\n private subscribeReadModelBatchCompleted(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReadModelBatchCompletedEvent>(\n ReactorEventTypes.READMODEL_BATCH_COMPLETED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.readmodelCoordinatorChainWaitDuration.record(\n event.chainWaitDurationMs,\n );\n this.metrics.readmodelCoordinatorBatchSize.record(event.batchSize);\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.preReadyDurationMs,\n { stage: \"pre_ready\" },\n );\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.emitDurationMs,\n { stage: \"emit\" },\n );\n this.metrics.readmodelCoordinatorStageDuration.record(\n event.postReadyDurationMs,\n { stage: \"post_ready\" },\n );\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"READMODEL_BATCH_COMPLETED\",\n });\n },\n ),\n );\n }\n\n private subscribeReadModelIndexed(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<ReadModelIndexedEvent>(\n ReactorEventTypes.READMODEL_INDEXED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.readmodelIndexingDuration.record(event.durationMs, {\n \"read_model.name\": event.readModelName,\n stage: event.stage,\n \"indexing.success\": event.success ? \"true\" : \"false\",\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"READMODEL_INDEXED\",\n });\n },\n ),\n );\n }\n\n private subscribeDeadLetterAdded(eventBus: IEventBus): void {\n this.unsubscribes.push(\n eventBus.subscribe<DeadLetterAddedEvent>(\n SyncEventTypes.DEAD_LETTER_ADDED,\n (_type, event) => {\n if (!this.metrics) return;\n this.metrics.syncDeadLettersAdded.add(1, {\n \"remote.name\": event.remoteName,\n });\n this.metrics.eventbusEventsEmitted.add(1, {\n \"event.type\": \"DEAD_LETTER_ADDED\",\n });\n },\n ),\n );\n }\n\n private registerObservableGauges(\n queue: IQueue,\n executorManager: IJobExecutorManager,\n readModelCoordinator: IReadModelCoordinator,\n syncModule: SyncModule | undefined,\n ): void {\n if (!this.metrics) return;\n\n const depthCb: ObservableCallback = async (result) => {\n if (!this.metrics) return;\n // queue.totalSize() is a DB query. If it exceeds the OTel collection\n // window the observation is silently dropped, making the gauge appear\n // to drop to zero under load. The timeout makes the failure explicit.\n const TIMEOUT_MS = 2_000;\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n try {\n const depth = await Promise.race([\n queue.totalSize(),\n new Promise<never>((_, reject) => {\n timeoutId = setTimeout(\n () => reject(new Error(\"queue.totalSize() timed out\")),\n TIMEOUT_MS,\n );\n }),\n ]);\n result.observe(depth);\n } catch (err) {\n console.warn(\n \"[ReactorInstrumentation] queueDepth observation failed:\",\n err,\n );\n } finally {\n clearTimeout(timeoutId);\n }\n };\n this.metrics.queueDepth.addCallback(depthCb);\n this.observableCallbacks.push([this.metrics.queueDepth, depthCb]);\n\n const activeJobsCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n const status = executorManager.getStatus();\n result.observe(status.activeJobs);\n };\n this.metrics.executorActiveJobs.addCallback(activeJobsCb);\n this.observableCallbacks.push([\n this.metrics.executorActiveJobs,\n activeJobsCb,\n ]);\n\n const chainDepthCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n result.observe(readModelCoordinator.getChainDepth());\n };\n this.metrics.readmodelCoordinatorChainDepth.addCallback(chainDepthCb);\n this.observableCallbacks.push([\n this.metrics.readmodelCoordinatorChainDepth,\n chainDepthCb,\n ]);\n\n const remotesCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n const count = syncModule?.syncManager.list().length ?? 0;\n result.observe(count);\n };\n this.metrics.syncRemotes.addCallback(remotesCb);\n this.observableCallbacks.push([this.metrics.syncRemotes, remotesCb]);\n }\n\n private registerPoolInstrumentation(pools: PoolInstrumentation[]): void {\n if (!this.metrics || pools.length === 0) return;\n\n for (const pool of pools) {\n const attrs = { pool: pool.name };\n const unsub = pool.onAcquire((durationMs) => {\n if (!this.metrics) return;\n this.metrics.dbPoolAcquireWaitDuration.record(durationMs, attrs);\n });\n this.unsubscribes.push(unsub);\n }\n\n const sizeCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.size, { pool: pool.name });\n }\n };\n this.metrics.dbPoolSize.addCallback(sizeCb);\n this.observableCallbacks.push([this.metrics.dbPoolSize, sizeCb]);\n\n const idleCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.idle, { pool: pool.name });\n }\n };\n this.metrics.dbPoolIdle.addCallback(idleCb);\n this.observableCallbacks.push([this.metrics.dbPoolIdle, idleCb]);\n\n const waitingCb: ObservableCallback = (result) => {\n if (!this.metrics) return;\n for (const pool of pools) {\n const stats = pool.getStats();\n result.observe(stats.waiting, { pool: pool.name });\n }\n };\n this.metrics.dbPoolWaiting.addCallback(waitingCb);\n this.observableCallbacks.push([this.metrics.dbPoolWaiting, waitingCb]);\n }\n\n private cleanup(jobId: string): void {\n this.pendingTimestamps.delete(jobId);\n this.runningTimestamps.delete(jobId);\n this.writeReadyTimestamps.delete(jobId);\n }\n}\n"],"mappings":";;;AAEA,MAAM,aAAa;AAEnB,SAAgB,gBAAgB;CAC9B,MAAM,QAAQ,QAAQ,SAAS,WAAW;AAE1C,QAAO;EAEL,mBAAmB,MAAM,cAAc,+BAA+B;GACpE,aAAa;GACb,MAAM;GACP,CAAC;EACF,mBAAmB,MAAM,cAAc,+BAA+B;GACpE,aAAa;GACb,MAAM;GACP,CAAC;EACF,oBAAoB,MAAM,cAAc,gCAAgC;GACtE,aAAa;GACb,MAAM;GACP,CAAC;EACF,iBAAiB,MAAM,cAAc,6BAA6B;GAChE,aAAa;GACb,MAAM;GACP,CAAC;EACF,YAAY,MAAM,sBAAsB,uBAAuB;GAC7D,aAAa;GACb,MAAM;GACP,CAAC;EAGF,qBAAqB,MAAM,gBACzB,iCACA;GACE,aAAa;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|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.1-dev.1",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for @powerhousedao/reactor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"tsdown": "0.21.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@powerhousedao/reactor": "6.2.
|
|
40
|
+
"@powerhousedao/reactor": "6.2.1-dev.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"tsc": "tsc",
|