@osfactory/otel-hook 0.9.0 → 0.11.0
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/README.md +124 -4
- package/dist/{adapter-BJiz6lqM.d.ts → adapter-DiLknaTF.d.ts} +14 -2
- package/dist/cli.js +2272 -730
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +13 -4
- package/dist/config.js +128 -23
- package/dist/config.js.map +1 -1
- package/dist/{destinations-C6Bm89W6.d.ts → destinations-BIl3gGzx.d.ts} +12 -2
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/{events-B3MHoJTD.d.ts → events-CSD_YiJ2.d.ts} +2 -0
- package/dist/{export-destinations-d8tZV0G4.d.ts → export-destinations-QWKGGEjk.d.ts} +131 -6
- package/dist/{filesystem-store-r-nNA3BA.d.ts → filesystem-store-D3SCNmbX.d.ts} +1 -1
- package/dist/{hook-zA1b4cWd.d.ts → hook-BOecWGSz.d.ts} +10 -5
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1808 -251
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +4 -4
- package/dist/install.js +31 -2
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +37 -12
- package/dist/integration.js +3271 -1551
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +55 -4
- package/dist/lifecycle.js +277 -4
- package/dist/lifecycle.js.map +1 -1
- package/dist/{memory-Bl9ANVff.d.ts → memory-Cs51jyRk.d.ts} +2 -2
- package/dist/{semconv-fPRb-dpU.d.ts → metric-model-DDnWxL9d.d.ts} +154 -2
- package/dist/model.d.ts +1 -1
- package/dist/model.js +7 -0
- package/dist/model.js.map +1 -1
- package/dist/{payload-Ci8_ERm6.d.ts → payload-ChtrEX6A.d.ts} +41 -2
- package/dist/{ports-n7KFOpKo.d.ts → ports-CeqLq31i.d.ts} +87 -2
- package/dist/providers.d.ts +146 -10
- package/dist/providers.js +397 -13
- package/dist/providers.js.map +1 -1
- package/dist/{registry-B8ZHc2bc.d.ts → registry-CcJNF3WY.d.ts} +2 -2
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +1404 -1219
- package/dist/runtime.js.map +1 -1
- package/dist/{schema-BxiVsU-d.d.ts → schema-DMnoU1V_.d.ts} +93 -1
- package/dist/state.d.ts +4 -4
- package/dist/state.js +630 -39
- package/dist/state.js.map +1 -1
- package/dist/telemetry.d.ts +6 -6
- package/dist/telemetry.js +872 -19
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +11 -9
- package/dist/testing.js +264 -34
- package/dist/testing.js.map +1 -1
- package/package.json +3 -1
package/dist/integration.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { O as OtelHookConfig } from './schema-
|
|
1
|
+
import { O as OtelHookConfig } from './schema-DMnoU1V_.js';
|
|
2
2
|
import { OverallHealth } from './diagnostics.js';
|
|
3
3
|
import { OtelHookErrorInfo } from './errors.js';
|
|
4
|
-
import { DeliveryClaimOutcome, UsageAccumulatorSnapshot, LifecycleCleanupReport, CallbackDeduplicator, UsageAccumulator, SpanCorrelator, LifecycleJanitor } from './lifecycle.js';
|
|
4
|
+
import { DeliveryClaimOutcome, UsageAccumulatorSnapshot, LifecycleCleanupReport, CallbackDeduplicator, UsageAccumulator, SpanCorrelator, MetricSeriesStore, LifecycleJanitor } from './lifecycle.js';
|
|
5
5
|
import { P as PrivacyService } from './service-CbI9CObT.js';
|
|
6
|
-
import { P as ProviderRegistry } from './registry-
|
|
7
|
-
import { a as DeliveryOrigin, c as DeliveryUnavailableReason, H as HookIngestInput, e as HookIngestOutcome, U as UsageObservation, O as OtelHook } from './hook-
|
|
8
|
-
import { C as Clock, I as IdGenerator, d as Logger, W as WorktreeLocator } from './ports-
|
|
9
|
-
import { F as FilesystemStateStore } from './filesystem-store-
|
|
10
|
-
import {
|
|
6
|
+
import { P as ProviderRegistry } from './registry-CcJNF3WY.js';
|
|
7
|
+
import { a as DeliveryOrigin, c as DeliveryUnavailableReason, H as HookIngestInput, e as HookIngestOutcome, U as UsageObservation, O as OtelHook } from './hook-BOecWGSz.js';
|
|
8
|
+
import { C as Clock, I as IdGenerator, d as Logger, W as WorktreeLocator, P as PayloadEnricher } from './ports-CeqLq31i.js';
|
|
9
|
+
import { F as FilesystemStateStore } from './filesystem-store-D3SCNmbX.js';
|
|
10
|
+
import { w as OtlpTelemetrySink, t as OtlpLogTelemetrySink, d as DurableSpool, D as DurableLogSpool, E as ExportDestinationSinks, B as SkippedExportDestination } from './export-destinations-QWKGGEjk.js';
|
|
11
11
|
import 'zod';
|
|
12
12
|
import './primitives-CJ8-rn-f.js';
|
|
13
13
|
import './taxonomy-DwhTtuWd.js';
|
|
14
14
|
import '@opentelemetry/api';
|
|
15
|
-
import './events-
|
|
16
|
-
import './
|
|
15
|
+
import './events-CSD_YiJ2.js';
|
|
16
|
+
import './metric-model-DDnWxL9d.js';
|
|
17
17
|
import '@opentelemetry/core';
|
|
18
18
|
import '@opentelemetry/resources';
|
|
19
19
|
import '@opentelemetry/sdk-trace';
|
|
20
20
|
import './content-M9xIKG7h.js';
|
|
21
21
|
import './policy-CimmCfRp.js';
|
|
22
|
-
import './adapter-
|
|
22
|
+
import './adapter-DiLknaTF.js';
|
|
23
23
|
import './identity-BrVBs901.js';
|
|
24
24
|
import './keys-Dej5bN3L.js';
|
|
25
|
-
import './destinations-
|
|
25
|
+
import './destinations-BIl3gGzx.js';
|
|
26
26
|
import '@opentelemetry/sdk-logs';
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -189,11 +189,27 @@ type HookProcessOutcome = {
|
|
|
189
189
|
readonly delivery: DeliveryReport;
|
|
190
190
|
/** Running per-scope totals after applying this invocation's deltas. */
|
|
191
191
|
readonly usageRollups: readonly UsageRollup[];
|
|
192
|
+
/**
|
|
193
|
+
* Hook-derived metrics for this callback (issue #69). Absent when no destination
|
|
194
|
+
* takes metrics, or when nothing was recorded (a redelivery, a callback whose
|
|
195
|
+
* telemetry was lost and will be retried, or a batch with nothing to measure).
|
|
196
|
+
*/
|
|
197
|
+
readonly metrics?: MetricsReport;
|
|
192
198
|
/** Cleanup performed opportunistically; absent when no sweep ran. */
|
|
193
199
|
readonly cleanup?: LifecycleCleanupReport;
|
|
194
200
|
/** Diagnostics raised by this module, in addition to `ingest.diagnostics`. */
|
|
195
201
|
readonly diagnostics: readonly OtelHookErrorInfo[];
|
|
196
202
|
};
|
|
203
|
+
type MetricsReport = {
|
|
204
|
+
/** Data points derived for this callback, before fan-out. */
|
|
205
|
+
readonly points: number;
|
|
206
|
+
/** Per destination taking metrics: points delivered or spooled, and refused. */
|
|
207
|
+
readonly destinations: readonly {
|
|
208
|
+
readonly name: string;
|
|
209
|
+
readonly accepted: number;
|
|
210
|
+
readonly rejected: number;
|
|
211
|
+
}[];
|
|
212
|
+
};
|
|
197
213
|
type UsageRollup = {
|
|
198
214
|
readonly scope: UsageObservation["scope"];
|
|
199
215
|
readonly scopeKey: string;
|
|
@@ -229,6 +245,8 @@ interface HookRuntime {
|
|
|
229
245
|
readonly usageAccumulator: UsageAccumulator;
|
|
230
246
|
/** Backs the cross-process pairing the sink applies to every exported span. */
|
|
231
247
|
readonly spanCorrelator: SpanCorrelator;
|
|
248
|
+
/** Cumulative metric series state (issue #69). */
|
|
249
|
+
readonly metricSeries: MetricSeriesStore;
|
|
232
250
|
readonly janitor: LifecycleJanitor;
|
|
233
251
|
/** Ingest one observation, then apply lifecycle accumulation. Never throws. */
|
|
234
252
|
process(input: HookProcessInput): Promise<HookProcessOutcome>;
|
|
@@ -302,6 +320,13 @@ type HookRuntimeOptions = {
|
|
|
302
320
|
* `null` to disable resolution entirely.
|
|
303
321
|
*/
|
|
304
322
|
readonly worktreeLocator?: WorktreeLocator | null;
|
|
323
|
+
/**
|
|
324
|
+
* Payload enrichers run before the adapter parses (see `PayloadEnricher`).
|
|
325
|
+
* When absent, the configuration decides: `providers.claudeCode.readTranscriptUsage`
|
|
326
|
+
* adds the Claude Code transcript-usage enricher, and nothing else is added.
|
|
327
|
+
* Pass `[]` to run none regardless of configuration.
|
|
328
|
+
*/
|
|
329
|
+
readonly payloadEnrichers?: readonly PayloadEnricher[];
|
|
305
330
|
};
|
|
306
331
|
/**
|
|
307
332
|
* Smallest stale-claim window that cannot expire while a live process is still
|
|
@@ -329,4 +354,4 @@ declare const minimumStaleClaimMillis: (input: {
|
|
|
329
354
|
}) => number;
|
|
330
355
|
declare const createHookRuntime: (options: HookRuntimeOptions) => HookRuntime;
|
|
331
356
|
|
|
332
|
-
export { type DeliveryReport, type HookProcessInput, type HookProcessOutcome, type HookRuntime, type HookRuntimeDelivery, type HookRuntimeOptions, type HookShutdownReport, type UsageRollup, createHookRuntime, minimumStaleClaimMillis };
|
|
357
|
+
export { type DeliveryReport, type HookProcessInput, type HookProcessOutcome, type HookRuntime, type HookRuntimeDelivery, type HookRuntimeOptions, type HookShutdownReport, type MetricsReport, type UsageRollup, createHookRuntime, minimumStaleClaimMillis };
|