@twin.org/telemetry-service 0.0.3-next.1 → 0.0.3-next.11
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/README.md +1 -1
- package/dist/es/index.js +5 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/metricsCollectorService.js +129 -0
- package/dist/es/metricsCollectorService.js.map +1 -0
- package/dist/es/models/IMetricsCollectorServiceConfig.js +4 -0
- package/dist/es/models/IMetricsCollectorServiceConfig.js.map +1 -0
- package/dist/es/models/IMetricsCollectorServiceConstructorOptions.js +2 -0
- package/dist/es/models/IMetricsCollectorServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/ITelemetryServiceConstructorOptions.js.map +1 -1
- package/dist/es/telemetryRoutes.js +1 -1
- package/dist/es/telemetryRoutes.js.map +1 -1
- package/dist/es/telemetryService.js +18 -4
- package/dist/es/telemetryService.js.map +1 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/metricsCollectorService.d.ts +34 -0
- package/dist/types/models/IMetricsCollectorServiceConfig.d.ts +10 -0
- package/dist/types/models/IMetricsCollectorServiceConstructorOptions.d.ts +20 -0
- package/dist/types/models/ITelemetryServiceConstructorOptions.d.ts +5 -0
- package/dist/types/telemetryService.d.ts +2 -2
- package/docs/changelog.md +188 -33
- package/docs/examples.md +83 -1
- package/docs/open-api/spec.json +458 -56
- package/docs/reference/classes/MetricsCollectorService.md +98 -0
- package/docs/reference/classes/TelemetryService.md +11 -11
- package/docs/reference/index.md +3 -0
- package/docs/reference/interfaces/IMetricsCollectorServiceConfig.md +17 -0
- package/docs/reference/interfaces/IMetricsCollectorServiceConstructorOptions.md +39 -0
- package/docs/reference/interfaces/ITelemetryServiceConstructorOptions.md +16 -2
- package/locales/en.json +7 -1
- package/package.json +7 -5
package/docs/changelog.md
CHANGED
|
@@ -1,24 +1,179 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.10...telemetry-service-v0.0.3-next.11) (2026-06-04)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
8
|
+
* system metrics partitioning ([#38](https://github.com/iotaledger/twin-telemetry/issues/38)) ([3914183](https://github.com/iotaledger/twin-telemetry/commit/3914183bc17d0fd0adc8e30b7bb7aaee5d75e986))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.9...telemetry-service-v0.0.3-next.10) (2026-05-20)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **telemetry-service:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.8...telemetry-service-v0.0.3-next.9) (2026-05-20)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add helper and command types ([7166013](https://github.com/iotaledger/twin-telemetry/commit/7166013f8a0693a1d92101cb600c37a1aba66417))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Dependencies
|
|
40
|
+
|
|
41
|
+
* The following workspace dependencies were updated
|
|
42
|
+
* dependencies
|
|
43
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
44
|
+
|
|
45
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.7...telemetry-service-v0.0.3-next.8) (2026-05-19)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Miscellaneous Chores
|
|
49
|
+
|
|
50
|
+
* **telemetry-service:** Synchronize repo versions
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Dependencies
|
|
54
|
+
|
|
55
|
+
* The following workspace dependencies were updated
|
|
56
|
+
* dependencies
|
|
57
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
58
|
+
|
|
59
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.6...telemetry-service-v0.0.3-next.7) (2026-05-19)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* add metrics producer infrastructure ([#30](https://github.com/iotaledger/twin-telemetry/issues/30)) ([8990b99](https://github.com/iotaledger/twin-telemetry/commit/8990b990d22f331d44562c2781c9b6ddf846db88))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Dependencies
|
|
68
|
+
|
|
69
|
+
* The following workspace dependencies were updated
|
|
70
|
+
* dependencies
|
|
71
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
72
|
+
|
|
73
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.5...telemetry-service-v0.0.3-next.6) (2026-05-11)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Miscellaneous Chores
|
|
77
|
+
|
|
78
|
+
* **telemetry-service:** Synchronize repo versions
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Dependencies
|
|
82
|
+
|
|
83
|
+
* The following workspace dependencies were updated
|
|
84
|
+
* dependencies
|
|
85
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
86
|
+
|
|
87
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.4...telemetry-service-v0.0.3-next.5) (2026-05-11)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Features
|
|
91
|
+
|
|
92
|
+
* add context id features ([#19](https://github.com/iotaledger/twin-telemetry/issues/19)) ([5942442](https://github.com/iotaledger/twin-telemetry/commit/5942442991fa7ad7afa9d8b7c4583326a8c4c9ae))
|
|
93
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
94
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
95
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
96
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
97
|
+
* typescript 6 update ([0acecc2](https://github.com/iotaledger/twin-telemetry/commit/0acecc2692b174fbaec6a8a89bd9277fa3530b5f))
|
|
98
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
99
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
100
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* api data types ([2edc5ac](https://github.com/iotaledger/twin-telemetry/commit/2edc5ac665b996a1b29173cac3b389fa3ceafa34))
|
|
106
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
107
|
+
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/iotaledger/twin-telemetry/issues/3)) ([b386ca5](https://github.com/iotaledger/twin-telemetry/commit/b386ca55404aa933ad8917f82a7f0e588593fcc8))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Dependencies
|
|
111
|
+
|
|
112
|
+
* The following workspace dependencies were updated
|
|
113
|
+
* dependencies
|
|
114
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
115
|
+
|
|
116
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.3...telemetry-service-v0.0.3-next.4) (2026-05-11)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Features
|
|
120
|
+
|
|
121
|
+
* typescript 6 update ([0acecc2](https://github.com/iotaledger/twin-telemetry/commit/0acecc2692b174fbaec6a8a89bd9277fa3530b5f))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Dependencies
|
|
125
|
+
|
|
126
|
+
* The following workspace dependencies were updated
|
|
127
|
+
* dependencies
|
|
128
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
129
|
+
|
|
130
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.2...telemetry-service-v0.0.3-next.3) (2026-05-06)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Miscellaneous Chores
|
|
134
|
+
|
|
135
|
+
* **telemetry-service:** Synchronize repo versions
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Dependencies
|
|
139
|
+
|
|
140
|
+
* The following workspace dependencies were updated
|
|
141
|
+
* dependencies
|
|
142
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
143
|
+
|
|
144
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.1...telemetry-service-v0.0.3-next.2) (2026-03-02)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Bug Fixes
|
|
148
|
+
|
|
149
|
+
* api data types ([2edc5ac](https://github.com/iotaledger/twin-telemetry/commit/2edc5ac665b996a1b29173cac3b389fa3ceafa34))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Dependencies
|
|
153
|
+
|
|
154
|
+
* The following workspace dependencies were updated
|
|
155
|
+
* dependencies
|
|
156
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
157
|
+
|
|
158
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.3-next.0...telemetry-service-v0.0.3-next.1) (2025-11-11)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Features
|
|
162
|
+
|
|
163
|
+
* add context id features ([#19](https://github.com/iotaledger/twin-telemetry/issues/19)) ([5942442](https://github.com/iotaledger/twin-telemetry/commit/5942442991fa7ad7afa9d8b7c4583326a8c4c9ae))
|
|
164
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
165
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
166
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
167
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
168
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
169
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
170
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
16
171
|
|
|
17
172
|
|
|
18
173
|
### Bug Fixes
|
|
19
174
|
|
|
20
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
21
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
175
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
176
|
+
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/iotaledger/twin-telemetry/issues/3)) ([b386ca5](https://github.com/iotaledger/twin-telemetry/commit/b386ca55404aa933ad8917f82a7f0e588593fcc8))
|
|
22
177
|
|
|
23
178
|
|
|
24
179
|
### Dependencies
|
|
@@ -27,12 +182,12 @@
|
|
|
27
182
|
* dependencies
|
|
28
183
|
* @twin.org/telemetry-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
29
184
|
|
|
30
|
-
## [0.0.2-next.3](https://github.com/
|
|
185
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.2-next.2...telemetry-service-v0.0.2-next.3) (2025-10-09)
|
|
31
186
|
|
|
32
187
|
|
|
33
188
|
### Features
|
|
34
189
|
|
|
35
|
-
* add validate-locales ([24ed804](https://github.com/
|
|
190
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
36
191
|
|
|
37
192
|
|
|
38
193
|
### Dependencies
|
|
@@ -41,12 +196,12 @@
|
|
|
41
196
|
* dependencies
|
|
42
197
|
* @twin.org/telemetry-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
43
198
|
|
|
44
|
-
## [0.0.2-next.2](https://github.com/
|
|
199
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.2-next.1...telemetry-service-v0.0.2-next.2) (2025-08-29)
|
|
45
200
|
|
|
46
201
|
|
|
47
202
|
### Features
|
|
48
203
|
|
|
49
|
-
* eslint migration to flat config ([69ac91a](https://github.com/
|
|
204
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
50
205
|
|
|
51
206
|
|
|
52
207
|
### Dependencies
|
|
@@ -55,22 +210,22 @@
|
|
|
55
210
|
* dependencies
|
|
56
211
|
* @twin.org/telemetry-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
57
212
|
|
|
58
|
-
## [0.0.2-next.1](https://github.com/
|
|
213
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.2-next.0...telemetry-service-v0.0.2-next.1) (2025-08-20)
|
|
59
214
|
|
|
60
215
|
|
|
61
216
|
### Features
|
|
62
217
|
|
|
63
|
-
* remove unused namespace ([54939fa](https://github.com/
|
|
64
|
-
* remove unused namespace ([02dcabb](https://github.com/
|
|
65
|
-
* update dependencies ([0e55c48](https://github.com/
|
|
66
|
-
* update framework core ([4b10bcd](https://github.com/
|
|
67
|
-
* use shared store mechanism ([#7](https://github.com/
|
|
218
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
219
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
220
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
221
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
222
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
68
223
|
|
|
69
224
|
|
|
70
225
|
### Bug Fixes
|
|
71
226
|
|
|
72
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
73
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
227
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
228
|
+
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/iotaledger/twin-telemetry/issues/3)) ([b386ca5](https://github.com/iotaledger/twin-telemetry/commit/b386ca55404aa933ad8917f82a7f0e588593fcc8))
|
|
74
229
|
|
|
75
230
|
|
|
76
231
|
### Dependencies
|
|
@@ -84,7 +239,7 @@
|
|
|
84
239
|
|
|
85
240
|
### Features
|
|
86
241
|
|
|
87
|
-
* release to production ([df2151d](https://github.com/
|
|
242
|
+
* release to production ([df2151d](https://github.com/iotaledger/twin-telemetry/commit/df2151d24844fd2c3e6092ce3a6f888ac16219a0))
|
|
88
243
|
|
|
89
244
|
|
|
90
245
|
### Dependencies
|
|
@@ -93,12 +248,12 @@
|
|
|
93
248
|
* dependencies
|
|
94
249
|
* @twin.org/telemetry-models bumped from ^0.0.0 to ^0.0.1
|
|
95
250
|
|
|
96
|
-
## [0.0.1-next.18](https://github.com/
|
|
251
|
+
## [0.0.1-next.18](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.1-next.17...telemetry-service-v0.0.1-next.18) (2025-06-20)
|
|
97
252
|
|
|
98
253
|
|
|
99
254
|
### Bug Fixes
|
|
100
255
|
|
|
101
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
256
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
102
257
|
|
|
103
258
|
|
|
104
259
|
### Dependencies
|
|
@@ -107,12 +262,12 @@
|
|
|
107
262
|
* dependencies
|
|
108
263
|
* @twin.org/telemetry-models bumped from 0.0.1-next.17 to 0.0.1-next.18
|
|
109
264
|
|
|
110
|
-
## [0.0.1-next.17](https://github.com/
|
|
265
|
+
## [0.0.1-next.17](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.1-next.16...telemetry-service-v0.0.1-next.17) (2025-06-12)
|
|
111
266
|
|
|
112
267
|
|
|
113
268
|
### Features
|
|
114
269
|
|
|
115
|
-
* update dependencies ([0e55c48](https://github.com/
|
|
270
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
116
271
|
|
|
117
272
|
|
|
118
273
|
### Dependencies
|
|
@@ -121,12 +276,12 @@
|
|
|
121
276
|
* dependencies
|
|
122
277
|
* @twin.org/telemetry-models bumped from 0.0.1-next.16 to 0.0.1-next.17
|
|
123
278
|
|
|
124
|
-
## [0.0.1-next.16](https://github.com/
|
|
279
|
+
## [0.0.1-next.16](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.1-next.15...telemetry-service-v0.0.1-next.16) (2025-04-17)
|
|
125
280
|
|
|
126
281
|
|
|
127
282
|
### Features
|
|
128
283
|
|
|
129
|
-
* use shared store mechanism ([#7](https://github.com/
|
|
284
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
130
285
|
|
|
131
286
|
|
|
132
287
|
### Dependencies
|
|
@@ -135,12 +290,12 @@
|
|
|
135
290
|
* dependencies
|
|
136
291
|
* @twin.org/telemetry-models bumped from 0.0.1-next.15 to 0.0.1-next.16
|
|
137
292
|
|
|
138
|
-
## [0.0.1-next.15](https://github.com/
|
|
293
|
+
## [0.0.1-next.15](https://github.com/iotaledger/twin-telemetry/compare/telemetry-service-v0.0.1-next.14...telemetry-service-v0.0.1-next.15) (2025-03-28)
|
|
139
294
|
|
|
140
295
|
|
|
141
296
|
### Bug Fixes
|
|
142
297
|
|
|
143
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
298
|
+
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/iotaledger/twin-telemetry/issues/3)) ([b386ca5](https://github.com/iotaledger/twin-telemetry/commit/b386ca55404aa933ad8917f82a7f0e588593fcc8))
|
|
144
299
|
|
|
145
300
|
|
|
146
301
|
### Dependencies
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,83 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Telemetry Service Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to wire a service to a registered connector and expose telemetry operations in your application layer.
|
|
4
|
+
|
|
5
|
+
## TelemetryService
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import {
|
|
9
|
+
MetricType,
|
|
10
|
+
SilentTelemetryConnector,
|
|
11
|
+
TelemetryConnectorFactory
|
|
12
|
+
} from '@twin.org/telemetry-models';
|
|
13
|
+
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
14
|
+
|
|
15
|
+
TelemetryConnectorFactory.register('silent', () => new SilentTelemetryConnector());
|
|
16
|
+
|
|
17
|
+
const service = new TelemetryService({
|
|
18
|
+
telemetryConnectorType: 'silent'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
console.log(service.className()); // telemetryService
|
|
22
|
+
|
|
23
|
+
await service.createMetric({
|
|
24
|
+
id: 'requests-per-minute',
|
|
25
|
+
label: 'Requests Per Minute',
|
|
26
|
+
description: 'Request throughput sampled once per minute',
|
|
27
|
+
unit: 'rpm',
|
|
28
|
+
type: MetricType.Gauge
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
await service.updateMetric({
|
|
32
|
+
id: 'requests-per-minute',
|
|
33
|
+
label: 'RPM',
|
|
34
|
+
description: 'Request throughput',
|
|
35
|
+
unit: 'rpm'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const valueId = await service.addMetricValue('requests-per-minute', 118.7, {
|
|
39
|
+
region: 'eu-west-1'
|
|
40
|
+
});
|
|
41
|
+
console.log(valueId.length === 0); // true
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import {
|
|
46
|
+
MetricType,
|
|
47
|
+
SilentTelemetryConnector,
|
|
48
|
+
TelemetryConnectorFactory
|
|
49
|
+
} from '@twin.org/telemetry-models';
|
|
50
|
+
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
51
|
+
|
|
52
|
+
TelemetryConnectorFactory.register('silent', () => new SilentTelemetryConnector());
|
|
53
|
+
|
|
54
|
+
const service = new TelemetryService({ telemetryConnectorType: 'silent' });
|
|
55
|
+
|
|
56
|
+
const metric = await service.getMetric('requests-per-minute');
|
|
57
|
+
console.log(metric.metric.id); // requests-per-minute
|
|
58
|
+
|
|
59
|
+
const metricPage = await service.query(MetricType.Gauge, undefined, 100);
|
|
60
|
+
console.log(metricPage.entities.length); // 1
|
|
61
|
+
|
|
62
|
+
const valuePage = await service.queryValues(
|
|
63
|
+
'requests-per-minute',
|
|
64
|
+
Date.now() - 3_600_000,
|
|
65
|
+
Date.now(),
|
|
66
|
+
undefined,
|
|
67
|
+
60
|
|
68
|
+
);
|
|
69
|
+
console.log(valuePage.entities.length); // 60
|
|
70
|
+
|
|
71
|
+
await service.removeMetric('requests-per-minute');
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## generateRestRoutesTelemetry
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { generateRestRoutesTelemetry } from '@twin.org/telemetry-service';
|
|
78
|
+
|
|
79
|
+
const routes = generateRestRoutesTelemetry('/api', 'telemetry');
|
|
80
|
+
|
|
81
|
+
console.log(routes.length); // 7
|
|
82
|
+
console.log(routes[0].operationId); // telemetryCreateMetric
|
|
83
|
+
```
|