@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.
- package/Models/DatabaseModels/InventoryItem.ts +23 -12
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.ts +217 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/AlertService.ts +32 -36
- package/Server/Services/IncidentAlertService.ts +609 -2
- package/Server/Services/IncidentService.ts +134 -44
- package/Server/Services/InventoryItemService.ts +38 -0
- package/Server/Services/IoTDeviceCredentialService.ts +13 -4
- package/Server/Services/MetricService.ts +1 -1
- package/Server/Services/ScheduledMaintenanceService.ts +50 -46
- package/Server/Services/UserNotificationRuleService.ts +55 -53
- package/Server/Services/WorkspaceNotificationSummaryService.ts +38 -20
- package/Server/Types/Database/QueryHelper.ts +54 -1
- package/Server/Utils/AI/Toolbox/MetricTools.ts +13 -2
- package/Server/Utils/AI/Toolbox/ResourceTools.ts +12 -1
- package/Server/Utils/AffectedResources/LinkedAffectedResources.ts +576 -0
- package/Server/Utils/Alert/AlertStateChangeAuthorization.ts +129 -0
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +1 -1
- package/Server/Utils/Inventory/InventoryOverviewAggregation.ts +111 -0
- package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +33 -0
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +4 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +3 -1
- package/Server/Utils/Response.ts +31 -0
- package/Server/Utils/Topology/TopologyConcurrencyLimiter.ts +229 -0
- package/Server/Utils/Topology/TopologyQueries.ts +1350 -0
- package/Server/Utils/Topology/TopologyRequest.ts +463 -0
- package/Server/Utils/Topology/TopologyResponseCache.ts +183 -0
- package/Server/Utils/Topology/TopologySql.ts +1024 -0
- package/Tests/App/Dashboard/AcknowledgeAlertsOnDeclare.test.ts +369 -0
- package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +1 -1
- package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +510 -123
- package/Tests/App/Dashboard/AlertsTableAffectedResources.test.tsx +490 -0
- package/Tests/App/Dashboard/ChangeAlertStateDeclareIncident.test.tsx +886 -0
- package/Tests/App/Dashboard/CreateReviewStepRoleSummary.test.tsx +1250 -0
- package/Tests/App/Dashboard/CreateReviewStepSelectionSummary.test.tsx +738 -0
- package/Tests/App/Dashboard/DeclareIncidentFromAlert.test.ts +417 -0
- package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +1948 -229
- package/Tests/App/Dashboard/EntityDetailPanelLifecycle.test.tsx +493 -0
- package/Tests/App/Dashboard/EntityDetailPanelNavigation.test.tsx +439 -0
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +292 -1
- package/Tests/App/Dashboard/EventStatusPanel.test.tsx +798 -2
- package/Tests/App/Dashboard/FetchStateAndSeverityElements.test.tsx +669 -0
- package/Tests/App/Dashboard/FetchUsers.test.tsx +230 -0
- package/Tests/App/Dashboard/IncidentCreateAcknowledgeAlerts.test.tsx +1611 -0
- package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +1365 -57
- package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +964 -23
- package/Tests/App/Dashboard/InventoryRelationships.test.tsx +885 -0
- package/Tests/App/Dashboard/NetworkTopologyExplorerSearch.test.tsx +1267 -0
- package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +4 -1
- package/Tests/App/Dashboard/RumOverviewPage.test.tsx +127 -0
- package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +201 -15
- package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +508 -36
- package/Tests/App/Dashboard/SiteSearchBox.test.tsx +2110 -0
- package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +168 -8
- package/Tests/App/Dashboard/TopologyDataLifecycle.test.tsx +583 -0
- package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +982 -218
- package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +818 -114
- package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +90 -21
- package/Tests/Server/Services/DomainService.test.ts +525 -0
- package/Tests/Server/Services/IncidentAlertAcknowledgeOnDeclare.test.ts +2630 -0
- package/Tests/Server/Services/IncidentAlertPostgres.test.ts +1625 -1
- package/Tests/Server/Services/IncidentDeclareAcknowledgeAlerts.test.ts +2189 -0
- package/Tests/Server/Services/InventoryItemServiceOverviewCounts.test.ts +345 -0
- package/Tests/Server/Services/InventoryOverviewPostgres.test.ts +254 -0
- package/Tests/Server/Services/IoTDeviceCredentialService.test.ts +819 -0
- package/Tests/Server/Services/LinkedAffectedResourcesCreatedFeed.test.ts +420 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +12 -0
- package/Tests/Server/Services/SavedViewDefaults.test.ts +325 -0
- package/Tests/Server/Services/SloAffectedResourceCreatedFeed.test.ts +92 -36
- package/Tests/Server/Services/StatusPageCertificateService.test.ts +169 -0
- package/Tests/Server/Services/TeamComplianceSettingService.test.ts +191 -0
- package/Tests/Server/Types/Database/QueryHelperSearchAllWords.test.ts +651 -0
- package/Tests/Server/Utils/AI/AlertWriteTools.test.ts +256 -0
- package/Tests/Server/Utils/AI/IncidentWriteTools.test.ts +482 -0
- package/Tests/Server/Utils/AffectedResources/LinkedAffectedResources.test.ts +858 -0
- package/Tests/Server/Utils/Alert/AlertStateChangeAuthorization.test.ts +1172 -0
- package/Tests/Server/Utils/Monitor/Criteria/CompareCriteria.test.ts +54 -0
- package/Tests/Server/Utils/Monitor/MetricDecimalThreshold.test.ts +417 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +96 -0
- package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigration.test.ts +386 -0
- package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigrationPostgres.test.ts +430 -0
- package/Tests/Server/Utils/Topology/TopologyActivityParityPostgres.test.ts +279 -0
- package/Tests/Server/Utils/Topology/TopologyConcurrencyLimiter.test.ts +534 -0
- package/Tests/Server/Utils/Topology/TopologyEstateGenerator.ts +624 -0
- package/Tests/Server/Utils/Topology/TopologyJsonResponse.test.ts +90 -0
- package/Tests/Server/Utils/Topology/TopologyQueries.test.ts +1634 -0
- package/Tests/Server/Utils/Topology/TopologyQueriesDifferentialPostgres.test.ts +683 -0
- package/Tests/Server/Utils/Topology/TopologyQueriesPostgres.test.ts +2624 -0
- package/Tests/Server/Utils/Topology/TopologyReference.ts +1018 -0
- package/Tests/Server/Utils/Topology/TopologyRequest.test.ts +643 -0
- package/Tests/Server/Utils/Topology/TopologyResponseCache.test.ts +305 -0
- package/Tests/Server/Utils/Topology/TopologySql.test.ts +973 -0
- package/Tests/Types/BaseDatabase/AggregationType.test.ts +5 -1
- package/Tests/Types/Dashboard/KubernetesDashboardTemplate.test.ts +184 -0
- package/Tests/Types/Dashboard/KubernetesDashboardTemplates.test.ts +107 -0
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +8 -14
- package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +4 -3
- package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +27 -6
- package/Tests/Types/Topology/TopologyTypeRules.test.ts +176 -0
- package/Tests/UI/Rum/ChunkLoader.test.ts +76 -0
- package/Tests/UI/Rum/ReplayRailDetail.test.tsx +53 -0
- package/Tests/UI/Rum/ReplaySignals.test.ts +54 -0
- package/Tests/Utils/Dashboard/KubernetesClusterCpuTileRepair.test.ts +370 -0
- package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +302 -0
- package/Tests/Utils/Rules/MonitorTypeRuleCriteria.test.ts +181 -0
- package/Types/BaseDatabase/AggregationType.ts +7 -0
- package/Types/Dashboard/DashboardTemplates.ts +20 -7
- package/Types/Incident/IncidentAlertLink.ts +19 -0
- package/Types/Rum/SessionReplayCustomEvents.ts +29 -3
- package/Types/Rum/WebVitals.ts +13 -0
- package/Types/Telemetry/InventoryLiveness.ts +26 -0
- package/Types/Topology/TopologyApi.ts +428 -0
- package/Types/Topology/TopologyTypeRules.ts +191 -0
- package/UI/Components/Input/Input.tsx +11 -0
- package/Utils/Dashboard/KubernetesClusterCpuTileRepair.ts +147 -0
- package/Utils/Incident/IncidentFromAlerts.ts +78 -0
- package/build/dist/Models/DatabaseModels/InventoryItem.js +20 -11
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js +165 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +21 -33
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/IncidentAlertService.js +457 -3
- package/build/dist/Server/Services/IncidentAlertService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +96 -42
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +31 -0
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceCredentialService.js +12 -5
- package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +37 -40
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +55 -51
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +42 -25
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +47 -1
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +13 -2
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +12 -1
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
- package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js +405 -0
- package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js.map +1 -0
- package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js +112 -0
- package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js.map +1 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +1 -1
- package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js +81 -0
- package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +31 -0
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Response.js +30 -0
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js +178 -0
- package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js.map +1 -0
- package/build/dist/Server/Utils/Topology/TopologyQueries.js +884 -0
- package/build/dist/Server/Utils/Topology/TopologyQueries.js.map +1 -0
- package/build/dist/Server/Utils/Topology/TopologyRequest.js +275 -0
- package/build/dist/Server/Utils/Topology/TopologyRequest.js.map +1 -0
- package/build/dist/Server/Utils/Topology/TopologyResponseCache.js +146 -0
- package/build/dist/Server/Utils/Topology/TopologyResponseCache.js.map +1 -0
- package/build/dist/Server/Utils/Topology/TopologySql.js +688 -0
- package/build/dist/Server/Utils/Topology/TopologySql.js.map +1 -0
- package/build/dist/Types/BaseDatabase/AggregationType.js +7 -0
- package/build/dist/Types/BaseDatabase/AggregationType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js +20 -7
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/Incident/IncidentAlertLink.js +17 -0
- package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -1
- package/build/dist/Types/Rum/SessionReplayCustomEvents.js.map +1 -1
- package/build/dist/Types/Rum/WebVitals.js +12 -0
- package/build/dist/Types/Rum/WebVitals.js.map +1 -1
- package/build/dist/Types/Telemetry/InventoryLiveness.js +23 -0
- package/build/dist/Types/Telemetry/InventoryLiveness.js.map +1 -1
- package/build/dist/Types/Topology/TopologyApi.js +55 -0
- package/build/dist/Types/Topology/TopologyApi.js.map +1 -0
- package/build/dist/Types/Topology/TopologyTypeRules.js +165 -0
- package/build/dist/Types/Topology/TopologyTypeRules.js.map +1 -0
- package/build/dist/UI/Components/Input/Input.js +1 -1
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js +110 -0
- package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js.map +1 -0
- package/build/dist/Utils/Incident/IncidentFromAlerts.js +38 -0
- package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -1
- 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
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
if (names.
|
|
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.
|
|
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
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
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.
|
|
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, {
|
|
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: [
|
|
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: [
|
|
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
|
},
|