@atrim/instrument-node 0.6.0 → 0.7.0-b9eaf74-20260108193056
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/package.json +12 -7
- package/target/dist/index.cjs +66 -1
- package/target/dist/index.cjs.map +1 -1
- package/target/dist/index.js +66 -1
- package/target/dist/index.js.map +1 -1
- package/target/dist/integrations/effect/auto/index.cjs +915 -0
- package/target/dist/integrations/effect/auto/index.cjs.map +1 -0
- package/target/dist/integrations/effect/auto/index.d.cts +278 -0
- package/target/dist/integrations/effect/auto/index.d.ts +278 -0
- package/target/dist/integrations/effect/auto/index.js +875 -0
- package/target/dist/integrations/effect/auto/index.js.map +1 -0
- package/target/dist/integrations/effect/index.cjs +66 -1
- package/target/dist/integrations/effect/index.cjs.map +1 -1
- package/target/dist/integrations/effect/index.js +66 -1
- package/target/dist/integrations/effect/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atrim/instrument-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-b9eaf74-20260108193056",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for Node.js with centralized YAML configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"types": "./target/dist/integrations/effect/index.d.ts",
|
|
44
44
|
"import": "./target/dist/integrations/effect/index.js",
|
|
45
45
|
"require": "./target/dist/integrations/effect/index.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./effect/auto": {
|
|
48
|
+
"types": "./target/dist/integrations/effect/auto/index.d.ts",
|
|
49
|
+
"import": "./target/dist/integrations/effect/auto/index.js",
|
|
50
|
+
"require": "./target/dist/integrations/effect/auto/index.cjs"
|
|
46
51
|
}
|
|
47
52
|
},
|
|
48
53
|
"main": "./target/dist/index.js",
|
|
@@ -54,7 +59,7 @@
|
|
|
54
59
|
"LICENSE"
|
|
55
60
|
],
|
|
56
61
|
"dependencies": {
|
|
57
|
-
"@opentelemetry/auto-instrumentations-node": "^0.67.
|
|
62
|
+
"@opentelemetry/auto-instrumentations-node": "^0.67.3",
|
|
58
63
|
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|
|
59
64
|
"@opentelemetry/instrumentation": "^0.208.0",
|
|
60
65
|
"@opentelemetry/resources": "^2.2.0",
|
|
@@ -66,9 +71,9 @@
|
|
|
66
71
|
"zod": "^3.22.0"
|
|
67
72
|
},
|
|
68
73
|
"devDependencies": {
|
|
69
|
-
"@effect/opentelemetry": "^0.
|
|
70
|
-
"@effect/platform": "^0.
|
|
71
|
-
"@effect/platform-node": "^0.
|
|
74
|
+
"@effect/opentelemetry": "^0.60.0",
|
|
75
|
+
"@effect/platform": "^0.94.1",
|
|
76
|
+
"@effect/platform-node": "^0.104.0",
|
|
72
77
|
"@opentelemetry/api": "^1.9.0",
|
|
73
78
|
"@opentelemetry/sdk-logs": "^0.208.0",
|
|
74
79
|
"@opentelemetry/sdk-metrics": "^2.2.0",
|
|
@@ -77,13 +82,13 @@
|
|
|
77
82
|
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
78
83
|
"@types/node": "^25.0.3",
|
|
79
84
|
"@vitest/coverage-v8": "^4.0.16",
|
|
80
|
-
"effect": "^3.19.
|
|
85
|
+
"effect": "^3.19.14",
|
|
81
86
|
"testcontainers": "^11.11.0",
|
|
82
87
|
"tsup": "^8.0.1",
|
|
83
88
|
"tsx": "^4.7.0",
|
|
84
89
|
"typescript": "^5.7.2",
|
|
85
90
|
"vitest": "^4.0.16",
|
|
86
|
-
"@atrim/instrument-core": "0.
|
|
91
|
+
"@atrim/instrument-core": "0.6.0"
|
|
87
92
|
},
|
|
88
93
|
"peerDependencies": {
|
|
89
94
|
"@opentelemetry/api": "^1.0.0",
|
package/target/dist/index.cjs
CHANGED
|
@@ -76,6 +76,69 @@ var AutoIsolationConfigSchema = zod.z.object({
|
|
|
76
76
|
add_metadata: zod.z.boolean().default(true)
|
|
77
77
|
}).default({})
|
|
78
78
|
});
|
|
79
|
+
var SpanNamingRuleSchema = zod.z.object({
|
|
80
|
+
// Match criteria (all specified criteria must match)
|
|
81
|
+
match: zod.z.object({
|
|
82
|
+
// Regex pattern to match file path
|
|
83
|
+
file: zod.z.string().optional(),
|
|
84
|
+
// Regex pattern to match function name
|
|
85
|
+
function: zod.z.string().optional(),
|
|
86
|
+
// Regex pattern to match module name
|
|
87
|
+
module: zod.z.string().optional()
|
|
88
|
+
}),
|
|
89
|
+
// Span name template with variables:
|
|
90
|
+
// {fiber_id} - Fiber ID
|
|
91
|
+
// {function} - Function name
|
|
92
|
+
// {module} - Module name
|
|
93
|
+
// {file} - File path
|
|
94
|
+
// {line} - Line number
|
|
95
|
+
// {operator} - Effect operator (gen, all, forEach, etc.)
|
|
96
|
+
// {match:field:N} - Captured regex group from match
|
|
97
|
+
name: zod.z.string()
|
|
98
|
+
});
|
|
99
|
+
var AutoInstrumentationConfigSchema = zod.z.object({
|
|
100
|
+
// Enable/disable auto-instrumentation
|
|
101
|
+
enabled: zod.z.boolean().default(false),
|
|
102
|
+
// Tracing granularity
|
|
103
|
+
// - 'fiber': Trace at fiber creation (recommended, lower overhead)
|
|
104
|
+
// - 'operator': Trace each Effect operator (higher granularity, more overhead)
|
|
105
|
+
granularity: zod.z.enum(["fiber", "operator"]).default("fiber"),
|
|
106
|
+
// Smart span naming configuration
|
|
107
|
+
span_naming: zod.z.object({
|
|
108
|
+
// Default span name template when no rules match
|
|
109
|
+
default: zod.z.string().default("effect.fiber.{fiber_id}"),
|
|
110
|
+
// Infer span names from source code (requires stack trace parsing)
|
|
111
|
+
// Adds ~50-100μs overhead per fiber
|
|
112
|
+
infer_from_source: zod.z.boolean().default(true),
|
|
113
|
+
// Naming rules (first match wins)
|
|
114
|
+
rules: zod.z.array(SpanNamingRuleSchema).default([])
|
|
115
|
+
}).default({}),
|
|
116
|
+
// Pattern-based filtering
|
|
117
|
+
filter: zod.z.object({
|
|
118
|
+
// Only trace spans matching these patterns (empty = trace all)
|
|
119
|
+
include: zod.z.array(zod.z.string()).default([]),
|
|
120
|
+
// Never trace spans matching these patterns
|
|
121
|
+
exclude: zod.z.array(zod.z.string()).default([])
|
|
122
|
+
}).default({}),
|
|
123
|
+
// Performance controls
|
|
124
|
+
performance: zod.z.object({
|
|
125
|
+
// Sample rate (0.0 - 1.0)
|
|
126
|
+
sampling_rate: zod.z.number().min(0).max(1).default(1),
|
|
127
|
+
// Skip fibers shorter than this duration (e.g., "10ms", "100 millis")
|
|
128
|
+
min_duration: zod.z.string().default("0ms"),
|
|
129
|
+
// Maximum concurrent traced fibers (0 = unlimited)
|
|
130
|
+
max_concurrent: zod.z.number().default(0)
|
|
131
|
+
}).default({}),
|
|
132
|
+
// Automatic metadata extraction
|
|
133
|
+
metadata: zod.z.object({
|
|
134
|
+
// Extract Effect fiber information
|
|
135
|
+
fiber_info: zod.z.boolean().default(true),
|
|
136
|
+
// Extract source location (file:line)
|
|
137
|
+
source_location: zod.z.boolean().default(true),
|
|
138
|
+
// Extract parent fiber information
|
|
139
|
+
parent_fiber: zod.z.boolean().default(true)
|
|
140
|
+
}).default({})
|
|
141
|
+
});
|
|
79
142
|
var HttpFilteringConfigSchema = zod.z.object({
|
|
80
143
|
// Patterns to ignore for outgoing HTTP requests (string patterns only in YAML)
|
|
81
144
|
ignore_outgoing_urls: zod.z.array(zod.z.string()).optional(),
|
|
@@ -115,7 +178,9 @@ var InstrumentationConfigSchema = zod.z.object({
|
|
|
115
178
|
// - "standalone": Use Effect's own OTLP exporter (bypasses Node SDK filtering)
|
|
116
179
|
exporter: zod.z.enum(["unified", "standalone"]).default("unified"),
|
|
117
180
|
auto_extract_metadata: zod.z.boolean(),
|
|
118
|
-
auto_isolation: AutoIsolationConfigSchema.optional()
|
|
181
|
+
auto_isolation: AutoIsolationConfigSchema.optional(),
|
|
182
|
+
// Auto-instrumentation: automatic tracing of all Effect fibers
|
|
183
|
+
auto_instrumentation: AutoInstrumentationConfigSchema.optional()
|
|
119
184
|
}).optional(),
|
|
120
185
|
http: HttpFilteringConfigSchema.optional()
|
|
121
186
|
});
|