@contello/opentelemetry 1.0.0 → 1.0.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.
- package/LICENSE +21 -0
- package/dist/index.cjs +6 -5
- package/dist/index.js +6 -5
- package/package.json +10 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2026 entwico GmbH
|
|
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/dist/index.cjs
CHANGED
|
@@ -49,16 +49,17 @@ function parseMetricAttrs(name, extra) {
|
|
|
49
49
|
...extra
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
var CHANNEL_PREFIXES = ["contello
|
|
52
|
+
var CHANNEL_PREFIXES = ["@contello/store", "@contello/client", "@contello/astro"];
|
|
53
53
|
var ContelloInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
54
54
|
_subscriptions = [];
|
|
55
55
|
constructor(config = {}) {
|
|
56
|
-
super("@contello/opentelemetry", "
|
|
56
|
+
super("@contello/opentelemetry", "1.0.2", config);
|
|
57
57
|
}
|
|
58
58
|
init() {
|
|
59
59
|
return [];
|
|
60
60
|
}
|
|
61
61
|
enable() {
|
|
62
|
+
this._subscriptions ??= [];
|
|
62
63
|
if (this._subscriptions.length > 0) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
@@ -73,8 +74,8 @@ var ContelloInstrumentation = class extends import_instrumentation.Instrumentati
|
|
|
73
74
|
});
|
|
74
75
|
const userConfig = this.getConfig();
|
|
75
76
|
for (const prefix of CHANNEL_PREFIXES) {
|
|
76
|
-
const endChannel = import_node_diagnostics_channel.default.channel(`${prefix}
|
|
77
|
-
const errorChannel = import_node_diagnostics_channel.default.channel(`${prefix}
|
|
77
|
+
const endChannel = import_node_diagnostics_channel.default.channel(`${prefix}:end`);
|
|
78
|
+
const errorChannel = import_node_diagnostics_channel.default.channel(`${prefix}:error`);
|
|
78
79
|
const onEnd = (message) => {
|
|
79
80
|
const msg = message;
|
|
80
81
|
const attrs = parseMetricAttrs(msg.name, { cached: msg.cached ?? false });
|
|
@@ -100,7 +101,7 @@ var ContelloInstrumentation = class extends import_instrumentation.Instrumentati
|
|
|
100
101
|
this._subscriptions.push({ channel: endChannel, handler: onEnd });
|
|
101
102
|
this._subscriptions.push({ channel: errorChannel, handler: onError });
|
|
102
103
|
}
|
|
103
|
-
const messageChannel = import_node_diagnostics_channel.default.channel("contello:
|
|
104
|
+
const messageChannel = import_node_diagnostics_channel.default.channel("@contello/client:message");
|
|
104
105
|
const onMessage = (message) => {
|
|
105
106
|
const msg = message;
|
|
106
107
|
const output = {};
|
package/dist/index.js
CHANGED
|
@@ -13,16 +13,17 @@ function parseMetricAttrs(name, extra) {
|
|
|
13
13
|
...extra
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
var CHANNEL_PREFIXES = ["contello
|
|
16
|
+
var CHANNEL_PREFIXES = ["@contello/store", "@contello/client", "@contello/astro"];
|
|
17
17
|
var ContelloInstrumentation = class extends InstrumentationBase {
|
|
18
18
|
_subscriptions = [];
|
|
19
19
|
constructor(config = {}) {
|
|
20
|
-
super("@contello/opentelemetry", "
|
|
20
|
+
super("@contello/opentelemetry", "1.0.2", config);
|
|
21
21
|
}
|
|
22
22
|
init() {
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
25
25
|
enable() {
|
|
26
|
+
this._subscriptions ??= [];
|
|
26
27
|
if (this._subscriptions.length > 0) {
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
@@ -37,8 +38,8 @@ var ContelloInstrumentation = class extends InstrumentationBase {
|
|
|
37
38
|
});
|
|
38
39
|
const userConfig = this.getConfig();
|
|
39
40
|
for (const prefix of CHANNEL_PREFIXES) {
|
|
40
|
-
const endChannel = dc.channel(`${prefix}
|
|
41
|
-
const errorChannel = dc.channel(`${prefix}
|
|
41
|
+
const endChannel = dc.channel(`${prefix}:end`);
|
|
42
|
+
const errorChannel = dc.channel(`${prefix}:error`);
|
|
42
43
|
const onEnd = (message) => {
|
|
43
44
|
const msg = message;
|
|
44
45
|
const attrs = parseMetricAttrs(msg.name, { cached: msg.cached ?? false });
|
|
@@ -64,7 +65,7 @@ var ContelloInstrumentation = class extends InstrumentationBase {
|
|
|
64
65
|
this._subscriptions.push({ channel: endChannel, handler: onEnd });
|
|
65
66
|
this._subscriptions.push({ channel: errorChannel, handler: onError });
|
|
66
67
|
}
|
|
67
|
-
const messageChannel = dc.channel("contello:
|
|
68
|
+
const messageChannel = dc.channel("@contello/client:message");
|
|
68
69
|
const onMessage = (message) => {
|
|
69
70
|
const msg = message;
|
|
70
71
|
const output = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contello/opentelemetry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for Contello packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,19 +10,13 @@
|
|
|
10
10
|
"url": "https://github.com/entwico/contello-js",
|
|
11
11
|
"directory": "packages/opentelemetry"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsup",
|
|
15
|
-
"lint": "eslint .",
|
|
16
|
-
"lint:fix": "eslint . --fix",
|
|
17
|
-
"typecheck": "tsc --noEmit"
|
|
18
|
-
},
|
|
19
13
|
"peerDependencies": {
|
|
20
14
|
"@opentelemetry/api": ">=1.0.0",
|
|
21
15
|
"@opentelemetry/instrumentation": ">=0.200.0"
|
|
22
16
|
},
|
|
23
17
|
"devDependencies": {
|
|
24
|
-
"@opentelemetry/api": "^1.9.
|
|
25
|
-
"@opentelemetry/instrumentation": "^0.
|
|
18
|
+
"@opentelemetry/api": "^1.9.1",
|
|
19
|
+
"@opentelemetry/instrumentation": "^0.215.0"
|
|
26
20
|
},
|
|
27
21
|
"files": [
|
|
28
22
|
"dist"
|
|
@@ -37,5 +31,11 @@
|
|
|
37
31
|
"publishConfig": {
|
|
38
32
|
"access": "public",
|
|
39
33
|
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint . --fix",
|
|
39
|
+
"typecheck": "tsc --noEmit"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|