@atrim/instrument-web 0.6.0 → 0.7.1-dev.14fdea7.20260108220010
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 +4 -4
- package/target/dist/index.js +90 -2
- package/target/dist/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atrim/instrument-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1-dev.14fdea7.20260108220010",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for browsers with centralized YAML configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"LICENSE"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@effect/platform": "^0.
|
|
52
|
-
"effect": "^3.19.
|
|
51
|
+
"@effect/platform": "^0.94.1",
|
|
52
|
+
"effect": "^3.19.14",
|
|
53
53
|
"@opentelemetry/api": "^1.9.0",
|
|
54
54
|
"@opentelemetry/auto-instrumentations-web": "^0.54.0",
|
|
55
55
|
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"tsup": "^8.0.1",
|
|
77
77
|
"typescript": "^5.7.2",
|
|
78
78
|
"vitest": "^4.0.16",
|
|
79
|
-
"@atrim/instrument-core": "0.
|
|
79
|
+
"@atrim/instrument-core": "0.6.0"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"build": "tsup",
|
package/target/dist/index.js
CHANGED
|
@@ -4088,6 +4088,69 @@ var AutoIsolationConfigSchema = external_exports.object({
|
|
|
4088
4088
|
add_metadata: external_exports.boolean().default(true)
|
|
4089
4089
|
}).default({})
|
|
4090
4090
|
});
|
|
4091
|
+
var SpanNamingRuleSchema = external_exports.object({
|
|
4092
|
+
// Match criteria (all specified criteria must match)
|
|
4093
|
+
match: external_exports.object({
|
|
4094
|
+
// Regex pattern to match file path
|
|
4095
|
+
file: external_exports.string().optional(),
|
|
4096
|
+
// Regex pattern to match function name
|
|
4097
|
+
function: external_exports.string().optional(),
|
|
4098
|
+
// Regex pattern to match module name
|
|
4099
|
+
module: external_exports.string().optional()
|
|
4100
|
+
}),
|
|
4101
|
+
// Span name template with variables:
|
|
4102
|
+
// {fiber_id} - Fiber ID
|
|
4103
|
+
// {function} - Function name
|
|
4104
|
+
// {module} - Module name
|
|
4105
|
+
// {file} - File path
|
|
4106
|
+
// {line} - Line number
|
|
4107
|
+
// {operator} - Effect operator (gen, all, forEach, etc.)
|
|
4108
|
+
// {match:field:N} - Captured regex group from match
|
|
4109
|
+
name: external_exports.string()
|
|
4110
|
+
});
|
|
4111
|
+
var AutoInstrumentationConfigSchema = external_exports.object({
|
|
4112
|
+
// Enable/disable auto-instrumentation
|
|
4113
|
+
enabled: external_exports.boolean().default(false),
|
|
4114
|
+
// Tracing granularity
|
|
4115
|
+
// - 'fiber': Trace at fiber creation (recommended, lower overhead)
|
|
4116
|
+
// - 'operator': Trace each Effect operator (higher granularity, more overhead)
|
|
4117
|
+
granularity: external_exports.enum(["fiber", "operator"]).default("fiber"),
|
|
4118
|
+
// Smart span naming configuration
|
|
4119
|
+
span_naming: external_exports.object({
|
|
4120
|
+
// Default span name template when no rules match
|
|
4121
|
+
default: external_exports.string().default("effect.fiber.{fiber_id}"),
|
|
4122
|
+
// Infer span names from source code (requires stack trace parsing)
|
|
4123
|
+
// Adds ~50-100μs overhead per fiber
|
|
4124
|
+
infer_from_source: external_exports.boolean().default(true),
|
|
4125
|
+
// Naming rules (first match wins)
|
|
4126
|
+
rules: external_exports.array(SpanNamingRuleSchema).default([])
|
|
4127
|
+
}).default({}),
|
|
4128
|
+
// Pattern-based filtering
|
|
4129
|
+
filter: external_exports.object({
|
|
4130
|
+
// Only trace spans matching these patterns (empty = trace all)
|
|
4131
|
+
include: external_exports.array(external_exports.string()).default([]),
|
|
4132
|
+
// Never trace spans matching these patterns
|
|
4133
|
+
exclude: external_exports.array(external_exports.string()).default([])
|
|
4134
|
+
}).default({}),
|
|
4135
|
+
// Performance controls
|
|
4136
|
+
performance: external_exports.object({
|
|
4137
|
+
// Sample rate (0.0 - 1.0)
|
|
4138
|
+
sampling_rate: external_exports.number().min(0).max(1).default(1),
|
|
4139
|
+
// Skip fibers shorter than this duration (e.g., "10ms", "100 millis")
|
|
4140
|
+
min_duration: external_exports.string().default("0ms"),
|
|
4141
|
+
// Maximum concurrent traced fibers (0 = unlimited)
|
|
4142
|
+
max_concurrent: external_exports.number().default(0)
|
|
4143
|
+
}).default({}),
|
|
4144
|
+
// Automatic metadata extraction
|
|
4145
|
+
metadata: external_exports.object({
|
|
4146
|
+
// Extract Effect fiber information
|
|
4147
|
+
fiber_info: external_exports.boolean().default(true),
|
|
4148
|
+
// Extract source location (file:line)
|
|
4149
|
+
source_location: external_exports.boolean().default(true),
|
|
4150
|
+
// Extract parent fiber information
|
|
4151
|
+
parent_fiber: external_exports.boolean().default(true)
|
|
4152
|
+
}).default({})
|
|
4153
|
+
});
|
|
4091
4154
|
var HttpFilteringConfigSchema = external_exports.object({
|
|
4092
4155
|
// Patterns to ignore for outgoing HTTP requests (string patterns only in YAML)
|
|
4093
4156
|
ignore_outgoing_urls: external_exports.array(external_exports.string()).optional(),
|
|
@@ -4109,6 +4172,27 @@ var HttpFilteringConfigSchema = external_exports.object({
|
|
|
4109
4172
|
include_urls: external_exports.array(external_exports.string()).optional()
|
|
4110
4173
|
}).optional()
|
|
4111
4174
|
});
|
|
4175
|
+
var ExporterConfigSchema = external_exports.object({
|
|
4176
|
+
// Exporter type: 'otlp' | 'console' | 'none'
|
|
4177
|
+
// - 'otlp': Export to OTLP endpoint (production)
|
|
4178
|
+
// - 'console': Log spans to console (development)
|
|
4179
|
+
// - 'none': No export (disable tracing)
|
|
4180
|
+
type: external_exports.enum(["otlp", "console", "none"]).default("otlp"),
|
|
4181
|
+
// OTLP endpoint URL (for type: otlp)
|
|
4182
|
+
// Defaults to OTEL_EXPORTER_OTLP_ENDPOINT env var or http://localhost:4318
|
|
4183
|
+
endpoint: external_exports.string().optional(),
|
|
4184
|
+
// Span processor type
|
|
4185
|
+
// - 'batch': Batch spans for export (production, lower overhead)
|
|
4186
|
+
// - 'simple': Export immediately (development, no batching delay)
|
|
4187
|
+
processor: external_exports.enum(["batch", "simple"]).default("batch"),
|
|
4188
|
+
// Batch processor settings (for processor: batch)
|
|
4189
|
+
batch: external_exports.object({
|
|
4190
|
+
// Max time to wait before exporting (milliseconds)
|
|
4191
|
+
scheduled_delay_millis: external_exports.number().default(1e3),
|
|
4192
|
+
// Max batch size
|
|
4193
|
+
max_export_batch_size: external_exports.number().default(100)
|
|
4194
|
+
}).optional()
|
|
4195
|
+
});
|
|
4112
4196
|
var InstrumentationConfigSchema = external_exports.object({
|
|
4113
4197
|
version: external_exports.string(),
|
|
4114
4198
|
instrumentation: external_exports.object({
|
|
@@ -4122,12 +4206,16 @@ var InstrumentationConfigSchema = external_exports.object({
|
|
|
4122
4206
|
// Enable/disable Effect tracing entirely
|
|
4123
4207
|
// When false, EffectInstrumentationLive returns Layer.empty
|
|
4124
4208
|
enabled: external_exports.boolean().default(true),
|
|
4125
|
-
// Exporter mode:
|
|
4209
|
+
// Exporter mode (legacy - use exporter.type instead):
|
|
4126
4210
|
// - "unified": Use global TracerProvider from Node SDK (recommended, enables filtering)
|
|
4127
4211
|
// - "standalone": Use Effect's own OTLP exporter (bypasses Node SDK filtering)
|
|
4128
4212
|
exporter: external_exports.enum(["unified", "standalone"]).default("unified"),
|
|
4213
|
+
// Exporter configuration (for auto-instrumentation)
|
|
4214
|
+
exporter_config: ExporterConfigSchema.optional(),
|
|
4129
4215
|
auto_extract_metadata: external_exports.boolean(),
|
|
4130
|
-
auto_isolation: AutoIsolationConfigSchema.optional()
|
|
4216
|
+
auto_isolation: AutoIsolationConfigSchema.optional(),
|
|
4217
|
+
// Auto-instrumentation: automatic tracing of all Effect fibers
|
|
4218
|
+
auto_instrumentation: AutoInstrumentationConfigSchema.optional()
|
|
4131
4219
|
}).optional(),
|
|
4132
4220
|
http: HttpFilteringConfigSchema.optional()
|
|
4133
4221
|
});
|