@3sixty/telemetry-models 0.0.0-stage → 0.20.0-next.0

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.
Files changed (120) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/connectors/multiTelemetryConnector.js +184 -0
  4. package/dist/es/connectors/multiTelemetryConnector.js.map +1 -0
  5. package/dist/es/connectors/silentTelemetryConnector.js +57 -0
  6. package/dist/es/connectors/silentTelemetryConnector.js.map +1 -0
  7. package/dist/es/factories/metricsProducerFactory.js +13 -0
  8. package/dist/es/factories/metricsProducerFactory.js.map +1 -0
  9. package/dist/es/factories/telemetryConnectorFactory.js +9 -0
  10. package/dist/es/factories/telemetryConnectorFactory.js.map +1 -0
  11. package/dist/es/helpers/metricHelper.js +139 -0
  12. package/dist/es/helpers/metricHelper.js.map +1 -0
  13. package/dist/es/index.js +30 -0
  14. package/dist/es/index.js.map +1 -0
  15. package/dist/es/models/IMetricsCollectorComponent.js +2 -0
  16. package/dist/es/models/IMetricsCollectorComponent.js.map +1 -0
  17. package/dist/es/models/IMetricsProducer.js +2 -0
  18. package/dist/es/models/IMetricsProducer.js.map +1 -0
  19. package/dist/es/models/IMultiTelemetryConnectorConstructorOptions.js +4 -0
  20. package/dist/es/models/IMultiTelemetryConnectorConstructorOptions.js.map +1 -0
  21. package/dist/es/models/ITelemetryComponent.js +2 -0
  22. package/dist/es/models/ITelemetryComponent.js.map +1 -0
  23. package/dist/es/models/ITelemetryConnector.js +2 -0
  24. package/dist/es/models/ITelemetryConnector.js.map +1 -0
  25. package/dist/es/models/ITelemetryMetric.js +2 -0
  26. package/dist/es/models/ITelemetryMetric.js.map +1 -0
  27. package/dist/es/models/ITelemetryMetricValue.js +4 -0
  28. package/dist/es/models/ITelemetryMetricValue.js.map +1 -0
  29. package/dist/es/models/ITelemetryMetricValueEntry.js +2 -0
  30. package/dist/es/models/ITelemetryMetricValueEntry.js.map +1 -0
  31. package/dist/es/models/api/ITelemetryAddMetricValueRequest.js +2 -0
  32. package/dist/es/models/api/ITelemetryAddMetricValueRequest.js.map +1 -0
  33. package/dist/es/models/api/ITelemetryCreateMetricRequest.js +2 -0
  34. package/dist/es/models/api/ITelemetryCreateMetricRequest.js.map +1 -0
  35. package/dist/es/models/api/ITelemetryGetMetricRequest.js +4 -0
  36. package/dist/es/models/api/ITelemetryGetMetricRequest.js.map +1 -0
  37. package/dist/es/models/api/ITelemetryGetMetricResponse.js +2 -0
  38. package/dist/es/models/api/ITelemetryGetMetricResponse.js.map +1 -0
  39. package/dist/es/models/api/ITelemetryGetMetricValueRequest.js +4 -0
  40. package/dist/es/models/api/ITelemetryGetMetricValueRequest.js.map +1 -0
  41. package/dist/es/models/api/ITelemetryGetMetricValueResponse.js +2 -0
  42. package/dist/es/models/api/ITelemetryGetMetricValueResponse.js.map +1 -0
  43. package/dist/es/models/api/ITelemetryListRequest.js +4 -0
  44. package/dist/es/models/api/ITelemetryListRequest.js.map +1 -0
  45. package/dist/es/models/api/ITelemetryListResponse.js +2 -0
  46. package/dist/es/models/api/ITelemetryListResponse.js.map +1 -0
  47. package/dist/es/models/api/ITelemetryRemoveMetricRequest.js +4 -0
  48. package/dist/es/models/api/ITelemetryRemoveMetricRequest.js.map +1 -0
  49. package/dist/es/models/api/ITelemetryUpdateMetricRequest.js +4 -0
  50. package/dist/es/models/api/ITelemetryUpdateMetricRequest.js.map +1 -0
  51. package/dist/es/models/api/ITelemetryValuesListRequest.js +4 -0
  52. package/dist/es/models/api/ITelemetryValuesListRequest.js.map +1 -0
  53. package/dist/es/models/api/ITelemetryValuesListResponse.js +2 -0
  54. package/dist/es/models/api/ITelemetryValuesListResponse.js.map +1 -0
  55. package/dist/es/models/metricCounterOperation.js +17 -0
  56. package/dist/es/models/metricCounterOperation.js.map +1 -0
  57. package/dist/es/models/metricType.js +21 -0
  58. package/dist/es/models/metricType.js.map +1 -0
  59. package/dist/types/connectors/multiTelemetryConnector.d.ts +124 -0
  60. package/dist/types/connectors/silentTelemetryConnector.d.ts +56 -0
  61. package/dist/types/factories/metricsProducerFactory.d.ts +10 -0
  62. package/dist/types/factories/telemetryConnectorFactory.d.ts +6 -0
  63. package/dist/types/helpers/metricHelper.d.ts +67 -0
  64. package/dist/types/index.d.ts +27 -0
  65. package/dist/types/models/IMetricsCollectorComponent.d.ts +6 -0
  66. package/dist/types/models/IMetricsProducer.d.ts +27 -0
  67. package/dist/types/models/IMultiTelemetryConnectorConstructorOptions.d.ts +9 -0
  68. package/dist/types/models/ITelemetryComponent.d.ts +109 -0
  69. package/dist/types/models/ITelemetryConnector.d.ts +109 -0
  70. package/dist/types/models/ITelemetryMetric.d.ts +31 -0
  71. package/dist/types/models/ITelemetryMetricValue.d.ts +23 -0
  72. package/dist/types/models/ITelemetryMetricValueEntry.d.ts +20 -0
  73. package/dist/types/models/api/ITelemetryAddMetricValueRequest.d.ts +30 -0
  74. package/dist/types/models/api/ITelemetryCreateMetricRequest.d.ts +11 -0
  75. package/dist/types/models/api/ITelemetryGetMetricRequest.d.ts +14 -0
  76. package/dist/types/models/api/ITelemetryGetMetricResponse.d.ts +20 -0
  77. package/dist/types/models/api/ITelemetryGetMetricValueRequest.d.ts +18 -0
  78. package/dist/types/models/api/ITelemetryGetMetricValueResponse.d.ts +10 -0
  79. package/dist/types/models/api/ITelemetryListRequest.d.ts +22 -0
  80. package/dist/types/models/api/ITelemetryListResponse.d.ts +19 -0
  81. package/dist/types/models/api/ITelemetryRemoveMetricRequest.d.ts +14 -0
  82. package/dist/types/models/api/ITelemetryUpdateMetricRequest.d.ts +31 -0
  83. package/dist/types/models/api/ITelemetryValuesListRequest.d.ts +35 -0
  84. package/dist/types/models/api/ITelemetryValuesListResponse.d.ts +24 -0
  85. package/dist/types/models/metricCounterOperation.d.ts +17 -0
  86. package/dist/types/models/metricType.d.ts +21 -0
  87. package/docs/changelog.md +0 -0
  88. package/docs/examples.md +142 -0
  89. package/docs/reference/classes/MetricHelper.md +226 -0
  90. package/docs/reference/classes/MultiTelemetryConnector.md +357 -0
  91. package/docs/reference/classes/SilentTelemetryConnector.md +191 -0
  92. package/docs/reference/index.md +42 -0
  93. package/docs/reference/interfaces/IMetricsCollectorComponent.md +7 -0
  94. package/docs/reference/interfaces/IMetricsProducer.md +45 -0
  95. package/docs/reference/interfaces/IMultiTelemetryConnectorConstructorOptions.md +11 -0
  96. package/docs/reference/interfaces/ITelemetryAddMetricValueRequest.md +41 -0
  97. package/docs/reference/interfaces/ITelemetryComponent.md +271 -0
  98. package/docs/reference/interfaces/ITelemetryConnector.md +271 -0
  99. package/docs/reference/interfaces/ITelemetryCreateMetricRequest.md +12 -0
  100. package/docs/reference/interfaces/ITelemetryGetMetricRequest.md +17 -0
  101. package/docs/reference/interfaces/ITelemetryGetMetricResponse.md +23 -0
  102. package/docs/reference/interfaces/ITelemetryGetMetricValueRequest.md +23 -0
  103. package/docs/reference/interfaces/ITelemetryGetMetricValueResponse.md +11 -0
  104. package/docs/reference/interfaces/ITelemetryListRequest.md +29 -0
  105. package/docs/reference/interfaces/ITelemetryListResponse.md +23 -0
  106. package/docs/reference/interfaces/ITelemetryMetric.md +52 -0
  107. package/docs/reference/interfaces/ITelemetryMetricValue.md +39 -0
  108. package/docs/reference/interfaces/ITelemetryMetricValueEntry.md +31 -0
  109. package/docs/reference/interfaces/ITelemetryRemoveMetricRequest.md +17 -0
  110. package/docs/reference/interfaces/ITelemetryUpdateMetricRequest.md +43 -0
  111. package/docs/reference/interfaces/ITelemetryValuesListRequest.md +49 -0
  112. package/docs/reference/interfaces/ITelemetryValuesListResponse.md +29 -0
  113. package/docs/reference/type-aliases/MetricCounterOperation.md +5 -0
  114. package/docs/reference/type-aliases/MetricType.md +5 -0
  115. package/docs/reference/variables/MetricCounterOperation.md +19 -0
  116. package/docs/reference/variables/MetricType.md +25 -0
  117. package/docs/reference/variables/MetricsProducerFactory.md +9 -0
  118. package/docs/reference/variables/TelemetryConnectorFactory.md +5 -0
  119. package/locales/en.json +7 -0
  120. package/package.json +51 -5
