@adonisjs/otel 1.1.1 → 1.1.2
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.
|
@@ -8,7 +8,7 @@ export declare class HttpUrlFilter {
|
|
|
8
8
|
#private;
|
|
9
9
|
static readonly DEFAULT_IGNORED_URLS: string[];
|
|
10
10
|
static readonly STATIC_FILE_EXTENSIONS: Set<string>;
|
|
11
|
-
static readonly
|
|
11
|
+
static readonly DEV_SERVER_PATTERNS: string[];
|
|
12
12
|
constructor(config?: HttpInstrumentationConfig);
|
|
13
13
|
/**
|
|
14
14
|
* Check if a request should be ignored (not traced).
|
|
@@ -12,6 +12,13 @@ export class HttpUrlFilter {
|
|
|
12
12
|
'/readiness',
|
|
13
13
|
'/metrics',
|
|
14
14
|
'/internal/metrics',
|
|
15
|
+
'/favicon.ico',
|
|
16
|
+
'/robots.txt',
|
|
17
|
+
'/sitemap.xml',
|
|
18
|
+
'/manifest.json',
|
|
19
|
+
'/site.webmanifest',
|
|
20
|
+
'/browserconfig.xml',
|
|
21
|
+
'/ads.txt',
|
|
15
22
|
];
|
|
16
23
|
static STATIC_FILE_EXTENSIONS = new Set([
|
|
17
24
|
'css',
|
|
@@ -43,8 +50,11 @@ export class HttpUrlFilter {
|
|
|
43
50
|
'pdf',
|
|
44
51
|
'vue',
|
|
45
52
|
'svelte',
|
|
53
|
+
'webmanifest',
|
|
54
|
+
'txt',
|
|
55
|
+
'xml',
|
|
46
56
|
]);
|
|
47
|
-
static
|
|
57
|
+
static DEV_SERVER_PATTERNS = ['/@vite/', '/@id/', '/@fs/', '/__vite', '/@react-refresh'];
|
|
48
58
|
#ignoredUrls;
|
|
49
59
|
#ignoreStaticFiles;
|
|
50
60
|
#ignoreOptionsRequests;
|
|
@@ -70,8 +80,8 @@ export class HttpUrlFilter {
|
|
|
70
80
|
const extension = lastSegment.slice(dotIndex + 1).toLowerCase();
|
|
71
81
|
return HttpUrlFilter.STATIC_FILE_EXTENSIONS.has(extension);
|
|
72
82
|
}
|
|
73
|
-
#
|
|
74
|
-
return HttpUrlFilter.
|
|
83
|
+
#isDevServerRequest(url) {
|
|
84
|
+
return HttpUrlFilter.DEV_SERVER_PATTERNS.some((pattern) => url.startsWith(pattern));
|
|
75
85
|
}
|
|
76
86
|
#matchesPattern(urlPath, pattern) {
|
|
77
87
|
if (pattern.endsWith('/*')) {
|
|
@@ -101,8 +111,8 @@ export class HttpUrlFilter {
|
|
|
101
111
|
debug('ignoring request "%s %s" (reason: static file)', method, urlPath);
|
|
102
112
|
return true;
|
|
103
113
|
}
|
|
104
|
-
if (this.#ignoreStaticFiles && this.#
|
|
105
|
-
debug('ignoring request "%s %s" (reason:
|
|
114
|
+
if (this.#ignoreStaticFiles && this.#isDevServerRequest(urlPath)) {
|
|
115
|
+
debug('ignoring request "%s %s" (reason: dev server pattern)', method, urlPath);
|
|
106
116
|
return true;
|
|
107
117
|
}
|
|
108
118
|
if (this.#ignoredUrls.some((pattern) => this.#matchesPattern(urlPath, pattern))) {
|