@watchtowerobservability/node 0.5.0 → 0.7.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.
Files changed (90) hide show
  1. package/README.md +88 -9
  2. package/dist/cjs/checkin.d.ts +7 -0
  3. package/dist/cjs/checkin.js +18 -0
  4. package/dist/cjs/env.d.ts +12 -0
  5. package/dist/cjs/env.js +37 -0
  6. package/dist/cjs/errors.d.ts +8 -0
  7. package/dist/cjs/errors.js +23 -0
  8. package/dist/cjs/filter.d.ts +2 -0
  9. package/dist/cjs/filter.js +16 -0
  10. package/dist/cjs/index.d.ts +48 -10
  11. package/dist/cjs/index.js +119 -53
  12. package/dist/cjs/instrument.d.ts +10 -0
  13. package/dist/cjs/instrument.js +74 -0
  14. package/dist/cjs/integrations/db.d.ts +3 -0
  15. package/dist/cjs/integrations/db.js +4 -1
  16. package/dist/cjs/integrations/genai-agents.d.ts +4 -1
  17. package/dist/cjs/integrations/genai-agents.js +27 -24
  18. package/dist/cjs/integrations/genai-frameworks.d.ts +25 -0
  19. package/dist/cjs/integrations/genai-frameworks.js +211 -0
  20. package/dist/cjs/integrations/genai.d.ts +1 -0
  21. package/dist/cjs/integrations/genai.js +7 -2
  22. package/dist/cjs/integrations/next-build.d.ts +31 -0
  23. package/dist/cjs/integrations/next-build.js +95 -0
  24. package/dist/cjs/integrations/next-tunnel.d.ts +14 -0
  25. package/dist/cjs/integrations/next-tunnel.js +52 -0
  26. package/dist/cjs/integrations/next.d.ts +24 -1
  27. package/dist/cjs/integrations/next.js +39 -7
  28. package/dist/cjs/load.js +37 -5
  29. package/dist/cjs/next-sourcemaps-cli.d.ts +2 -0
  30. package/dist/cjs/next-sourcemaps-cli.js +9 -0
  31. package/dist/cjs/origin.d.ts +9 -0
  32. package/dist/cjs/origin.js +43 -0
  33. package/dist/cjs/redact.d.ts +8 -0
  34. package/dist/cjs/redact.js +43 -0
  35. package/dist/cjs/register.d.ts +1 -0
  36. package/dist/cjs/register.js +29 -0
  37. package/dist/cjs/sampling.d.ts +53 -0
  38. package/dist/cjs/sampling.js +98 -0
  39. package/dist/cjs/scrub.d.ts +7 -0
  40. package/dist/cjs/scrub.js +39 -0
  41. package/dist/cjs/shutdown.d.ts +14 -0
  42. package/dist/cjs/shutdown.js +26 -0
  43. package/dist/cjs/sql.js +11 -1
  44. package/dist/cjs/version.d.ts +2 -0
  45. package/dist/cjs/version.js +5 -0
  46. package/dist/esm/checkin.d.ts +7 -0
  47. package/dist/esm/checkin.js +15 -0
  48. package/dist/esm/env.d.ts +12 -0
  49. package/dist/esm/env.js +33 -0
  50. package/dist/esm/errors.d.ts +8 -0
  51. package/dist/esm/errors.js +22 -0
  52. package/dist/esm/filter.d.ts +2 -0
  53. package/dist/esm/filter.js +13 -0
  54. package/dist/esm/index.d.ts +48 -10
  55. package/dist/esm/index.js +117 -53
  56. package/dist/esm/instrument.d.ts +10 -0
  57. package/dist/esm/instrument.js +71 -0
  58. package/dist/esm/integrations/db.d.ts +3 -0
  59. package/dist/esm/integrations/db.js +5 -2
  60. package/dist/esm/integrations/genai-agents.d.ts +4 -1
  61. package/dist/esm/integrations/genai-agents.js +4 -4
  62. package/dist/esm/integrations/genai-frameworks.d.ts +25 -0
  63. package/dist/esm/integrations/genai-frameworks.js +206 -0
  64. package/dist/esm/integrations/genai.d.ts +1 -0
  65. package/dist/esm/integrations/genai.js +3 -1
  66. package/dist/esm/integrations/next-build.d.ts +31 -0
  67. package/dist/esm/integrations/next-build.js +58 -0
  68. package/dist/esm/integrations/next-tunnel.d.ts +14 -0
  69. package/dist/esm/integrations/next-tunnel.js +49 -0
  70. package/dist/esm/integrations/next.d.ts +24 -1
  71. package/dist/esm/integrations/next.js +32 -6
  72. package/dist/esm/load.js +80 -2
  73. package/dist/esm/next-sourcemaps-cli.d.ts +2 -0
  74. package/dist/esm/next-sourcemaps-cli.js +7 -0
  75. package/dist/esm/origin.d.ts +9 -0
  76. package/dist/esm/origin.js +39 -0
  77. package/dist/esm/redact.d.ts +8 -0
  78. package/dist/esm/redact.js +39 -0
  79. package/dist/esm/register.d.ts +1 -0
  80. package/dist/esm/register.js +27 -0
  81. package/dist/esm/sampling.d.ts +53 -0
  82. package/dist/esm/sampling.js +91 -0
  83. package/dist/esm/scrub.d.ts +7 -0
  84. package/dist/esm/scrub.js +34 -0
  85. package/dist/esm/shutdown.d.ts +14 -0
  86. package/dist/esm/shutdown.js +23 -0
  87. package/dist/esm/sql.js +11 -1
  88. package/dist/esm/version.d.ts +2 -0
  89. package/dist/esm/version.js +2 -0
  90. package/package.json +40 -2
