@atrim/instrument-node 0.8.1-dev.e12da4b.20260116192447 → 0.9.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 +39 -0
- package/package.json +6 -6
- package/target/dist/integrations/effect/auto/index.cjs +1147 -1901
- package/target/dist/integrations/effect/auto/index.cjs.map +1 -1
- package/target/dist/integrations/effect/auto/index.d.cts +187 -653
- package/target/dist/integrations/effect/auto/index.d.ts +187 -653
- package/target/dist/integrations/effect/auto/index.js +1138 -1871
- package/target/dist/integrations/effect/auto/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -80,6 +80,45 @@ const process = Effect.gen(function* () {
|
|
|
80
80
|
|
|
81
81
|
Available: `annotateUser`, `annotateBatch`, `annotateDataSize`, `annotateLLM`, `annotateQuery`, `annotateHttpRequest`, `annotateError`, `annotatePriority`, `annotateCache`
|
|
82
82
|
|
|
83
|
+
### Operation Tracing (Automatic)
|
|
84
|
+
|
|
85
|
+
Automatically trace `Effect.all`, `Effect.forEach`, and other operations without manual `Effect.withSpan()` calls:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { Effect } from 'effect'
|
|
89
|
+
import { withOperationTracing } from '@atrim/instrument-node/effect/auto'
|
|
90
|
+
|
|
91
|
+
const program = Effect.gen(function* () {
|
|
92
|
+
// Automatically creates span "effect.all (index.ts:42)" with item_count=3
|
|
93
|
+
yield* Effect.all([fetchUser(), fetchOrders(), fetchPrefs()])
|
|
94
|
+
|
|
95
|
+
// Automatically creates span "effect.forEach (index.ts:45)"
|
|
96
|
+
yield* Effect.forEach(items, processItem)
|
|
97
|
+
}).pipe(withOperationTracing)
|
|
98
|
+
|
|
99
|
+
await Effect.runPromise(program)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**What you get:**
|
|
103
|
+
- Span name with source location: `effect.all (index.ts:42)`
|
|
104
|
+
- Attributes: `effect.operation`, `effect.item_count`, `code.filepath`, `code.lineno`
|
|
105
|
+
- Zero code changes to existing Effect code
|
|
106
|
+
|
|
107
|
+
**Configuration (optional):**
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
effect:
|
|
111
|
+
operation_tracing:
|
|
112
|
+
enabled: true
|
|
113
|
+
operations:
|
|
114
|
+
- name: all
|
|
115
|
+
include_count: true
|
|
116
|
+
- name: forEach
|
|
117
|
+
include_count: true
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
> **Note:** Requires `@clayroach/effect` fork with OperationMeta support. See [examples/effect-op-tracing](../../examples/effect-op-tracing/) for a complete example.
|
|
121
|
+
|
|
83
122
|
### Effect Fiber Metadata Extraction
|
|
84
123
|
|
|
85
124
|
To add Effect fiber metadata (fiber ID, status, parent span info) to your spans, you must **explicitly call** the enrichment functions:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atrim/instrument-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for Node.js with centralized YAML configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"tsx": "^4.7.0",
|
|
90
90
|
"typescript": "^5.7.2",
|
|
91
91
|
"vitest": "^4.0.16",
|
|
92
|
-
"@atrim/instrument-core": "0.
|
|
92
|
+
"@atrim/instrument-core": "0.8.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@opentelemetry/api": "^1.0.0",
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
"scripts": {
|
|
119
119
|
"build": "tsup",
|
|
120
120
|
"dev": "tsup --watch",
|
|
121
|
-
"test": "vitest run",
|
|
122
|
-
"test:watch": "vitest",
|
|
123
|
-
"test:coverage": "vitest run --coverage",
|
|
124
|
-
"test:integration": "OTEL_BSP_SCHEDULE_DELAY=500 vitest run --config vitest.integration.config.ts",
|
|
121
|
+
"test": "NODE_OPTIONS='--import tsx' vitest run",
|
|
122
|
+
"test:watch": "NODE_OPTIONS='--import tsx' vitest",
|
|
123
|
+
"test:coverage": "NODE_OPTIONS='--import tsx' vitest run --coverage",
|
|
124
|
+
"test:integration": "NODE_OPTIONS='--import tsx' OTEL_BSP_SCHEDULE_DELAY=500 vitest run --config vitest.integration.config.ts",
|
|
125
125
|
"test:all": "pnpm test && pnpm test:integration",
|
|
126
126
|
"typecheck": "tsc --noEmit",
|
|
127
127
|
"lint": "eslint src",
|