@atrim/instrument-web 0.4.0-ce152ee-20251118030759 → 0.4.0-d812d4f-20251118211006
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/LICENSE +21 -0
- package/package.json +26 -23
- package/target/dist/index.d.ts +37 -3
- package/target/dist/index.js +4491 -10
- package/target/dist/index.js.map +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Atrim AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atrim/instrument-web",
|
|
3
|
-
"version": "0.4.0-
|
|
3
|
+
"version": "0.4.0-d812d4f-20251118211006",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for browsers with centralized YAML configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,26 +47,9 @@
|
|
|
47
47
|
"README.md",
|
|
48
48
|
"LICENSE"
|
|
49
49
|
],
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "tsup",
|
|
52
|
-
"dev": "tsup --watch",
|
|
53
|
-
"test": "vitest run",
|
|
54
|
-
"test:watch": "vitest",
|
|
55
|
-
"test:coverage": "vitest run --coverage",
|
|
56
|
-
"typecheck": "tsc --noEmit",
|
|
57
|
-
"lint": "eslint src",
|
|
58
|
-
"lint:fix": "eslint src --fix",
|
|
59
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
60
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
61
|
-
"clean": "rm -rf target",
|
|
62
|
-
"publish:dev:version": "npm version $(git describe --tags --abbrev=0 | sed 's/^.*@//' | sed 's/^v//')-$(git rev-parse --short HEAD)-$(date -u +%Y%m%d%H%M%S) --no-git-tag-version",
|
|
63
|
-
"publish:dev:save": "node -p \"require('./package.json').version\" > .version",
|
|
64
|
-
"publish:dev:publish": "pnpm build && npm publish --tag dev --access public",
|
|
65
|
-
"publish:dev:reset": "npm version 0.1.0 --no-git-tag-version",
|
|
66
|
-
"publish:dev": "pnpm publish:dev:version && pnpm publish:dev:save && pnpm publish:dev:publish && pnpm publish:dev:reset"
|
|
67
|
-
},
|
|
68
50
|
"dependencies": {
|
|
69
|
-
"@
|
|
51
|
+
"@effect/platform": "^0.93.0",
|
|
52
|
+
"effect": "^3.19.0",
|
|
70
53
|
"@opentelemetry/api": "^1.9.0",
|
|
71
54
|
"@opentelemetry/auto-instrumentations-web": "^0.54.0",
|
|
72
55
|
"@opentelemetry/context-zone": "^2.2.0",
|
|
@@ -74,7 +57,8 @@
|
|
|
74
57
|
"@opentelemetry/instrumentation": "^0.208.0",
|
|
75
58
|
"@opentelemetry/resources": "^2.2.0",
|
|
76
59
|
"@opentelemetry/sdk-trace-base": "^2.2.0",
|
|
77
|
-
"@opentelemetry/sdk-trace-web": "^2.2.0"
|
|
60
|
+
"@opentelemetry/sdk-trace-web": "^2.2.0",
|
|
61
|
+
"yaml": "^2.8.1"
|
|
78
62
|
},
|
|
79
63
|
"devDependencies": {
|
|
80
64
|
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
@@ -83,6 +67,25 @@
|
|
|
83
67
|
"jsdom": "^24.0.0",
|
|
84
68
|
"tsup": "^8.0.1",
|
|
85
69
|
"typescript": "^5.7.2",
|
|
86
|
-
"vitest": "^4.0.8"
|
|
70
|
+
"vitest": "^4.0.8",
|
|
71
|
+
"@atrim/instrument-core": "0.4.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup",
|
|
75
|
+
"dev": "tsup --watch",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:watch": "vitest",
|
|
78
|
+
"test:coverage": "vitest run --coverage",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"lint": "eslint src",
|
|
81
|
+
"lint:fix": "eslint src --fix",
|
|
82
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
83
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
84
|
+
"clean": "rm -rf target",
|
|
85
|
+
"publish:dev:version": "npm version $(git describe --tags --abbrev=0 | sed 's/^.*@//' | sed 's/^v//')-$(git rev-parse --short HEAD)-$(date -u +%Y%m%d%H%M%S) --no-git-tag-version",
|
|
86
|
+
"publish:dev:save": "node -p \"require('./package.json').version\" > .version",
|
|
87
|
+
"publish:dev:publish": "pnpm build && pnpm publish --tag dev --access public --no-git-checks",
|
|
88
|
+
"publish:dev:reset": "npm version 0.1.0 --no-git-tag-version",
|
|
89
|
+
"publish:dev": "pnpm publish:dev:version && pnpm publish:dev:save && pnpm publish:dev:publish && pnpm publish:dev:reset"
|
|
87
90
|
}
|
|
88
|
-
}
|
|
91
|
+
}
|
package/target/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
|
|
2
|
-
import { InstrumentationConfig } from '@atrim/instrument-core';
|
|
3
|
-
export { ConfigError, ConfigFileError,
|
|
2
|
+
import { InstrumentationConfig, ConfigLoader } from '@atrim/instrument-core';
|
|
3
|
+
export { ConfigError, ConfigFileError, ConfigUrlError, ConfigValidationError, ExportError, InitializationError, InstrumentationConfig, PatternConfig, PatternMatcher, ShutdownError, clearPatternMatcher, getPatternMatcher, initializePatternMatcher, shouldInstrumentSpan } from '@atrim/instrument-core';
|
|
4
4
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
|
|
5
|
+
import { Layer } from 'effect';
|
|
5
6
|
import { SpanProcessor, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
6
7
|
import { Context, Span } from '@opentelemetry/api';
|
|
7
8
|
|
|
@@ -186,6 +187,39 @@ declare function createOtlpExporter(options?: OtlpExporterOptions): OTLPTraceExp
|
|
|
186
187
|
*/
|
|
187
188
|
declare function getOtlpEndpoint(): string;
|
|
188
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Browser configuration loader using Effect Platform
|
|
192
|
+
*
|
|
193
|
+
* Provides HttpClient layer for the core ConfigLoader service
|
|
194
|
+
* (No FileSystem in browser)
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Complete ConfigLoader layer with browser platform dependencies
|
|
199
|
+
*
|
|
200
|
+
* Provides:
|
|
201
|
+
* - ConfigLoader service
|
|
202
|
+
* - HttpClient (from FetchHttpClient)
|
|
203
|
+
* - No FileSystem (browser doesn't have filesystem access)
|
|
204
|
+
*/
|
|
205
|
+
declare const WebConfigLoaderLive: Layer.Layer<ConfigLoader, never, never>;
|
|
206
|
+
/**
|
|
207
|
+
* Load configuration from URI (Promise-based convenience API)
|
|
208
|
+
*
|
|
209
|
+
* Automatically provides browser platform layers (HttpClient only)
|
|
210
|
+
*
|
|
211
|
+
* @param uri - Configuration URI (http://, https://, or relative path)
|
|
212
|
+
* @returns Promise that resolves to validated configuration
|
|
213
|
+
*/
|
|
214
|
+
declare function loadConfig(uri: string): Promise<InstrumentationConfig>;
|
|
215
|
+
/**
|
|
216
|
+
* Load configuration from inline content (Promise-based convenience API)
|
|
217
|
+
*
|
|
218
|
+
* @param content - YAML string, JSON string, or plain object
|
|
219
|
+
* @returns Promise that resolves to validated configuration
|
|
220
|
+
*/
|
|
221
|
+
declare function loadConfigFromInline(content: string | unknown): Promise<InstrumentationConfig>;
|
|
222
|
+
|
|
189
223
|
/**
|
|
190
224
|
* Pattern-Based Span Processor for Browser
|
|
191
225
|
*
|
|
@@ -376,4 +410,4 @@ declare function annotateNavigation(span: Span, options: {
|
|
|
376
410
|
type?: 'client-side' | 'server-side' | 'initial';
|
|
377
411
|
}): void;
|
|
378
412
|
|
|
379
|
-
export { type OtlpExporterOptions, PatternSpanProcessor, type SdkInitializationOptions, annotateCacheOperation, annotateHttpRequest, annotateNavigation, annotateUserInteraction, createOtlpExporter, getOtlpEndpoint, getSdkInstance, initializeInstrumentation, markSpanError, markSpanSuccess, recordException, resetSdk, setSpanAttributes, shutdownSdk };
|
|
413
|
+
export { type OtlpExporterOptions, PatternSpanProcessor, type SdkInitializationOptions, WebConfigLoaderLive, annotateCacheOperation, annotateHttpRequest, annotateNavigation, annotateUserInteraction, createOtlpExporter, getOtlpEndpoint, getSdkInstance, initializeInstrumentation, loadConfig, loadConfigFromInline, markSpanError, markSpanSuccess, recordException, resetSdk, setSpanAttributes, shutdownSdk };
|