@@ -0,0 +1,39 @@
1
+ /** Hook keys for the non-attribute fields. Event attributes (incl. exception.message / exception.stacktrace) use their own keys. */
2
+ export const SPAN_NAME_KEY = 'span.name';
3
+ export const STATUS_MESSAGE_KEY = 'status.message';
4
+ export const LOG_BODY_KEY = 'log.body';
5
+ function attrs(a, hook) {
6
+ if (!a)
7
+ return;
8
+ for (const k of Object.keys(a))
9
+ a[k] = hook(k, a[k]);
10
+ }
11
+ /** Assign, falling back to defineProperty if the SDK exposes the field as a getter. */
12
+ function put(o, k, v) {
13
+ try {
14
+ o[k] = v;
15
+ }
16
+ catch { /* readonly accessor */ }
17
+ if (o[k] !== v)
18
+ Object.defineProperty(o, k, { value: v, configurable: true, enumerable: true, writable: true });
19
+ }
20
+ /** Span processor that redacts the name, status message, attributes, every event's and link's attributes before export. */
21
+ export function redactor(hook) {
22
+ return {
23
+ onStart() { },
24
+ onEnd(span) {
25
+ // ReadableSpan fields are readonly in the types but are plain mutable fields on the SDK span
26
+ const s = span;
27
+ put(s, 'name', String(hook(SPAN_NAME_KEY, s.name) ?? ''));
28
+ if (s.status?.message)
29
+ put(s.status, 'message', String(hook(STATUS_MESSAGE_KEY, s.status.message) ?? ''));
30
+ attrs(span.attributes, hook);
31
+ for (const e of s.events || [])
32
+ attrs(e.attributes, hook);
33
+ for (const l of s.links || [])
34
+ attrs(l.attributes, hook);
35
+ },
36
+ shutdown: () => Promise.resolve(),
37
+ forceFlush: () => Promise.resolve(),
38
+ };
39
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ // Preload entry: `node --import @watchtowerobservability/node/register app.mjs` (ESM) or `node -r @watchtowerobservability/node/register app.js` (CommonJS).
2
+ // Starts the SDK from WT_*/OTEL_* env before the app loads, so http, fetch, pg and ioredis are patched in time.
3
+ // No-op without WT_INGEST_KEY.
4
+ import { pathToFileURL } from 'node:url';
5
+ import { register as registerHooks } from 'node:module';
6
+ import { init } from './index.js';
7
+ if (process.env.WT_INGEST_KEY || process.env.OTEL_EXPORTER_OTLP_HEADERS) {
8
+ try {
9
+ // ESM modules (node:http imported from an ES module) are only patched through OpenTelemetry's loader hook
10
+ // (import-in-the-middle). Resolve it from the app, once per process, and skip quietly when it is not installed.
11
+ const g = globalThis;
12
+ const key = Symbol.for('watchtower.node.esm-hook');
13
+ if (!g[key]) {
14
+ g[key] = true;
15
+ try {
16
+ registerHooks('@opentelemetry/instrumentation/hook.mjs', pathToFileURL(`${process.cwd()}/`));
17
+ }
18
+ catch {
19
+ // @opentelemetry/instrumentation not installed: CommonJS apps are still instrumented
20
+ }
21
+ }
22
+ init({});
23
+ }
24
+ catch (e) {
25
+ console.warn(`[watchtower] register: ${e.message}`);
26
+ }
27
+ }
@@ -0,0 +1,53 @@
1
+ import type { Attributes, Context, Link, SpanKind } from '@opentelemetry/api';
2
+ import type { Sampler, SamplingResult } from '@opentelemetry/sdk-trace';
3
+ export interface SamplingRule {
4
+ name?: string;
5
+ enabled?: boolean | null;
6
+ match?: {
7
+ service?: string;
8
+ env?: string;
9
+ span_name_prefix?: string;
10
+ span_name_glob?: string;
11
+ span_name_regex?: string;
12
+ attrs?: Record<string, string>;
13
+ min_duration_ms?: number | null;
14
+ status?: string;
15
+ };
16
+ action?: {
17
+ kind?: string;
18
+ ratio?: number | null;
19
+ };
20
+ }
21
+ export interface RemoteConfig {
22
+ strategyType?: string;
23
+ probabilisticSampling?: {
24
+ samplingRate: number;
25
+ };
26
+ rules?: SamplingRule[];
27
+ }
28
+ /** fnv64a of the trace id's bytes, as a fraction of 2^64; matches the gateway's `ratioKeeps`. */
29
+ export declare function traceFraction(traceIdHex: string): number;
30
+ export declare function globMatches(glob: string, text: string): boolean;
31
+ /** The keep ratio for a span under `cfg` (1 = keep). First matching ratio/drop rule wins. */
32
+ export declare function ratioFor(cfg: RemoteConfig, service: string, env: string, name: string, attrs: Attributes): number;
33
+ export interface RemoteSamplerOptions {
34
+ endpoint: string;
35
+ headers: Record<string, string>;
36
+ service: string;
37
+ env?: string;
38
+ intervalMs?: number;
39
+ fetch?: typeof fetch;
40
+ }
41
+ export declare class RemoteSampler implements Sampler {
42
+ private readonly o;
43
+ cfg: RemoteConfig;
44
+ private etag;
45
+ private timer?;
46
+ private readonly fetchFn;
47
+ constructor(o: RemoteSamplerOptions);
48
+ /** One poll; a failure or 304 keeps the current config. */
49
+ poll(): Promise<void>;
50
+ stop(): void;
51
+ shouldSample(_c: Context, traceId: string, name: string, _k: SpanKind, attributes: Attributes, _l: Link[]): SamplingResult;
52
+ toString(): string;
53
+ }
@@ -0,0 +1,91 @@
1
+ const NOT_RECORD = 0;
2
+ const RECORD_AND_SAMPLED = 2;
3
+ const FNV_OFFSET = 0xcbf29ce484222325n;
4
+ const FNV_PRIME = 0x100000001b3n;
5
+ const MASK = 0xffffffffffffffffn;
6
+ const TWO_64 = 18446744073709551616;
7
+ /** fnv64a of the trace id's bytes, as a fraction of 2^64; matches the gateway's `ratioKeeps`. */
8
+ export function traceFraction(traceIdHex) {
9
+ let h = FNV_OFFSET;
10
+ for (let i = 0; i + 1 < traceIdHex.length; i += 2)
11
+ h = ((h ^ BigInt(parseInt(traceIdHex.slice(i, i + 2), 16))) * FNV_PRIME) & MASK;
12
+ return Number(h) / TWO_64;
13
+ }
14
+ export function globMatches(glob, text) {
15
+ const re = glob.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\?/g, '.');
16
+ return new RegExp(`^${re}$`, 's').test(text);
17
+ }
18
+ function ruleMatches(r, service, env, name, attrs) {
19
+ const m = r.match ?? {};
20
+ // duration and status are only known at the end of the span: the gateway decides those
21
+ if (m.min_duration_ms != null || m.status)
22
+ return false;
23
+ if ((m.service && m.service !== service) || (m.env && m.env !== env))
24
+ return false;
25
+ if (m.span_name_prefix && !name.startsWith(m.span_name_prefix))
26
+ return false;
27
+ if (m.span_name_glob && !globMatches(m.span_name_glob, name))
28
+ return false;
29
+ if (m.span_name_regex) {
30
+ try {
31
+ if (!new RegExp(m.span_name_regex).test(name))
32
+ return false;
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ }
38
+ return Object.entries(m.attrs ?? {}).every(([k, v]) => String(attrs[k]) === v);
39
+ }
40
+ /** The keep ratio for a span under `cfg` (1 = keep). First matching ratio/drop rule wins. */
41
+ export function ratioFor(cfg, service, env, name, attrs) {
42
+ if (cfg.strategyType === 'PROBABILISTIC')
43
+ return clamp(cfg.probabilisticSampling?.samplingRate);
44
+ for (const r of cfg.rules ?? []) {
45
+ if (r.enabled === false || !ruleMatches(r, service, env, name, attrs))
46
+ continue;
47
+ if (r.action?.kind === 'drop')
48
+ return 0;
49
+ if (r.action?.kind === 'ratio' && r.action.ratio != null)
50
+ return clamp(r.action.ratio);
51
+ return 1; // keep, tail, rate: decided later
52
+ }
53
+ return 1;
54
+ }
55
+ const clamp = (r) => (typeof r === 'number' && Number.isFinite(r) ? Math.min(1, Math.max(0, r)) : 1);
56
+ export class RemoteSampler {
57
+ o;
58
+ cfg = {};
59
+ etag = '';
60
+ timer;
61
+ fetchFn;
62
+ constructor(o) {
63
+ this.o = o;
64
+ this.fetchFn = o.fetch ?? globalThis.fetch;
65
+ void this.poll();
66
+ this.timer = setInterval(() => void this.poll(), Math.max(1000, o.intervalMs ?? 30_000));
67
+ this.timer.unref?.();
68
+ }
69
+ /** One poll; a failure or 304 keeps the current config. */
70
+ async poll() {
71
+ try {
72
+ const q = new URLSearchParams({ service: this.o.service, ...(this.o.env ? { env: this.o.env } : {}) });
73
+ const res = await this.fetchFn(`${this.o.endpoint}/v1/sampling?${q}`, {
74
+ headers: { ...this.o.headers, ...(this.etag ? { 'If-None-Match': this.etag } : {}) },
75
+ });
76
+ if (res.status === 304 || !res.ok)
77
+ return;
78
+ this.cfg = (await res.json());
79
+ this.etag = res.headers.get('ETag') ?? '';
80
+ }
81
+ catch { /* fallback: keep the last good config */ }
82
+ }
83
+ stop() { if (this.timer)
84
+ clearInterval(this.timer); }
85
+ shouldSample(_c, traceId, name, _k, attributes, _l) {
86
+ const r = ratioFor(this.cfg, this.o.service, this.o.env ?? '', name, attributes);
87
+ const keep = r >= 1 || (r > 0 && traceFraction(traceId) < r);
88
+ return { decision: keep ? RECORD_AND_SAMPLED : NOT_RECORD };
89
+ }
90
+ toString() { return 'WatchtowerRemoteSampler'; }
91
+ }
@@ -0,0 +1,7 @@
1
+ import type { SpanProcessor } from '@opentelemetry/sdk-trace';
2
+ /** A path segment that reads like a secret or an opaque id: >= 24 chars, or >= 10 chars mixing a letter and a digit (UUIDs included). */
3
+ export declare function looksSecret(seg: string): boolean;
4
+ /** Drop the query string and fragment, strip `user:pass@`, and replace secret-looking path segments with `:redacted`. */
5
+ export declare function scrubUrl(value: string): string;
6
+ /** Span processor: scrubs URL attributes (query dropped, `url.query` removed, secret path segments redacted) and URLs inside the span name. `http.route` is kept. */
7
+ export declare function urlScrubber(): SpanProcessor;
@@ -0,0 +1,34 @@
1
+ const URL_KEYS = ['http.target', 'url.full', 'url.path', 'http.url', 'http.request.url'];
2
+ const QUERY_KEYS = ['url.query'];
3
+ /** A path segment that reads like a secret or an opaque id: >= 24 chars, or >= 10 chars mixing a letter and a digit (UUIDs included). */
4
+ export function looksSecret(seg) {
5
+ return seg.length >= 24 || (seg.length >= 10 && /[A-Za-z]/.test(seg) && /\d/.test(seg));
6
+ }
7
+ /** Drop the query string and fragment, strip `user:pass@`, and replace secret-looking path segments with `:redacted`. */
8
+ export function scrubUrl(value) {
9
+ const m = /^(?:([a-z][a-z0-9+.-]*:\/\/)([^/?#]*))?([^?#]*)/i.exec(value);
10
+ const origin = m[1] ? m[1] + m[2].replace(/^[^@]*@/, '') : '';
11
+ return origin + m[3].split('/').map((s) => (looksSecret(s) ? ':redacted' : s)).join('/');
12
+ }
13
+ function scrubName(name) {
14
+ return name.split(' ').map((t) => (/^(https?:\/\/|\/)/i.test(t) ? scrubUrl(t) : t)).join(' ');
15
+ }
16
+ /** Span processor: scrubs URL attributes (query dropped, `url.query` removed, secret path segments redacted) and URLs inside the span name. `http.route` is kept. */
17
+ export function urlScrubber() {
18
+ return {
19
+ onStart() { },
20
+ onEnd(span) {
21
+ const a = span.attributes;
22
+ for (const k of URL_KEYS)
23
+ if (typeof a[k] === 'string')
24
+ a[k] = scrubUrl(a[k]);
25
+ for (const k of QUERY_KEYS)
26
+ delete a[k];
27
+ const n = scrubName(span.name);
28
+ if (n !== span.name)
29
+ span.name = n;
30
+ },
31
+ shutdown: () => Promise.resolve(),
32
+ forceFlush: () => Promise.resolve(),
33
+ };
34
+ }
@@ -0,0 +1,14 @@
1
+ export interface SignalProc {
2
+ on(event: string, l: () => void): unknown;
3
+ off(event: string, l: () => void): unknown;
4
+ listenerCount(event: string): number;
5
+ kill(pid: number, signal: string): unknown;
6
+ readonly pid: number;
7
+ }
8
+ /**
9
+ * On SIGTERM and SIGINT: flush (at most `timeoutMs`). Adding a signal listener turns off Node's default exit, so when
10
+ * ours is the only listener it removes itself and re-sends the signal after the flush; when the app or a framework
11
+ * (`next start`) has its own handler, that handler decides how the process ends and ours only starts the flush.
12
+ * Returns the uninstall function.
13
+ */
14
+ export declare function installSignalFlush(flush: () => Promise<unknown>, timeoutMs?: number, proc?: SignalProc): () => void;
@@ -0,0 +1,23 @@
1
+ // Flush on SIGTERM / SIGINT without changing how the process ends.
2
+ /**
3
+ * On SIGTERM and SIGINT: flush (at most `timeoutMs`). Adding a signal listener turns off Node's default exit, so when
4
+ * ours is the only listener it removes itself and re-sends the signal after the flush; when the app or a framework
5
+ * (`next start`) has its own handler, that handler decides how the process ends and ours only starts the flush.
6
+ * Returns the uninstall function.
7
+ */
8
+ export function installSignalFlush(flush, timeoutMs = 2000, proc = process) {
9
+ const handlers = new Map();
10
+ for (const sig of ['SIGTERM', 'SIGINT']) {
11
+ const h = () => {
12
+ const alone = proc.listenerCount(sig) <= 1;
13
+ const done = Promise.race([flush().catch(() => undefined), new Promise((r) => setTimeout(r, timeoutMs).unref())]);
14
+ if (!alone)
15
+ return;
16
+ void done.finally(() => { proc.off(sig, h); proc.kill(proc.pid, sig); });
17
+ };
18
+ handlers.set(sig, h);
19
+ proc.on(sig, h);
20
+ }
21
+ return () => { for (const [sig, h] of handlers)
22
+ proc.off(sig, h); };
23
+ }
package/dist/esm/sql.js CHANGED
@@ -204,9 +204,19 @@ export function normalizeAndHash(stmt, pg = false) {
204
204
  /** Systems whose dialect keeps `"identifier"` quotes and the `#` operator (as the worker decides). */
205
205
  export const isPgDialect = (system) => system === 'postgresql' || system === 'cockroachdb' || system === 'redshift';
206
206
  const OP = /^\s*(?:with\b[\s\S]*?\)\s*)?([a-z]+)/i;
207
- const TARGET = /\b(?:from|into|update|join|table)\s+((?:"[^"]+"|[\w$]+)(?:\.(?:"[^"]+"|[\w$]+))?)/i;
207
+ const NAME = '(?:"[^"]+"|[\\w$]+)(?:\\.(?:"[^"]+"|[\\w$]+))?';
208
+ const TARGET = new RegExp(`\\b(?:from|into|update|join|table)\\s+(?:if\\s+(?:not\\s+)?exists\\s+)?(${NAME})`, 'i');
209
+ // DDL: `CREATE [TEMP|VIRTUAL|UNIQUE...] TABLE|INDEX|VIEW [IF NOT EXISTS] name [ON table]`; an index is named after its table
210
+ const CREATE = new RegExp(`^\\s*create\\s+(?:(?:temp|temporary|virtual|unique|fulltext|spatial|clustered|nonclustered|materialized|or\\s+replace)\\s+)*(table|index|view)\\s+(?:if\\s+not\\s+exists\\s+)?(?:concurrently\\s+)?(${NAME})(?:\\s+on\\s+(?:only\\s+)?(${NAME}))?`, 'i');
208
211
  /** `SELECT users`-style summary: the operation and first table, never values or the statement text. */
209
212
  export function querySummary(text, fallback = 'postgres') {
213
+ const ddl = text?.match(CREATE);
214
+ if (ddl) {
215
+ const kind = ddl[1].toLowerCase();
216
+ const operation = `CREATE ${kind.toUpperCase()}`;
217
+ const target = (kind === 'index' ? ddl[3] ?? ddl[2] : ddl[2]).replace(/"/g, '');
218
+ return { operation, target, summary: `${operation} ${target}` };
219
+ }
210
220
  const operation = text?.match(OP)?.[1]?.toUpperCase();
211
221
  const target = text?.match(TARGET)?.[1]?.replace(/"/g, '');
212
222
  return { operation, target, summary: [operation ?? fallback, target].filter(Boolean).join(' ') };
@@ -0,0 +1,2 @@
1
+ /** This package's version (test/distro.test.ts checks it against package.json); sent as `telemetry.distro.version`. */
2
+ export declare const VERSION = "0.7.0";
@@ -0,0 +1,2 @@
1
+ /** This package's version (test/distro.test.ts checks it against package.json); sent as `telemetry.distro.version`. */
2
+ export const VERSION = '0.7.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watchtowerobservability/node",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/watchtowerobservability/watchtower-node.git"
@@ -13,6 +13,9 @@
13
13
  "main": "./dist/cjs/index.js",
14
14
  "module": "./dist/esm/index.js",
15
15
  "types": "./dist/cjs/index.d.ts",
16
+ "bin": {
17
+ "wt-next-sourcemaps": "./dist/cjs/next-sourcemaps-cli.js"
18
+ },
16
19
  "files": [
17
20
  "dist"
18
21
  ],
@@ -346,6 +349,16 @@
346
349
  "types": "./dist/cjs/profiling.d.ts",
347
350
  "default": "./dist/cjs/profiling.js"
348
351
  }
352
+ },
353
+ "./register": {
354
+ "import": {
355
+ "types": "./dist/esm/register.d.ts",
356
+ "default": "./dist/esm/register.js"
357
+ },
358
+ "require": {
359
+ "types": "./dist/cjs/register.d.ts",
360
+ "default": "./dist/cjs/register.js"
361
+ }
349
362
  }
350
363
  },
351
364
  "license": "Apache-2.0",
@@ -356,7 +369,8 @@
356
369
  "build": "node scripts/build.mjs",
357
370
  "typecheck": "tsc --noEmit -p tsconfig.json",
358
371
  "test": "vitest run",
359
- "prepack": "npm run build"
372
+ "prepack": "npm run build",
373
+ "smoke": "node scripts/smoke-pack.mjs"
360
374
  },
361
375
  "dependencies": {
362
376
  "@opentelemetry/api": "^1.10.0"
@@ -367,7 +381,13 @@
367
381
  "@opentelemetry/exporter-logs-otlp-http": "^0.301.0",
368
382
  "@opentelemetry/exporter-metrics-otlp-http": "^0.301.0",
369
383
  "@opentelemetry/exporter-trace-otlp-http": "^0.301.0",
384
+ "@opentelemetry/instrumentation": ">=0.200.0",
385
+ "@opentelemetry/instrumentation-http": ">=0.200.0",
386
+ "@opentelemetry/instrumentation-ioredis": ">=0.50.0",
387
+ "@opentelemetry/instrumentation-mysql2": ">=0.40.0",
388
+ "@opentelemetry/instrumentation-pg": ">=0.50.0",
370
389
  "@opentelemetry/instrumentation-runtime-node": ">=0.38.0",
390
+ "@opentelemetry/instrumentation-undici": ">=0.10.0",
371
391
  "@opentelemetry/otlp-transformer": "^0.301.0",
372
392
  "@opentelemetry/resources": "^3.1.0",
373
393
  "@opentelemetry/sdk-logs": "^3.1.0",
@@ -391,9 +411,27 @@
391
411
  "@opentelemetry/exporter-trace-otlp-http": {
392
412
  "optional": true
393
413
  },
414
+ "@opentelemetry/instrumentation": {
415
+ "optional": true
416
+ },
417
+ "@opentelemetry/instrumentation-http": {
418
+ "optional": true
419
+ },
420
+ "@opentelemetry/instrumentation-ioredis": {
421
+ "optional": true
422
+ },
423
+ "@opentelemetry/instrumentation-mysql2": {
424
+ "optional": true
425
+ },
426
+ "@opentelemetry/instrumentation-pg": {
427
+ "optional": true
428
+ },
394
429
  "@opentelemetry/instrumentation-runtime-node": {
395
430
  "optional": true
396
431
  },
432
+ "@opentelemetry/instrumentation-undici": {
433
+ "optional": true
434
+ },
397
435
  "@opentelemetry/otlp-transformer": {
398
436
  "optional": true
399
437
  },