@twin.org/telemetry-service 0.0.3-next.2 → 0.0.3-next.5
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
CHANGED
package/docs/changelog.md
CHANGED
|
@@ -1,11 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add context id features ([#19](https://github.com/iotaledger/twin-telemetry/issues/19)) ([5942442](https://github.com/iotaledger/twin-telemetry/commit/5942442991fa7ad7afa9d8b7c4583326a8c4c9ae))
|
|
9
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
10
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
11
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
12
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
13
|
+
* typescript 6 update ([0acecc2](https://github.com/iotaledger/twin-telemetry/commit/0acecc2692b174fbaec6a8a89bd9277fa3530b5f))
|
|
14
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
15
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
16
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* api data types ([2edc5ac](https://github.com/iotaledger/twin-telemetry/commit/2edc5ac665b996a1b29173cac3b389fa3ceafa34))
|
|
22
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
23
|
+
* 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))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
31
|
+
|
|
32
|
+
## [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)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* typescript 6 update ([0acecc2](https://github.com/iotaledger/twin-telemetry/commit/0acecc2692b174fbaec6a8a89bd9277fa3530b5f))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Dependencies
|
|
41
|
+
|
|
42
|
+
* The following workspace dependencies were updated
|
|
43
|
+
* dependencies
|
|
44
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
45
|
+
|
|
46
|
+
## [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)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Miscellaneous Chores
|
|
50
|
+
|
|
51
|
+
* **telemetry-service:** Synchronize repo versions
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Dependencies
|
|
55
|
+
|
|
56
|
+
* The following workspace dependencies were updated
|
|
57
|
+
* dependencies
|
|
58
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
59
|
+
|
|
60
|
+
## [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)
|
|
4
61
|
|
|
5
62
|
|
|
6
63
|
### Bug Fixes
|
|
7
64
|
|
|
8
|
-
* api data types ([2edc5ac](https://github.com/
|
|
65
|
+
* api data types ([2edc5ac](https://github.com/iotaledger/twin-telemetry/commit/2edc5ac665b996a1b29173cac3b389fa3ceafa34))
|
|
9
66
|
|
|
10
67
|
|
|
11
68
|
### Dependencies
|
|
@@ -14,25 +71,25 @@
|
|
|
14
71
|
* dependencies
|
|
15
72
|
* @twin.org/telemetry-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
16
73
|
|
|
17
|
-
## [0.0.3-next.1](https://github.com/
|
|
74
|
+
## [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)
|
|
18
75
|
|
|
19
76
|
|
|
20
77
|
### Features
|
|
21
78
|
|
|
22
|
-
* add context id features ([#19](https://github.com/
|
|
23
|
-
* add validate-locales ([24ed804](https://github.com/
|
|
24
|
-
* eslint migration to flat config ([69ac91a](https://github.com/
|
|
25
|
-
* remove unused namespace ([54939fa](https://github.com/
|
|
26
|
-
* remove unused namespace ([02dcabb](https://github.com/
|
|
27
|
-
* update dependencies ([0e55c48](https://github.com/
|
|
28
|
-
* update framework core ([4b10bcd](https://github.com/
|
|
29
|
-
* use shared store mechanism ([#7](https://github.com/
|
|
79
|
+
* add context id features ([#19](https://github.com/iotaledger/twin-telemetry/issues/19)) ([5942442](https://github.com/iotaledger/twin-telemetry/commit/5942442991fa7ad7afa9d8b7c4583326a8c4c9ae))
|
|
80
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
81
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
82
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
83
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
84
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
85
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
86
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
30
87
|
|
|
31
88
|
|
|
32
89
|
### Bug Fixes
|
|
33
90
|
|
|
34
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
35
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
91
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
92
|
+
* 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))
|
|
36
93
|
|
|
37
94
|
|
|
38
95
|
### Dependencies
|
|
@@ -41,12 +98,12 @@
|
|
|
41
98
|
* dependencies
|
|
42
99
|
* @twin.org/telemetry-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
43
100
|
|
|
44
|
-
## [0.0.2-next.3](https://github.com/
|
|
101
|
+
## [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)
|
|
45
102
|
|
|
46
103
|
|
|
47
104
|
### Features
|
|
48
105
|
|
|
49
|
-
* add validate-locales ([24ed804](https://github.com/
|
|
106
|
+
* add validate-locales ([24ed804](https://github.com/iotaledger/twin-telemetry/commit/24ed804f7ebc47036f323722bc18452729860c92))
|
|
50
107
|
|
|
51
108
|
|
|
52
109
|
### Dependencies
|
|
@@ -55,12 +112,12 @@
|
|
|
55
112
|
* dependencies
|
|
56
113
|
* @twin.org/telemetry-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
57
114
|
|
|
58
|
-
## [0.0.2-next.2](https://github.com/
|
|
115
|
+
## [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)
|
|
59
116
|
|
|
60
117
|
|
|
61
118
|
### Features
|
|
62
119
|
|
|
63
|
-
* eslint migration to flat config ([69ac91a](https://github.com/
|
|
120
|
+
* eslint migration to flat config ([69ac91a](https://github.com/iotaledger/twin-telemetry/commit/69ac91a89d0b5bc63374a0bd314f770b557dabb4))
|
|
64
121
|
|
|
65
122
|
|
|
66
123
|
### Dependencies
|
|
@@ -69,22 +126,22 @@
|
|
|
69
126
|
* dependencies
|
|
70
127
|
* @twin.org/telemetry-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
71
128
|
|
|
72
|
-
## [0.0.2-next.1](https://github.com/
|
|
129
|
+
## [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)
|
|
73
130
|
|
|
74
131
|
|
|
75
132
|
### Features
|
|
76
133
|
|
|
77
|
-
* remove unused namespace ([54939fa](https://github.com/
|
|
78
|
-
* remove unused namespace ([02dcabb](https://github.com/
|
|
79
|
-
* update dependencies ([0e55c48](https://github.com/
|
|
80
|
-
* update framework core ([4b10bcd](https://github.com/
|
|
81
|
-
* use shared store mechanism ([#7](https://github.com/
|
|
134
|
+
* remove unused namespace ([54939fa](https://github.com/iotaledger/twin-telemetry/commit/54939faac3790dc1b51aa96a54005a03c99f98da))
|
|
135
|
+
* remove unused namespace ([02dcabb](https://github.com/iotaledger/twin-telemetry/commit/02dcabbe00f5b03d5e4b2c12e655efac50409acf))
|
|
136
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
137
|
+
* update framework core ([4b10bcd](https://github.com/iotaledger/twin-telemetry/commit/4b10bcd4d3101151671bdcf9aef7c54f5937fc2a))
|
|
138
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
82
139
|
|
|
83
140
|
|
|
84
141
|
### Bug Fixes
|
|
85
142
|
|
|
86
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
87
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
143
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
144
|
+
* 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))
|
|
88
145
|
|
|
89
146
|
|
|
90
147
|
### Dependencies
|
|
@@ -98,7 +155,7 @@
|
|
|
98
155
|
|
|
99
156
|
### Features
|
|
100
157
|
|
|
101
|
-
* release to production ([df2151d](https://github.com/
|
|
158
|
+
* release to production ([df2151d](https://github.com/iotaledger/twin-telemetry/commit/df2151d24844fd2c3e6092ce3a6f888ac16219a0))
|
|
102
159
|
|
|
103
160
|
|
|
104
161
|
### Dependencies
|
|
@@ -107,12 +164,12 @@
|
|
|
107
164
|
* dependencies
|
|
108
165
|
* @twin.org/telemetry-models bumped from ^0.0.0 to ^0.0.1
|
|
109
166
|
|
|
110
|
-
## [0.0.1-next.18](https://github.com/
|
|
167
|
+
## [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)
|
|
111
168
|
|
|
112
169
|
|
|
113
170
|
### Bug Fixes
|
|
114
171
|
|
|
115
|
-
* query params force coercion ([ec7999e](https://github.com/
|
|
172
|
+
* query params force coercion ([ec7999e](https://github.com/iotaledger/twin-telemetry/commit/ec7999eadb66c65585efa19f3ce4cabb50eed761))
|
|
116
173
|
|
|
117
174
|
|
|
118
175
|
### Dependencies
|
|
@@ -121,12 +178,12 @@
|
|
|
121
178
|
* dependencies
|
|
122
179
|
* @twin.org/telemetry-models bumped from 0.0.1-next.17 to 0.0.1-next.18
|
|
123
180
|
|
|
124
|
-
## [0.0.1-next.17](https://github.com/
|
|
181
|
+
## [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)
|
|
125
182
|
|
|
126
183
|
|
|
127
184
|
### Features
|
|
128
185
|
|
|
129
|
-
* update dependencies ([0e55c48](https://github.com/
|
|
186
|
+
* update dependencies ([0e55c48](https://github.com/iotaledger/twin-telemetry/commit/0e55c48de4139c6fe66b823101ca17973e60847c))
|
|
130
187
|
|
|
131
188
|
|
|
132
189
|
### Dependencies
|
|
@@ -135,12 +192,12 @@
|
|
|
135
192
|
* dependencies
|
|
136
193
|
* @twin.org/telemetry-models bumped from 0.0.1-next.16 to 0.0.1-next.17
|
|
137
194
|
|
|
138
|
-
## [0.0.1-next.16](https://github.com/
|
|
195
|
+
## [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)
|
|
139
196
|
|
|
140
197
|
|
|
141
198
|
### Features
|
|
142
199
|
|
|
143
|
-
* use shared store mechanism ([#7](https://github.com/
|
|
200
|
+
* use shared store mechanism ([#7](https://github.com/iotaledger/twin-telemetry/issues/7)) ([806fe2c](https://github.com/iotaledger/twin-telemetry/commit/806fe2c2b7653d6b949c27ebf57bd13c3e040242))
|
|
144
201
|
|
|
145
202
|
|
|
146
203
|
### Dependencies
|
|
@@ -149,12 +206,12 @@
|
|
|
149
206
|
* dependencies
|
|
150
207
|
* @twin.org/telemetry-models bumped from 0.0.1-next.15 to 0.0.1-next.16
|
|
151
208
|
|
|
152
|
-
## [0.0.1-next.15](https://github.com/
|
|
209
|
+
## [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)
|
|
153
210
|
|
|
154
211
|
|
|
155
212
|
### Bug Fixes
|
|
156
213
|
|
|
157
|
-
* Update metric endpoint paths by removing trailing slashes and query type as string ([#3](https://github.com/
|
|
214
|
+
* 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))
|
|
158
215
|
|
|
159
216
|
|
|
160
217
|
### 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
|
+
```
|
package/docs/open-api/spec.json
CHANGED
|
@@ -844,6 +844,7 @@
|
|
|
844
844
|
"components": {
|
|
845
845
|
"schemas": {
|
|
846
846
|
"Error": {
|
|
847
|
+
"description": "Model to describe serialized error.",
|
|
847
848
|
"type": "object",
|
|
848
849
|
"properties": {
|
|
849
850
|
"name": {
|
|
@@ -852,7 +853,7 @@
|
|
|
852
853
|
},
|
|
853
854
|
"message": {
|
|
854
855
|
"type": "string",
|
|
855
|
-
"description": "The message for the error."
|
|
856
|
+
"description": "The message for the error as an i18n key."
|
|
856
857
|
},
|
|
857
858
|
"source": {
|
|
858
859
|
"type": "string",
|
|
@@ -874,28 +875,24 @@
|
|
|
874
875
|
"required": [
|
|
875
876
|
"name",
|
|
876
877
|
"message"
|
|
877
|
-
]
|
|
878
|
-
"description": "Model to describe serialized error."
|
|
878
|
+
]
|
|
879
879
|
},
|
|
880
880
|
"MetricType": {
|
|
881
|
+
"description": "The types of metrics.",
|
|
881
882
|
"anyOf": [
|
|
882
883
|
{
|
|
883
|
-
"type": "number",
|
|
884
884
|
"const": 0,
|
|
885
885
|
"description": "Counter."
|
|
886
886
|
},
|
|
887
887
|
{
|
|
888
|
-
"type": "number",
|
|
889
888
|
"const": 1,
|
|
890
889
|
"description": "Increment Decrement Counter."
|
|
891
890
|
},
|
|
892
891
|
{
|
|
893
|
-
"type": "number",
|
|
894
892
|
"const": 2,
|
|
895
893
|
"description": "Gauge."
|
|
896
894
|
}
|
|
897
|
-
]
|
|
898
|
-
"description": "The types of metrics."
|
|
895
|
+
]
|
|
899
896
|
},
|
|
900
897
|
"TelemetryAddMetricValueRequest": {
|
|
901
898
|
"type": "object",
|
|
@@ -903,11 +900,9 @@
|
|
|
903
900
|
"value": {
|
|
904
901
|
"anyOf": [
|
|
905
902
|
{
|
|
906
|
-
"type": "string",
|
|
907
903
|
"const": "inc"
|
|
908
904
|
},
|
|
909
905
|
{
|
|
910
|
-
"type": "string",
|
|
911
906
|
"const": "dec"
|
|
912
907
|
},
|
|
913
908
|
{
|
|
@@ -964,6 +959,7 @@
|
|
|
964
959
|
"description": "The response payload."
|
|
965
960
|
},
|
|
966
961
|
"TelemetryMetric": {
|
|
962
|
+
"description": "Interface describing a telemetry metric.",
|
|
967
963
|
"type": "object",
|
|
968
964
|
"properties": {
|
|
969
965
|
"id": {
|
|
@@ -984,16 +980,20 @@
|
|
|
984
980
|
"unit": {
|
|
985
981
|
"type": "string",
|
|
986
982
|
"description": "The unit the metric describes."
|
|
983
|
+
},
|
|
984
|
+
"maxHistory": {
|
|
985
|
+
"type": "number",
|
|
986
|
+
"description": "The maximum number of values to retain; oldest are trimmed on each addMetricValue call.\nUnlimited when absent."
|
|
987
987
|
}
|
|
988
988
|
},
|
|
989
989
|
"required": [
|
|
990
990
|
"id",
|
|
991
991
|
"label",
|
|
992
992
|
"type"
|
|
993
|
-
]
|
|
994
|
-
"description": "Interface describing a telemetry metric."
|
|
993
|
+
]
|
|
995
994
|
},
|
|
996
995
|
"TelemetryMetricValue": {
|
|
996
|
+
"description": "Interface describing a telemetry metric value.",
|
|
997
997
|
"type": "object",
|
|
998
998
|
"properties": {
|
|
999
999
|
"id": {
|
|
@@ -1018,8 +1018,7 @@
|
|
|
1018
1018
|
"id",
|
|
1019
1019
|
"ts",
|
|
1020
1020
|
"value"
|
|
1021
|
-
]
|
|
1022
|
-
"description": "Interface describing a telemetry metric value."
|
|
1021
|
+
]
|
|
1023
1022
|
},
|
|
1024
1023
|
"TelemetryUpdateMetricRequest": {
|
|
1025
1024
|
"type": "object",
|
|
@@ -28,7 +28,7 @@ The options for the connector.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### CLASS\_NAME
|
|
31
|
+
### CLASS\_NAME {#class_name}
|
|
32
32
|
|
|
33
33
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ Runtime name for the class.
|
|
|
36
36
|
|
|
37
37
|
## Methods
|
|
38
38
|
|
|
39
|
-
### className()
|
|
39
|
+
### className() {#classname}
|
|
40
40
|
|
|
41
41
|
> **className**(): `string`
|
|
42
42
|
|
|
@@ -54,7 +54,7 @@ The class name of the component.
|
|
|
54
54
|
|
|
55
55
|
***
|
|
56
56
|
|
|
57
|
-
### createMetric()
|
|
57
|
+
### createMetric() {#createmetric}
|
|
58
58
|
|
|
59
59
|
> **createMetric**(`metric`): `Promise`\<`void`\>
|
|
60
60
|
|
|
@@ -80,7 +80,7 @@ Nothing.
|
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
83
|
-
### getMetric()
|
|
83
|
+
### getMetric() {#getmetric}
|
|
84
84
|
|
|
85
85
|
> **getMetric**(`id`): `Promise`\<\{ `metric`: `ITelemetryMetric`; `value`: `ITelemetryMetricValue`; \}\>
|
|
86
86
|
|
|
@@ -106,7 +106,7 @@ The metric details and it's most recent value.
|
|
|
106
106
|
|
|
107
107
|
***
|
|
108
108
|
|
|
109
|
-
### updateMetric()
|
|
109
|
+
### updateMetric() {#updatemetric}
|
|
110
110
|
|
|
111
111
|
> **updateMetric**(`metric`): `Promise`\<`void`\>
|
|
112
112
|
|
|
@@ -132,7 +132,7 @@ Nothing.
|
|
|
132
132
|
|
|
133
133
|
***
|
|
134
134
|
|
|
135
|
-
### addMetricValue()
|
|
135
|
+
### addMetricValue() {#addmetricvalue}
|
|
136
136
|
|
|
137
137
|
> **addMetricValue**(`id`, `value`, `customData?`): `Promise`\<`string`\>
|
|
138
138
|
|
|
@@ -148,9 +148,9 @@ The id of the metric.
|
|
|
148
148
|
|
|
149
149
|
##### value
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
`number` \| `"inc"` \| `"dec"`
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
The value for the add operation.
|
|
154
154
|
|
|
155
155
|
##### customData?
|
|
156
156
|
|
|
@@ -168,7 +168,7 @@ The created metric value id.
|
|
|
168
168
|
|
|
169
169
|
***
|
|
170
170
|
|
|
171
|
-
### removeMetric()
|
|
171
|
+
### removeMetric() {#removemetric}
|
|
172
172
|
|
|
173
173
|
> **removeMetric**(`id`): `Promise`\<`void`\>
|
|
174
174
|
|
|
@@ -194,7 +194,7 @@ Nothing.
|
|
|
194
194
|
|
|
195
195
|
***
|
|
196
196
|
|
|
197
|
-
### query()
|
|
197
|
+
### query() {#query}
|
|
198
198
|
|
|
199
199
|
> **query**(`type?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `ITelemetryMetric`[]; `cursor?`: `string`; \}\>
|
|
200
200
|
|
|
@@ -237,7 +237,7 @@ NotImplementedError if the implementation does not support retrieval.
|
|
|
237
237
|
|
|
238
238
|
***
|
|
239
239
|
|
|
240
|
-
### queryValues()
|
|
240
|
+
### queryValues() {#queryvalues}
|
|
241
241
|
|
|
242
242
|
> **queryValues**(`id`, `timeStart?`, `timeEnd?`, `cursor?`, `limit?`): `Promise`\<\{ `metric`: `ITelemetryMetric`; `entities`: `ITelemetryMetricValue`[]; `cursor?`: `string`; \}\>
|
|
243
243
|
|
|
@@ -4,9 +4,9 @@ The options for the telemetry service constructor.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### telemetryConnectorType?
|
|
7
|
+
### telemetryConnectorType? {#telemetryconnectortype}
|
|
8
8
|
|
|
9
|
-
> `optional` **telemetryConnectorType
|
|
9
|
+
> `optional` **telemetryConnectorType?**: `string`
|
|
10
10
|
|
|
11
11
|
The type of the telemetry connector to use.
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/telemetry-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "Telemetry
|
|
3
|
+
"version": "0.0.3-next.5",
|
|
4
|
+
"description": "Telemetry service implementation with REST entry points.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/telemetry.git",
|
|
8
8
|
"directory": "packages/telemetry-service"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
|
-
"@twin.org/telemetry-models": "0.0.3-next.
|
|
21
|
+
"@twin.org/telemetry-models": "0.0.3-next.5",
|
|
22
22
|
"@twin.org/web": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/es/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"business-logic"
|
|
50
50
|
],
|
|
51
51
|
"bugs": {
|
|
52
|
-
"url": "git+https://github.com/
|
|
52
|
+
"url": "git+https://github.com/iotaledger/telemetry/issues"
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://twindev.org"
|
|
55
55
|
}
|