@oneuptime/common 14.0.5 → 14.0.7

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 (192) hide show
  1. package/Models/DatabaseModels/InventoryItem.ts +23 -12
  2. package/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.ts +217 -0
  3. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
  4. package/Server/Services/AlertService.ts +32 -36
  5. package/Server/Services/IncidentAlertService.ts +609 -2
  6. package/Server/Services/IncidentService.ts +134 -44
  7. package/Server/Services/InventoryItemService.ts +38 -0
  8. package/Server/Services/IoTDeviceCredentialService.ts +13 -4
  9. package/Server/Services/MetricService.ts +1 -1
  10. package/Server/Services/ScheduledMaintenanceService.ts +50 -46
  11. package/Server/Services/UserNotificationRuleService.ts +55 -53
  12. package/Server/Services/WorkspaceNotificationSummaryService.ts +38 -20
  13. package/Server/Types/Database/QueryHelper.ts +54 -1
  14. package/Server/Utils/AI/Toolbox/MetricTools.ts +13 -2
  15. package/Server/Utils/AI/Toolbox/ResourceTools.ts +12 -1
  16. package/Server/Utils/AffectedResources/LinkedAffectedResources.ts +576 -0
  17. package/Server/Utils/Alert/AlertStateChangeAuthorization.ts +129 -0
  18. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +1 -1
  19. package/Server/Utils/Inventory/InventoryOverviewAggregation.ts +111 -0
  20. package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +33 -0
  21. package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +4 -3
  22. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +3 -1
  23. package/Server/Utils/Response.ts +31 -0
  24. package/Server/Utils/Topology/TopologyConcurrencyLimiter.ts +229 -0
  25. package/Server/Utils/Topology/TopologyQueries.ts +1350 -0
  26. package/Server/Utils/Topology/TopologyRequest.ts +463 -0
  27. package/Server/Utils/Topology/TopologyResponseCache.ts +183 -0
  28. package/Server/Utils/Topology/TopologySql.ts +1024 -0
  29. package/Tests/App/Dashboard/AcknowledgeAlertsOnDeclare.test.ts +369 -0
  30. package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +1 -1
  31. package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +510 -123
  32. package/Tests/App/Dashboard/AlertsTableAffectedResources.test.tsx +490 -0
  33. package/Tests/App/Dashboard/ChangeAlertStateDeclareIncident.test.tsx +886 -0
  34. package/Tests/App/Dashboard/CreateReviewStepRoleSummary.test.tsx +1250 -0
  35. package/Tests/App/Dashboard/CreateReviewStepSelectionSummary.test.tsx +738 -0
  36. package/Tests/App/Dashboard/DeclareIncidentFromAlert.test.ts +417 -0
  37. package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +1948 -229
  38. package/Tests/App/Dashboard/EntityDetailPanelLifecycle.test.tsx +493 -0
  39. package/Tests/App/Dashboard/EntityDetailPanelNavigation.test.tsx +439 -0
  40. package/Tests/App/Dashboard/EventOverviewPages.test.tsx +292 -1
  41. package/Tests/App/Dashboard/EventStatusPanel.test.tsx +798 -2
  42. package/Tests/App/Dashboard/FetchStateAndSeverityElements.test.tsx +669 -0
  43. package/Tests/App/Dashboard/FetchUsers.test.tsx +230 -0
  44. package/Tests/App/Dashboard/IncidentCreateAcknowledgeAlerts.test.tsx +1611 -0
  45. package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +1365 -57
  46. package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +964 -23
  47. package/Tests/App/Dashboard/InventoryRelationships.test.tsx +885 -0
  48. package/Tests/App/Dashboard/NetworkTopologyExplorerSearch.test.tsx +1267 -0
  49. package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +4 -1
  50. package/Tests/App/Dashboard/RumOverviewPage.test.tsx +127 -0
  51. package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +201 -15
  52. package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +508 -36
  53. package/Tests/App/Dashboard/SiteSearchBox.test.tsx +2110 -0
  54. package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +168 -8
  55. package/Tests/App/Dashboard/TopologyDataLifecycle.test.tsx +583 -0
  56. package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +982 -218
  57. package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +818 -114
  58. package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +90 -21
  59. package/Tests/Server/Services/DomainService.test.ts +525 -0
  60. package/Tests/Server/Services/IncidentAlertAcknowledgeOnDeclare.test.ts +2630 -0
  61. package/Tests/Server/Services/IncidentAlertPostgres.test.ts +1625 -1
  62. package/Tests/Server/Services/IncidentDeclareAcknowledgeAlerts.test.ts +2189 -0
  63. package/Tests/Server/Services/InventoryItemServiceOverviewCounts.test.ts +345 -0
  64. package/Tests/Server/Services/InventoryOverviewPostgres.test.ts +254 -0
  65. package/Tests/Server/Services/IoTDeviceCredentialService.test.ts +819 -0
  66. package/Tests/Server/Services/LinkedAffectedResourcesCreatedFeed.test.ts +420 -0
  67. package/Tests/Server/Services/MetricServiceAggregate.test.ts +12 -0
  68. package/Tests/Server/Services/SavedViewDefaults.test.ts +325 -0
  69. package/Tests/Server/Services/SloAffectedResourceCreatedFeed.test.ts +92 -36
  70. package/Tests/Server/Services/StatusPageCertificateService.test.ts +169 -0
  71. package/Tests/Server/Services/TeamComplianceSettingService.test.ts +191 -0
  72. package/Tests/Server/Types/Database/QueryHelperSearchAllWords.test.ts +651 -0
  73. package/Tests/Server/Utils/AI/AlertWriteTools.test.ts +256 -0
  74. package/Tests/Server/Utils/AI/IncidentWriteTools.test.ts +482 -0
  75. package/Tests/Server/Utils/AffectedResources/LinkedAffectedResources.test.ts +858 -0
  76. package/Tests/Server/Utils/Alert/AlertStateChangeAuthorization.test.ts +1172 -0
  77. package/Tests/Server/Utils/Monitor/Criteria/CompareCriteria.test.ts +54 -0
  78. package/Tests/Server/Utils/Monitor/MetricDecimalThreshold.test.ts +417 -0
  79. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +96 -0
  80. package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigration.test.ts +386 -0
  81. package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigrationPostgres.test.ts +430 -0
  82. package/Tests/Server/Utils/Topology/TopologyActivityParityPostgres.test.ts +279 -0
  83. package/Tests/Server/Utils/Topology/TopologyConcurrencyLimiter.test.ts +534 -0
  84. package/Tests/Server/Utils/Topology/TopologyEstateGenerator.ts +624 -0
  85. package/Tests/Server/Utils/Topology/TopologyJsonResponse.test.ts +90 -0
  86. package/Tests/Server/Utils/Topology/TopologyQueries.test.ts +1634 -0
  87. package/Tests/Server/Utils/Topology/TopologyQueriesDifferentialPostgres.test.ts +683 -0
  88. package/Tests/Server/Utils/Topology/TopologyQueriesPostgres.test.ts +2624 -0
  89. package/Tests/Server/Utils/Topology/TopologyReference.ts +1018 -0
  90. package/Tests/Server/Utils/Topology/TopologyRequest.test.ts +643 -0
  91. package/Tests/Server/Utils/Topology/TopologyResponseCache.test.ts +305 -0
  92. package/Tests/Server/Utils/Topology/TopologySql.test.ts +973 -0
  93. package/Tests/Types/BaseDatabase/AggregationType.test.ts +5 -1
  94. package/Tests/Types/Dashboard/KubernetesDashboardTemplate.test.ts +184 -0
  95. package/Tests/Types/Dashboard/KubernetesDashboardTemplates.test.ts +107 -0
  96. package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +8 -14
  97. package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +4 -3
  98. package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +27 -6
  99. package/Tests/Types/Topology/TopologyTypeRules.test.ts +176 -0
  100. package/Tests/UI/Rum/ChunkLoader.test.ts +76 -0
  101. package/Tests/UI/Rum/ReplayRailDetail.test.tsx +53 -0
  102. package/Tests/UI/Rum/ReplaySignals.test.ts +54 -0
  103. package/Tests/Utils/Dashboard/KubernetesClusterCpuTileRepair.test.ts +370 -0
  104. package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +302 -0
  105. package/Tests/Utils/Rules/MonitorTypeRuleCriteria.test.ts +181 -0
  106. package/Types/BaseDatabase/AggregationType.ts +7 -0
  107. package/Types/Dashboard/DashboardTemplates.ts +20 -7
  108. package/Types/Incident/IncidentAlertLink.ts +19 -0
  109. package/Types/Rum/SessionReplayCustomEvents.ts +29 -3
  110. package/Types/Rum/WebVitals.ts +13 -0
  111. package/Types/Telemetry/InventoryLiveness.ts +26 -0
  112. package/Types/Topology/TopologyApi.ts +428 -0
  113. package/Types/Topology/TopologyTypeRules.ts +191 -0
  114. package/UI/Components/Input/Input.tsx +11 -0
  115. package/Utils/Dashboard/KubernetesClusterCpuTileRepair.ts +147 -0
  116. package/Utils/Incident/IncidentFromAlerts.ts +78 -0
  117. package/build/dist/Models/DatabaseModels/InventoryItem.js +20 -11
  118. package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -1
  119. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js +165 -0
  120. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js.map +1 -0
  121. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
  122. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  123. package/build/dist/Server/Services/AlertService.js +21 -33
  124. package/build/dist/Server/Services/AlertService.js.map +1 -1
  125. package/build/dist/Server/Services/IncidentAlertService.js +457 -3
  126. package/build/dist/Server/Services/IncidentAlertService.js.map +1 -1
  127. package/build/dist/Server/Services/IncidentService.js +96 -42
  128. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  129. package/build/dist/Server/Services/InventoryItemService.js +31 -0
  130. package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
  131. package/build/dist/Server/Services/IoTDeviceCredentialService.js +12 -5
  132. package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -1
  133. package/build/dist/Server/Services/MetricService.js +1 -1
  134. package/build/dist/Server/Services/ScheduledMaintenanceService.js +37 -40
  135. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  136. package/build/dist/Server/Services/UserNotificationRuleService.js +55 -51
  137. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  138. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +42 -25
  139. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  140. package/build/dist/Server/Types/Database/QueryHelper.js +47 -1
  141. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  142. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +13 -2
  143. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
  144. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +12 -1
  145. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
  146. package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js +405 -0
  147. package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js.map +1 -0
  148. package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js +112 -0
  149. package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js.map +1 -0
  150. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +1 -1
  151. package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js +81 -0
  152. package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js.map +1 -0
  153. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +31 -0
  154. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
  155. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +1 -1
  156. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
  157. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
  158. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  159. package/build/dist/Server/Utils/Response.js +30 -0
  160. package/build/dist/Server/Utils/Response.js.map +1 -1
  161. package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js +178 -0
  162. package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js.map +1 -0
  163. package/build/dist/Server/Utils/Topology/TopologyQueries.js +884 -0
  164. package/build/dist/Server/Utils/Topology/TopologyQueries.js.map +1 -0
  165. package/build/dist/Server/Utils/Topology/TopologyRequest.js +275 -0
  166. package/build/dist/Server/Utils/Topology/TopologyRequest.js.map +1 -0
  167. package/build/dist/Server/Utils/Topology/TopologyResponseCache.js +146 -0
  168. package/build/dist/Server/Utils/Topology/TopologyResponseCache.js.map +1 -0
  169. package/build/dist/Server/Utils/Topology/TopologySql.js +688 -0
  170. package/build/dist/Server/Utils/Topology/TopologySql.js.map +1 -0
  171. package/build/dist/Types/BaseDatabase/AggregationType.js +7 -0
  172. package/build/dist/Types/BaseDatabase/AggregationType.js.map +1 -1
  173. package/build/dist/Types/Dashboard/DashboardTemplates.js +20 -7
  174. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  175. package/build/dist/Types/Incident/IncidentAlertLink.js +17 -0
  176. package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -1
  177. package/build/dist/Types/Rum/SessionReplayCustomEvents.js.map +1 -1
  178. package/build/dist/Types/Rum/WebVitals.js +12 -0
  179. package/build/dist/Types/Rum/WebVitals.js.map +1 -1
  180. package/build/dist/Types/Telemetry/InventoryLiveness.js +23 -0
  181. package/build/dist/Types/Telemetry/InventoryLiveness.js.map +1 -1
  182. package/build/dist/Types/Topology/TopologyApi.js +55 -0
  183. package/build/dist/Types/Topology/TopologyApi.js.map +1 -0
  184. package/build/dist/Types/Topology/TopologyTypeRules.js +165 -0
  185. package/build/dist/Types/Topology/TopologyTypeRules.js.map +1 -0
  186. package/build/dist/UI/Components/Input/Input.js +1 -1
  187. package/build/dist/UI/Components/Input/Input.js.map +1 -1
  188. package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js +110 -0
  189. package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js.map +1 -0
  190. package/build/dist/Utils/Incident/IncidentFromAlerts.js +38 -0
  191. package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -1
  192. package/package.json +1 -1
