@atrim/instrument-web 0.7.0 → 0.7.1-dev.14fdea7.20260108224013
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 +1 -1
- package/target/dist/index.js +93 -2
- package/target/dist/index.js.map +1 -1
package/package.json
CHANGED
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,30 @@ 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
|
+
// Custom headers to send with OTLP requests (for type: otlp)
|
|
4185
|
+
// Useful for authentication (x-api-key, Authorization, etc.)
|
|
4186
|
+
headers: external_exports.record(external_exports.string()).optional(),
|
|
4187
|
+
// Span processor type
|
|
4188
|
+
// - 'batch': Batch spans for export (production, lower overhead)
|
|
4189
|
+
// - 'simple': Export immediately (development, no batching delay)
|
|
4190
|
+
processor: external_exports.enum(["batch", "simple"]).default("batch"),
|
|
4191
|
+
// Batch processor settings (for processor: batch)
|
|
4192
|
+
batch: external_exports.object({
|
|
4193
|
+
// Max time to wait before exporting (milliseconds)
|
|
4194
|
+
scheduled_delay_millis: external_exports.number().default(1e3),
|
|
4195
|
+
// Max batch size
|
|
4196
|
+
max_export_batch_size: external_exports.number().default(100)
|
|
4197
|
+
}).optional()
|
|
4198
|
+
});
|
|
4112
4199
|
var InstrumentationConfigSchema = external_exports.object({
|
|
4113
4200
|
version: external_exports.string(),
|
|
4114
4201
|
instrumentation: external_exports.object({
|
|
@@ -4122,12 +4209,16 @@ var InstrumentationConfigSchema = external_exports.object({
|
|
|
4122
4209
|
// Enable/disable Effect tracing entirely
|
|
4123
4210
|
// When false, EffectInstrumentationLive returns Layer.empty
|
|
4124
4211
|
enabled: external_exports.boolean().default(true),
|
|
4125
|
-
// Exporter mode:
|
|
4212
|
+
// Exporter mode (legacy - use exporter.type instead):
|
|
4126
4213
|
// - "unified": Use global TracerProvider from Node SDK (recommended, enables filtering)
|
|
4127
4214
|
// - "standalone": Use Effect's own OTLP exporter (bypasses Node SDK filtering)
|
|
4128
4215
|
exporter: external_exports.enum(["unified", "standalone"]).default("unified"),
|
|
4216
|
+
// Exporter configuration (for auto-instrumentation)
|
|
4217
|
+
exporter_config: ExporterConfigSchema.optional(),
|
|
4129
4218
|
auto_extract_metadata: external_exports.boolean(),
|
|
4130
|
-
auto_isolation: AutoIsolationConfigSchema.optional()
|
|
4219
|
+
auto_isolation: AutoIsolationConfigSchema.optional(),
|
|
4220
|
+
// Auto-instrumentation: automatic tracing of all Effect fibers
|
|
4221
|
+
auto_instrumentation: AutoInstrumentationConfigSchema.optional()
|
|
4131
4222
|
}).optional(),
|
|
4132
4223
|
http: HttpFilteringConfigSchema.optional()
|
|
4133
4224
|
});
|