@@ -0,0 +1,139 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { AlreadyExistsError, BaseError, Is } from "@3sixty/core";
4
+ import { MetricCounterOperation } from "../models/metricCounterOperation.js";
5
+ /**
6
+ * Helper class for performing common metric operations, swallowing any errors from the telemetry component.
7
+ */
8
+ export class MetricHelper {
9
+ /**
10
+ * Create multiple metrics if they don't already exist, swallowing any already exists errors.
11
+ * A convenience wrapper over createMetric for callers that always have a list.
12
+ * @param telemetryComponent The telemetry component to use for creating the metrics.
13
+ * @param metrics The telemetry metrics to create.
14
+ * @returns A promise that resolves when all metrics have been created or confirmed to exist.
15
+ */
16
+ static async createMetrics(telemetryComponent, metrics) {
17
+ if (Is.arrayValue(metrics)) {
18
+ await MetricHelper.createMetric(telemetryComponent, metrics);
19
+ }
20
+ }
21
+ /**
22
+ * Create one or more metrics if they don't already exist, swallowing any already exists errors.
23
+ * @param telemetryComponent The telemetry component to use for creating the metrics.
24
+ * @param metric The telemetry metric to create, or the metrics to create.
25
+ * @returns A promise that resolves when the metrics have been created or confirmed to exist.
26
+ */
27
+ static async createMetric(telemetryComponent, metric) {
28
+ if (!Is.undefined(telemetryComponent)) {
29
+ try {
30
+ await telemetryComponent.createMetric(metric);
31
+ }
32
+ catch (err) {
33
+ // If the metric already exists, we can ignore the error. Otherwise, rethrow it.
34
+ if (!BaseError.isErrorName(err, AlreadyExistsError.CLASS_NAME)) {
35
+ throw err;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ /**
41
+ * Increment a metric counter, swallowing any telemetry errors.
42
+ * @param telemetryComponent The telemetry component to use for incrementing the metric.
43
+ * @param id The metric ID.
44
+ * @param customData Optional custom data for the increment.
45
+ * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.
46
+ * @returns A promise that resolves when the increment has been recorded or the error swallowed.
47
+ */
48
+ static async metricIncrement(telemetryComponent, id, customData, onError) {
49
+ if (!Is.undefined(telemetryComponent)) {
50
+ try {
51
+ await telemetryComponent.addMetricValue(id, MetricCounterOperation.Increment, customData);
52
+ }
53
+ catch (err) {
54
+ // This method is designed to swallow any errors from the telemetry component
55
+ // So it can safely be called without interrupting any external flows.
56
+ await MetricHelper.notifyError(onError, err);
57
+ }
58
+ }
59
+ }
60
+ /**
61
+ * Decrement a metric counter, swallowing any telemetry errors.
62
+ * @param telemetryComponent The telemetry component to use for decrementing the metric.
63
+ * @param id The metric ID.
64
+ * @param customData Optional custom data for the decrement.
65
+ * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.
66
+ * @returns A promise that resolves when the decrement has been recorded or the error swallowed.
67
+ */
68
+ static async metricDecrement(telemetryComponent, id, customData, onError) {
69
+ if (!Is.undefined(telemetryComponent)) {
70
+ try {
71
+ await telemetryComponent.addMetricValue(id, MetricCounterOperation.Decrement, customData);
72
+ }
73
+ catch (err) {
74
+ // This method is designed to swallow any errors from the telemetry component
75
+ // So it can safely be called without interrupting any external flows.
76
+ await MetricHelper.notifyError(onError, err);
77
+ }
78
+ }
79
+ }
80
+ /**
81
+ * Set a metric value, swallowing any telemetry errors.
82
+ * @param telemetryComponent The telemetry component to use for setting the metric value.
83
+ * @param id The metric ID.
84
+ * @param value The metric value to set.
85
+ * @param customData Optional custom data for setting the value.
86
+ * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.
87
+ * @returns A promise that resolves when the value has been recorded or the error swallowed.
88
+ */
89
+ static async metricValue(telemetryComponent, id, value, customData, onError) {
90
+ if (!Is.undefined(telemetryComponent)) {
91
+ try {
92
+ await telemetryComponent.addMetricValue(id, value, customData);
93
+ }
94
+ catch (err) {
95
+ // This method is designed to swallow any errors from the telemetry component
96
+ // So it can safely be called without interrupting any external flows.
97
+ await MetricHelper.notifyError(onError, err);
98
+ }
99
+ }
100
+ }
101
+ /**
102
+ * Set several metric values at once, swallowing any telemetry errors.
103
+ * Components which support it record the whole set in one operation, which for a persisted
104
+ * connector is a single write rather than one per value.
105
+ * @param telemetryComponent The telemetry component to use for setting the metric values.
106
+ * @param values The metric values to set.
107
+ * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.
108
+ * @returns A promise that resolves when the values have been recorded or the error swallowed.
109
+ */
110
+ static async metricValues(telemetryComponent, values, onError) {
111
+ if (!Is.undefined(telemetryComponent) && Is.arrayValue(values)) {
112
+ try {
113
+ await telemetryComponent.addMetricValues(values);
114
+ }
115
+ catch (err) {
116
+ // This method is designed to swallow any errors from the telemetry component
117
+ // So it can safely be called without interrupting any external flows.
118
+ await MetricHelper.notifyError(onError, err);
119
+ }
120
+ }
121
+ }
122
+ /**
123
+ * Invoke the caller's error callback, swallowing anything it throws so a broken callback can
124
+ * never break the never-interrupt contract of the calling method.
125
+ * @param onError The optional callback to invoke.
126
+ * @param err The error to pass to the callback.
127
+ * @returns A promise that resolves once the callback has run or failed.
128
+ * @internal
129
+ */
130
+ static async notifyError(onError, err) {
131
+ try {
132
+ await onError?.(err);
133
+ }
134
+ catch {
135
+ // The onError callback must never be able to break the swallow contract above.
136
+ }
137
+ }
138
+ }
139
+ //# sourceMappingURL=metricHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricHelper.js","sourceRoot":"","sources":["../../../src/helpers/metricHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,YAAY;IACxB;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAChC,kBAAmD,EACnD,OAA2B;QAE3B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,YAAY,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAA6C;QAE7C,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAC/C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,gFAAgF;gBAChF,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;oBAChE,MAAM,GAAG,CAAC;gBACX,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,eAAe,CAClC,kBAAmD,EACnD,EAAU,EACV,UAAuC,EACvC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAC3F,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,eAAe,CAClC,kBAAmD,EACnD,EAAU,EACV,UAAuC,EACvC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAC3F,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAC9B,kBAAmD,EACnD,EAAU,EACV,KAAa,EACb,UAAuC,EACvC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAAoC,EACpC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,KAAK,CAAC,WAAW,CAC/B,OAA6D,EAC7D,GAAY;QAEZ,IAAI,CAAC;YACJ,MAAM,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACR,+EAA+E;QAChF,CAAC;IACF,CAAC;CACD","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AlreadyExistsError, BaseError, Is } from \"@3sixty/core\";\nimport type { ITelemetryComponent } from \"../models/ITelemetryComponent.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\n\n/**\n * Helper class for performing common metric operations, swallowing any errors from the telemetry component.\n */\nexport class MetricHelper {\n\t/**\n\t * Create multiple metrics if they don't already exist, swallowing any already exists errors.\n\t * A convenience wrapper over createMetric for callers that always have a list.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metrics The telemetry metrics to create.\n\t * @returns A promise that resolves when all metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetrics(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetrics: ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (Is.arrayValue(metrics)) {\n\t\t\tawait MetricHelper.createMetric(telemetryComponent, metrics);\n\t\t}\n\t}\n\n\t/**\n\t * Create one or more metrics if they don't already exist, swallowing any already exists errors.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metric The telemetry metric to create, or the metrics to create.\n\t * @returns A promise that resolves when the metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetric(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetric: ITelemetryMetric | ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.createMetric(metric);\n\t\t\t} catch (err) {\n\t\t\t\t// If the metric already exists, we can ignore the error. Otherwise, rethrow it.\n\t\t\t\tif (!BaseError.isErrorName(err, AlreadyExistsError.CLASS_NAME)) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Increment a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for incrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the increment.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the increment has been recorded or the error swallowed.\n\t */\n\tpublic static async metricIncrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Increment, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Decrement a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for decrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the decrement.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the decrement has been recorded or the error swallowed.\n\t */\n\tpublic static async metricDecrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Decrement, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set a metric value, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for setting the metric value.\n\t * @param id The metric ID.\n\t * @param value The metric value to set.\n\t * @param customData Optional custom data for setting the value.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the value has been recorded or the error swallowed.\n\t */\n\tpublic static async metricValue(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tvalue: number,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, value, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set several metric values at once, swallowing any telemetry errors.\n\t * Components which support it record the whole set in one operation, which for a persisted\n\t * connector is a single write rather than one per value.\n\t * @param telemetryComponent The telemetry component to use for setting the metric values.\n\t * @param values The metric values to set.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the values have been recorded or the error swallowed.\n\t */\n\tpublic static async metricValues(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tvalues: ITelemetryMetricValueEntry[],\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent) && Is.arrayValue(values)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValues(values);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Invoke the caller's error callback, swallowing anything it throws so a broken callback can\n\t * never break the never-interrupt contract of the calling method.\n\t * @param onError The optional callback to invoke.\n\t * @param err The error to pass to the callback.\n\t * @returns A promise that resolves once the callback has run or failed.\n\t * @internal\n\t */\n\tprivate static async notifyError(\n\t\tonError: ((err: unknown) => Promise<void> | void) | undefined,\n\t\terr: unknown\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait onError?.(err);\n\t\t} catch {\n\t\t\t// The onError callback must never be able to break the swallow contract above.\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,30 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./connectors/multiTelemetryConnector.js";
4
+ export * from "./connectors/silentTelemetryConnector.js";
5
+ export * from "./factories/metricsProducerFactory.js";
6
+ export * from "./factories/telemetryConnectorFactory.js";
7
+ export * from "./helpers/metricHelper.js";
8
+ export * from "./models/api/ITelemetryAddMetricValueRequest.js";
9
+ export * from "./models/api/ITelemetryCreateMetricRequest.js";
10
+ export * from "./models/api/ITelemetryGetMetricRequest.js";
11
+ export * from "./models/api/ITelemetryGetMetricResponse.js";
12
+ export * from "./models/api/ITelemetryGetMetricValueRequest.js";
13
+ export * from "./models/api/ITelemetryGetMetricValueResponse.js";
14
+ export * from "./models/api/ITelemetryListRequest.js";
15
+ export * from "./models/api/ITelemetryListResponse.js";
16
+ export * from "./models/api/ITelemetryRemoveMetricRequest.js";
17
+ export * from "./models/api/ITelemetryUpdateMetricRequest.js";
18
+ export * from "./models/api/ITelemetryValuesListRequest.js";
19
+ export * from "./models/api/ITelemetryValuesListResponse.js";
20
+ export * from "./models/IMetricsCollectorComponent.js";
21
+ export * from "./models/IMetricsProducer.js";
22
+ export * from "./models/IMultiTelemetryConnectorConstructorOptions.js";
23
+ export * from "./models/ITelemetryComponent.js";
24
+ export * from "./models/ITelemetryConnector.js";
25
+ export * from "./models/ITelemetryMetric.js";
26
+ export * from "./models/ITelemetryMetricValue.js";
27
+ export * from "./models/ITelemetryMetricValueEntry.js";
28
+ export * from "./models/metricCounterOperation.js";
29
+ export * from "./models/metricType.js";
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wDAAwD,CAAC;AACvE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./connectors/multiTelemetryConnector.js\";\nexport * from \"./connectors/silentTelemetryConnector.js\";\nexport * from \"./factories/metricsProducerFactory.js\";\nexport * from \"./factories/telemetryConnectorFactory.js\";\nexport * from \"./helpers/metricHelper.js\";\nexport * from \"./models/api/ITelemetryAddMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryCreateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricResponse.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueResponse.js\";\nexport * from \"./models/api/ITelemetryListRequest.js\";\nexport * from \"./models/api/ITelemetryListResponse.js\";\nexport * from \"./models/api/ITelemetryRemoveMetricRequest.js\";\nexport * from \"./models/api/ITelemetryUpdateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListResponse.js\";\nexport * from \"./models/IMetricsCollectorComponent.js\";\nexport * from \"./models/IMetricsProducer.js\";\nexport * from \"./models/IMultiTelemetryConnectorConstructorOptions.js\";\nexport * from \"./models/ITelemetryComponent.js\";\nexport * from \"./models/ITelemetryConnector.js\";\nexport * from \"./models/ITelemetryMetric.js\";\nexport * from \"./models/ITelemetryMetricValue.js\";\nexport * from \"./models/ITelemetryMetricValueEntry.js\";\nexport * from \"./models/metricCounterOperation.js\";\nexport * from \"./models/metricType.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IMetricsCollectorComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMetricsCollectorComponent.js","sourceRoot":"","sources":["../../../src/models/IMetricsCollectorComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\n\n/**\n * Contract for a metrics collector component.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IMetricsCollectorComponent extends IComponent {}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IMetricsProducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMetricsProducer.js","sourceRoot":"","sources":["../../../src/models/IMetricsProducer.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\n\n/**\n * Contract for a metrics producer.\n *\n * A producer declares its metrics with `register()` once and pushes current\n * values with `collect()` on every poll cycle. Producers are discovered via\n * `MetricsProducerFactory` and orchestrated by a `MetricsCollectorService`.\n *\n * Producers are factory-only entries - they are not lifecycle components of\n * the engine. The orchestrating service owns the polling timer.\n */\nexport interface IMetricsProducer extends IComponent {\n\t/**\n\t * Register every metric this producer emits with the telemetry component.\n\t * Called once when the orchestrating service starts.\n\t * @returns A promise that resolves when all metrics have been registered.\n\t */\n\tregister(): Promise<void>;\n\n\t/**\n\t * Read the current values for every metric this producer emits.\n\t * Called on every poll cycle. The values are returned rather than recorded, so the\n\t * orchestrating service can record a whole cycle in one operation.\n\t * @returns The current values for this producer's metrics.\n\t */\n\tcollect(): Promise<ITelemetryMetricValueEntry[]>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IMultiTelemetryConnectorConstructorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMultiTelemetryConnectorConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IMultiTelemetryConnectorConstructorOptions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The options for the multi telemetry connector constructor.\n */\nexport interface IMultiTelemetryConnectorConstructorOptions {\n\t/**\n\t * The telemetry connector types to multiplex.\n\t */\n\ttelemetryConnectorTypes: string[];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryComponent.js","sourceRoot":"","sources":["../../../src/models/ITelemetryComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry component contract.\n */\nexport interface ITelemetryComponent extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryConnector.js","sourceRoot":"","sources":["../../../src/models/ITelemetryConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry connector.\n */\nexport interface ITelemetryConnector extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric?(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue?(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Update metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the update operation.\n\t * @param customData The custom data for the update operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery?(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues?(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryMetric.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryMetric.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetric.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry metric.\n */\nexport interface ITelemetryMetric {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the metric.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The type of the metric.\n\t */\n\ttype: MetricType;\n\n\t/**\n\t * Description.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The unit the metric describes.\n\t */\n\tunit?: string;\n\n\t/**\n\t * The maximum number of values to retain; oldest are trimmed on each addMetricValue call.\n\t * Unlimited when absent.\n\t */\n\tmaxHistory?: number;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryMetricValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryMetricValue.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetricValue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing a telemetry metric value.\n */\nexport interface ITelemetryMetricValue {\n\t/**\n\t * The id of the metric value.\n\t */\n\tid: string;\n\n\t/**\n\t * The timestamp of the metric.\n\t */\n\tts: number;\n\n\t/**\n\t * The value of the metric.\n\t */\n\tvalue: number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryMetricValueEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryMetricValueEntry.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetricValueEntry.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\n\n/**\n * A single metric value in a batch add operation.\n */\nexport interface ITelemetryMetricValueEntry {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The value for the add operation.\n\t */\n\tvalue: MetricCounterOperation | number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryAddMetricValueRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryAddMetricValueRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryAddMetricValueRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"../metricCounterOperation.js\";\n\n/**\n * Add a telemetry metric value.\n */\nexport interface ITelemetryAddMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The value for the update operation.\n\t\t */\n\t\tvalue: MetricCounterOperation | number;\n\n\t\t/**\n\t\t * The custom data for the update operation.\n\t\t */\n\t\tcustomData?: { [key: string]: unknown };\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryCreateMetricRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryCreateMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryCreateMetricRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Create one or more telemetry metrics.\n */\nexport interface ITelemetryCreateMetricRequest {\n\t/**\n\t * The data to be used in the create. A single metric fails if it already exists; an array\n\t * declares the set that should exist, creating the ones that are missing.\n\t */\n\tbody: ITelemetryMetric | ITelemetryMetric[];\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryGetMetricRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryGetMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric.\n */\nexport interface ITelemetryGetMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryGetMetricResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryGetMetricResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric response.\n */\nexport interface ITelemetryGetMetricResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metric.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The latest metric value.\n\t\t */\n\t\tvalue?: ITelemetryMetricValue;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryGetMetricValueRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryGetMetricValueRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricValueRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric value.\n */\nexport interface ITelemetryGetMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\n\t\t/**\n\t\t * The id of the metric value.\n\t\t */\n\t\tvalueId: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryGetMetricValueResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryGetMetricValueResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricValueResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric value response.\n */\nexport interface ITelemetryGetMetricValueResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: ITelemetryMetricValue;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryListRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryListRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry metrics.\n */\nexport interface ITelemetryListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The type of the metric.\n\t\t */\n\t\ttype?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryListResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryRemoveMetricRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryRemoveMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryRemoveMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove a telemetry metric and it's values.\n */\nexport interface ITelemetryRemoveMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryUpdateMetricRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryUpdateMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryUpdateMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update a telemetry metric.\n */\nexport interface ITelemetryUpdateMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The label of the metric.\n\t\t */\n\t\tlabel: string;\n\n\t\t/**\n\t\t * The description of the metric.\n\t\t */\n\t\tdescription?: string;\n\n\t\t/**\n\t\t * The unit of the metric.\n\t\t */\n\t\tunit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=ITelemetryValuesListRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryValuesListRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryValuesListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry values.\n */\nexport interface ITelemetryValuesListRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The start time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeStart?: string;\n\n\t\t/**\n\t\t * The end time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeEnd?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITelemetryValuesListResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITelemetryValuesListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryValuesListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryValuesListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The main metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The metric values.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -0,0 +1,17 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The types of metric value operations for increment decrement counter metrics.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const MetricCounterOperation = {
8
+ /**
9
+ * Increment Counter.
10
+ */
11
+ Increment: "inc",
12
+ /**
13
+ * Decrement Counter.
14
+ */
15
+ Decrement: "dec"
16
+ };
17
+ //# sourceMappingURL=metricCounterOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricCounterOperation.js","sourceRoot":"","sources":["../../../src/models/metricCounterOperation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,KAAK;IAEhB;;OAEG;IACH,SAAS,EAAE,KAAK;CACP,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metric value operations for increment decrement counter metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricCounterOperation = {\n\t/**\n\t * Increment Counter.\n\t */\n\tIncrement: \"inc\",\n\n\t/**\n\t * Decrement Counter.\n\t */\n\tDecrement: \"dec\"\n} as const;\n\n/**\n * The types of metric counter operations.\n */\nexport type MetricCounterOperation =\n\t(typeof MetricCounterOperation)[keyof typeof MetricCounterOperation];\n"]}
@@ -0,0 +1,21 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The types of metrics.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const MetricType = {
8
+ /**
9
+ * Counter.
10
+ */
11
+ Counter: 0,
12
+ /**
13
+ * Increment Decrement Counter.
14
+ */
15
+ IncDecCounter: 1,
16
+ /**
17
+ * Gauge.
18
+ */
19
+ Gauge: 2
20
+ };
21
+ //# sourceMappingURL=metricType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricType.js","sourceRoot":"","sources":["../../../src/models/metricType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,aAAa,EAAE,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,CAAC;CACC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricType = {\n\t/**\n\t * Counter.\n\t */\n\tCounter: 0,\n\n\t/**\n\t * Increment Decrement Counter.\n\t */\n\tIncDecCounter: 1,\n\n\t/**\n\t * Gauge.\n\t */\n\tGauge: 2\n} as const;\n\n/**\n * The types of metrics.\n */\nexport type MetricType = (typeof MetricType)[keyof typeof MetricType];\n"]}
@@ -0,0 +1,124 @@
1
+ import type { IMultiTelemetryConnectorConstructorOptions } from "../models/IMultiTelemetryConnectorConstructorOptions.js";
2
+ import type { ITelemetryConnector } from "../models/ITelemetryConnector.js";
3
+ import type { ITelemetryMetric } from "../models/ITelemetryMetric.js";
4
+ import type { ITelemetryMetricValue } from "../models/ITelemetryMetricValue.js";
5
+ import type { ITelemetryMetricValueEntry } from "../models/ITelemetryMetricValueEntry.js";
6
+ import type { MetricCounterOperation } from "../models/metricCounterOperation.js";
7
+ import { MetricType } from "../models/metricType.js";
8
+ /**
9
+ * Class for performing telemetry operations on multiple connectors.
10
+ */
11
+ export declare class MultiTelemetryConnector implements ITelemetryConnector {
12
+ /**
13
+ * The namespace for the class.
14
+ */
15
+ static readonly NAMESPACE: string;
16
+ /**
17
+ * Runtime name for the class.
18
+ */
19
+ static readonly CLASS_NAME: string;
20
+ /**
21
+ * Create a new instance of MultiTelemetryConnector.
22
+ * @param options The options for the connector.
23
+ */
24
+ constructor(options: IMultiTelemetryConnectorConstructorOptions);
25
+ /**
26
+ * Returns the class name of the component.
27
+ * @returns The class name of the component.
28
+ */
29
+ className(): string;
30
+ /**
31
+ * Create one or more metrics.
32
+ * @param metric The metric details, or the details of several metrics.
33
+ * @returns A promise that resolves when the metrics have been created on all connectors.
34
+ */
35
+ createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;
36
+ /**
37
+ * Get the metric details and it's most recent value.
38
+ * @param id The metric id.
39
+ * @returns The metric details and it's most recent value.
40
+ */
41
+ getMetric(id: string): Promise<{
42
+ metric: ITelemetryMetric;
43
+ value?: ITelemetryMetricValue;
44
+ }>;
45
+ /**
46
+ * Get a specific metric value by its id.
47
+ * @param id The id of the metric.
48
+ * @param valueId The id of the metric value.
49
+ * @returns The metric value.
50
+ */
51
+ getMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue>;
52
+ /**
53
+ * Update metric.
54
+ * @param metric The metric details.
55
+ * @returns A promise that resolves when the metric has been updated on all connectors.
56
+ */
57
+ updateMetric(metric: Omit<ITelemetryMetric, "type">): Promise<void>;
58
+ /**
59
+ * Add a metric value.
60
+ * @param id The id of the metric.
61
+ * @param value The value for the add operation.
62
+ * @param customData The custom data for the add operation.
63
+ * @returns The created metric value id.
64
+ */
65
+ addMetricValue(id: string, value: MetricCounterOperation | number, customData?: {
66
+ [key: string]: unknown;
67
+ }): Promise<string>;
68
+ /**
69
+ * Add multiple metric values.
70
+ * @param values The metric values to add.
71
+ * @returns The created metric value ids, in the order the values were supplied.
72
+ */
73
+ addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;
74
+ /**
75
+ * Remove metric.
76
+ * @param id The id of the metric.
77
+ * @returns A promise that resolves when the metric has been removed from all connectors.
78
+ */
79
+ removeMetric(id: string): Promise<void>;
80
+ /**
81
+ * Query the metrics.
82
+ * @param type The type of the metric.
83
+ * @param cursor The cursor to request the next chunk of entities.
84
+ * @param limit Limit the number of entities to return.
85
+ * @returns All the entities for the storage matching the conditions,
86
+ * and a cursor which can be used to request more entities.
87
+ * @throws NotImplementedError if the implementation does not support retrieval.
88
+ */
89
+ query(type?: MetricType, cursor?: string, limit?: number): Promise<{
90
+ /**
91
+ * The metrics.
92
+ */
93
+ entities: ITelemetryMetric[];
94
+ /**
95
+ * An optional cursor, when defined can be used to call find to get more values.
96
+ */
97
+ cursor?: string;
98
+ }>;
99
+ /**
100
+ * Query the metric values.
101
+ * @param id The id of the metric.
102
+ * @param timeStart The inclusive time as the start of the metric entries.
103
+ * @param timeEnd The inclusive time as the end of the metric entries.
104
+ * @param cursor The cursor to request the next chunk of entities.
105
+ * @param limit Limit the number of entities to return.
106
+ * @returns All the entities for the storage matching the conditions,
107
+ * and a cursor which can be used to request more entities.
108
+ * @throws NotImplementedError if the implementation does not support retrieval.
109
+ */
110
+ queryValues(id: string, timeStart?: number, timeEnd?: number, cursor?: string, limit?: number): Promise<{
111
+ /**
112
+ * The metric details.
113
+ */
114
+ metric: ITelemetryMetric;
115
+ /**
116
+ * The values for the metric.
117
+ */
118
+ entities: ITelemetryMetricValue[];
119
+ /**
120
+ * An optional cursor, when defined can be used to call find to get more values.
121
+ */
122
+ cursor?: string;
123
+ }>;
124
+ }