@@ -18,6 +18,8 @@ import IncidentStateTimeline from "../../Models/DatabaseModels/IncidentStateTime
18
18
  import AlertStateTimeline from "../../Models/DatabaseModels/AlertStateTimeline";
19
19
  import Label from "../../Models/DatabaseModels/Label";
20
20
  import Monitor from "../../Models/DatabaseModels/Monitor";
21
+ import LinkedAffectedResources from "../Utils/AffectedResources/LinkedAffectedResources";
22
+ import { escapeMarkdownInline } from "../../Utils/Markdown/MarkdownEscape";
21
23
  import WorkspaceNotificationLogService from "./WorkspaceNotificationLogService";
22
24
  import WorkspaceNotificationStatus from "../../Types/Workspace/WorkspaceNotificationStatus";
23
25
  import WorkspaceNotificationActionType from "../../Types/Workspace/WorkspaceNotificationActionType";
@@ -212,6 +214,18 @@ export class Service extends DatabaseService<WorkspaceNotificationSummary> {
212
214
  return `[${text}](${url})`;
213
215
  }
214
216
 
217
+ /*
218
+ * Resource names are escaped: a host or cluster name can come from an
219
+ * agent rather than from someone typing it, and this text is markdown.
220
+ */
221
+ private static joinNames(names: Array<string>): string {
222
+ return names
223
+ .map((name: string): string => {
224
+ return escapeMarkdownInline(name);
225
+ })
226
+ .join(", ");
227
+ }
228
+
215
229
  private static formatDuration(totalMinutes: number): string {
216
230
  if (totalMinutes < 1) {
217
231
  return "< 1m";
@@ -761,20 +775,20 @@ export class Service extends DatabaseService<WorkspaceNotificationSummary> {
761
775
  if (
762
776
  Service.has(items, WorkspaceNotificationSummaryItem.ResourcesAffected)
763
777
  ) {
764
- const names: Set<string> = new Set();
765
- for (const inc of incidents) {
766
- if (inc.monitors) {
767
- for (const m of inc.monitors) {
768
- if (m.name) {
769
- names.add(m.name);
770
- }
771
- }
772
- }
773
- }
774
- if (names.size > 0) {
778
+ // Every resource the period's incidents are linked to, not only monitors.
779
+ const names: Array<string> = LinkedAffectedResources.getNames({
780
+ resources: await LinkedAffectedResources.readForIncidents({
781
+ service: IncidentService,
782
+ projectId,
783
+ incidentIds: incidents.map((inc: Incident): ObjectID => {
784
+ return inc.id!;
785
+ }),
786
+ }),
787
+ });
788
+ if (names.length > 0) {
775
789
  blocks.push(
776
790
  Service.md(
777
- `${Service.bold(`Resources Affected (${names.size}):`)} ${Array.from(names).join(", ")}`,
791
+ `${Service.bold(`Resources Affected (${names.length}):`)} ${Service.joinNames(names)}`,
778
792
  ),
779
793
  );
780
794
  }
@@ -1203,16 +1217,20 @@ export class Service extends DatabaseService<WorkspaceNotificationSummary> {
1203
1217
  if (
1204
1218
  Service.has(items, WorkspaceNotificationSummaryItem.ResourcesAffected)
1205
1219
  ) {
1206
- const names: Set<string> = new Set();
1207
- for (const a of alerts) {
1208
- if (a.monitor?.name) {
1209
- names.add(a.monitor.name);
1210
- }
1211
- }
1212
- if (names.size > 0) {
1220
+ // Every resource the period's alerts are linked to, not only monitors.
1221
+ const names: Array<string> = LinkedAffectedResources.getNames({
1222
+ resources: await LinkedAffectedResources.readForAlerts({
1223
+ service: AlertService,
1224
+ projectId,
1225
+ alertIds: alerts.map((a: Alert): ObjectID => {
1226
+ return a.id!;
1227
+ }),
1228
+ }),
1229
+ });
1230
+ if (names.length > 0) {
1213
1231
  blocks.push(
1214
1232
  Service.md(
1215
- `${Service.bold(`Resources Affected (${names.size}):`)} ${Array.from(names).join(", ")}`,
1233
+ `${Service.bold(`Resources Affected (${names.length}):`)} ${Service.joinNames(names)}`,
1216
1234
  ),
1217
1235
  );
1218
1236
  }
@@ -9,7 +9,10 @@ import { FindOperator, Raw } from "typeorm";
9
9
  import { FindWhereProperty } from "../../../Types/BaseDatabase/Query";
10
10
  import { toLikePattern } from "../../../Types/BaseDatabase/WildcardPattern";
11
11
  import CaptureSpan from "../../Utils/Telemetry/CaptureSpan";
12
- import buildJSONColumnQuery, { JSONColumnQuery } from "./JSONColumnQuery";
12
+ import buildJSONColumnQuery, {
13
+ JSONColumnQuery,
14
+ escapeLikePattern,
15
+ } from "./JSONColumnQuery";
13
16
 
14
17
  export type { FindOperator };
15
18
 
@@ -229,6 +232,56 @@ export default class QueryHelper {
229
232
  );
230
233
  }
231
234
 
235
+ /*
236
+ * Every word has to appear somewhere in the column, in any order.
237
+ *
238
+ * `search` is one substring, so "michigan 104822" misses a row called
239
+ * "Unit 104822 - Michigan Ave" even though both words are in it. Here each
240
+ * word gets its own ILIKE, AND-joined, which is how people recall a name
241
+ * they half remember.
242
+ *
243
+ * A word is matched literally: a `%` or `_` somebody typed is escaped
244
+ * rather than read as a wildcard.
245
+ *
246
+ * No words matches NOTHING. An AND over zero predicates is vacuously true,
247
+ * and "every row in the table" is never what an empty search box meant.
248
+ */
249
+ @CaptureSpan()
250
+ public static searchAllWords(words: Array<string>): FindWhereProperty<any> {
251
+ const rids: Array<string> = [];
252
+ const valuesObj: Dictionary<string> = {};
253
+
254
+ for (const word of words) {
255
+ const trimmed: string = (word || "").trim();
256
+ if (!trimmed) {
257
+ continue;
258
+ }
259
+ const rid: string = Text.generateRandomText(10);
260
+ rids.push(rid);
261
+ valuesObj[rid] = `%${escapeLikePattern(trimmed)}%`;
262
+ }
263
+
264
+ if (rids.length === 0) {
265
+ return Raw(() => {
266
+ return `TRUE = FALSE`; // this will always return false
267
+ }, {});
268
+ }
269
+
270
+ return Raw(
271
+ (alias: string) => {
272
+ const conditions: string = rids
273
+ .map((rid: string) => {
274
+ return `CAST(${alias} AS TEXT) ILIKE :${rid}`;
275
+ })
276
+ .join(" AND ");
277
+ return `(${conditions})`;
278
+ },
279
+ {
280
+ ...valuesObj,
281
+ },
282
+ );
283
+ }
284
+
232
285
  /**
233
286
  * Searches the provided entity property names with a single OR-joined ILIKE.
234
287
  *
@@ -49,7 +49,7 @@ const METRIC_READ_PERMISSIONS: Array<Permission> = [
49
49
  export const QueryMetricsTool: ObservabilityTool = {
50
50
  name: "query_metrics",
51
51
  description:
52
- "Aggregate a metric over time: Avg, Max, Min, Sum, Count or P50/P90/P95/P99 percentiles (histogram-aware). Requires the exact metric name — discover names via lookup_context. Monitor metrics use reserved names like oneuptime.monitor.response.time with the monitor's ID as entityId.",
52
+ "Aggregate a metric over time: Avg, Max, Min, Sum, Count or P50/P75/P90/P95/P99 percentiles (histogram-aware). Requires the exact metric name — discover names via lookup_context. Monitor metrics use reserved names like oneuptime.monitor.response.time with the monitor's ID as entityId.",
53
53
  inputSchema: {
54
54
  type: "object",
55
55
  properties: {
@@ -60,7 +60,18 @@ export const QueryMetricsTool: ObservabilityTool = {
60
60
  },
61
61
  aggregationType: {
62
62
  type: "string",
63
- enum: ["Avg", "Max", "Min", "Sum", "Count", "P50", "P90", "P95", "P99"],
63
+ enum: [
64
+ "Avg",
65
+ "Max",
66
+ "Min",
67
+ "Sum",
68
+ "Count",
69
+ "P50",
70
+ "P75",
71
+ "P90",
72
+ "P95",
73
+ "P99",
74
+ ],
64
75
  description: "How to aggregate (default Avg).",
65
76
  },
66
77
  entityId: {
@@ -673,7 +673,18 @@ export const QueryResourceTelemetryTool: ObservabilityTool = {
673
673
  },
674
674
  aggregationType: {
675
675
  type: "string",
676
- enum: ["Avg", "Min", "Max", "Sum", "Count", "P50", "P90", "P95", "P99"],
676
+ enum: [
677
+ "Avg",
678
+ "Min",
679
+ "Max",
680
+ "Sum",
681
+ "Count",
682
+ "P50",
683
+ "P75",
684
+ "P90",
685
+ "P95",
686
+ "P99",
687
+ ],
677
688
  description:
678
689
  "Metric aggregation (defaultAvg); counter sums are exported values, not derived rates.",
679
690
  },