@oneuptime/common 12.0.9 → 12.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/NetworkDevice.ts +44 -0
- package/Models/DatabaseModels/NetworkDeviceLink.ts +116 -0
- package/Models/DatabaseModels/RunnerJob.ts +17 -2
- package/Server/API/LlmProviderAPI.ts +8 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.ts +52 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +240 -0
- package/Server/Services/NetworkDeviceLinkService.ts +338 -2
- package/Server/Services/NetworkDeviceService.ts +265 -12
- package/Server/Services/RunnerJobService.ts +24 -1
- package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +19 -5
- package/Server/Types/Database/JSONColumnQuery.ts +42 -4
- package/Server/Utils/LLM/LLMService.ts +108 -19
- package/Server/Utils/Monitor/MonitorAlert.ts +22 -115
- package/Server/Utils/Monitor/MonitorIncident.ts +7 -337
- package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +27 -2
- package/Server/Utils/Monitor/SeriesResourceLabels.ts +32 -0
- package/Server/Utils/Monitor/SeriesResourceLinker.ts +469 -0
- package/Server/Utils/SSRFProtection.ts +5 -4
- package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +186 -38
- package/Tests/App/AdminDashboard/AdminUsersBulkAddToProject.test.tsx +955 -0
- package/Tests/App/AdminDashboard/BulkAddUsersToProject.test.ts +778 -0
- package/Tests/App/AdminDashboard/BulkAddUsersToProjectModal.test.tsx +1051 -0
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +420 -112
- package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +81 -6
- package/Tests/App/Dashboard/PayAsYouGoConsentGate.test.tsx +543 -0
- package/Tests/App/Dashboard/PayAsYouGoFreePlan.test.ts +125 -0
- package/Tests/App/Dashboard/PayAsYouGoNotices.test.tsx +612 -0
- package/Tests/App/Dashboard/SloWidgetChartRendering.test.tsx +536 -0
- package/Tests/App/Dashboard/UserElementEmail.test.tsx +447 -0
- package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +284 -0
- package/Tests/Models/AnalyticsModels/CommonModel.test.ts +312 -0
- package/Tests/Server/Infrastructure/Postgres/DeviceRoleAndDeclaredLinkParentMigration.test.ts +250 -0
- package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +46 -18
- package/Tests/Server/Services/NetworkDeviceLabelRuleRun.test.ts +618 -0
- package/Tests/Server/Services/NetworkDeviceLinkParentValidation.test.ts +1043 -0
- package/Tests/Server/Services/NetworkSiteAssignmentRuleRun.test.ts +706 -0
- package/Tests/Server/Services/RunnerJobEnqueue.test.ts +412 -0
- package/Tests/Server/Types/Billing/PayAsYouGoMeteredPricing.test.ts +125 -0
- package/Tests/Server/Types/Database/JSONColumnQuery.test.ts +508 -0
- package/Tests/Server/Utils/AI/LLMServiceRequestPolicy.test.ts +2 -2
- package/Tests/Server/Utils/AI/LLMServiceRetryPolicy.test.ts +450 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +556 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +547 -0
- package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +30 -0
- package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +699 -0
- package/Tests/Server/Utils/SeriesResourceLabels.test.ts +55 -0
- package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +668 -0
- package/Tests/Types/API/URLMalformedTolerance.test.ts +301 -0
- package/Tests/Types/API/URLTelScheme.test.ts +261 -0
- package/Tests/Types/API/URLUnsupportedScheme.test.ts +148 -0
- package/Tests/Types/Billing/PayAsYouGoPricing.test.ts +64 -0
- package/Tests/Types/CustomField/CustomFieldTypeCorrespondence.test.ts +107 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +62 -0
- package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +184 -0
- package/Tests/Types/Runbook/RunbookStepType.test.ts +124 -0
- package/Tests/Types/Workflow/BaseModelComponents.test.ts +17 -0
- package/Tests/UI/Components/Button.test.tsx +279 -0
- package/Tests/UI/Components/Charts/ChartXAxisDataKey.test.tsx +256 -0
- package/Tests/UI/Components/Charts/DataPointUtil.test.ts +323 -0
- package/Tests/UI/Components/DictionaryValuePlaceholderAndSuggestions.test.tsx +595 -0
- package/Tests/UI/Components/Icon.test.tsx +57 -0
- package/Tests/UI/Components/List.test.tsx +20 -3
- package/Tests/UI/Components/LogsSavedViewsDropdown.test.tsx +304 -0
- package/Tests/UI/Components/LogsViewerClearSavedView.test.tsx +179 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +349 -1
- package/Tests/UI/Components/Pagination.test.tsx +721 -146
- package/Tests/UI/Components/PaginationIntegration.test.tsx +386 -0
- package/Tests/UI/Components/PaginationUtil.test.ts +417 -0
- package/Tests/UI/Components/TelemetrySavedViewsDropdown.test.tsx +343 -0
- package/Tests/UI/Components/Workflow/ColumnEditor/ColumnControl.test.ts +289 -0
- package/Tests/UI/Components/Workflow/ColumnEditor/ColumnOperators.test.ts +271 -0
- package/Tests/UI/Components/Workflow/ColumnEditor/ColumnRow.test.ts +119 -0
- package/Tests/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.test.ts +968 -0
- package/Tests/UI/Components/Workflow/ModelColumnEditor.render.test.tsx +766 -0
- package/Tests/UI/Utils/RunNetworkRule.test.ts +320 -0
- package/Tests/Utils/APIRetryPolicy.test.ts +823 -0
- package/Tests/Utils/Monitor/NetworkDeviceRoleUtil.test.ts +502 -0
- package/Tests/Utils/Monitor/NetworkTopologyDeclaredHierarchy.test.ts +759 -0
- package/Tests/Utils/NetworkAutomation/RuleRunSummary.test.ts +286 -0
- package/Tests/Utils/Schema/BaseSchema.test.ts +651 -0
- package/Types/API/Protocol.ts +9 -0
- package/Types/API/URL.ts +286 -20
- package/Types/Billing/PayAsYouGoPricing.ts +47 -0
- package/Types/CustomField/CustomFieldType.ts +28 -0
- package/Types/Monitor/MonitorType.ts +11 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +13 -0
- package/Types/NetworkAutomation/RuleRunResult.ts +121 -0
- package/Types/Runbook/RunbookStepType.ts +23 -0
- package/UI/Components/AutocompleteTextInput/AutocompleteTextInput.tsx +7 -0
- package/UI/Components/Button/Button.tsx +14 -22
- package/UI/Components/Charts/Area/AreaChart.tsx +4 -2
- package/UI/Components/Charts/Bar/BarChart.tsx +4 -2
- package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +4 -2
- package/UI/Components/Charts/Types/XAxis/XAxis.ts +6 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +15 -12
- package/UI/Components/Dictionary/Dictionary.tsx +4 -39
- package/UI/Components/Icon/Icon.tsx +1 -1
- package/UI/Components/LogsViewer/LogsViewer.tsx +5 -1
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +8 -0
- package/UI/Components/LogsViewer/components/LogsPagination.tsx +29 -91
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +2 -0
- package/UI/Components/LogsViewer/components/SavedViewsDropdown.tsx +66 -1
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +55 -0
- package/UI/Components/Pagination/Pagination.tsx +373 -328
- package/UI/Components/Pagination/PaginationUtil.ts +263 -0
- package/UI/Components/Pagination/Screenshots/README.md +15 -0
- package/UI/Components/Pagination/Screenshots/pagination-before-after.png +0 -0
- package/UI/Components/Pagination/Screenshots/pagination-go-to-page-modal.png +0 -0
- package/UI/Components/Pagination/Screenshots/pagination-long-list.png +0 -0
- package/UI/Components/Pagination/Screenshots/pagination-mobile.png +0 -0
- package/UI/Components/Pagination/Screenshots/pagination-telemetry.png +0 -0
- package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +66 -1
- package/UI/Components/TelemetryViewer/components/TelemetryPagination.tsx +38 -92
- package/UI/Components/TextArea/TextArea.tsx +3 -0
- package/UI/Components/Workflow/ArgumentsForm.tsx +18 -1
- package/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.tsx +177 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.tsx +243 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnControl.ts +255 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.tsx +178 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnOperators.ts +206 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnRow.ts +157 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.ts +517 -0
- package/UI/Components/Workflow/ColumnEditor/ColumnValueInput.tsx +482 -0
- package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +131 -0
- package/UI/Components/Workflow/ColumnEditor/ModelRecordForm.tsx +163 -0
- package/UI/Components/Workflow/ModelColumnEditor.tsx +284 -100
- package/UI/Utils/NetworkAutomation/RunNetworkRule.ts +122 -0
- package/Utils/API.ts +243 -36
- package/Utils/Monitor/NetworkDeviceRoleUtil.ts +45 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +42 -2
- package/Utils/NetworkAutomation/RuleRunSummary.ts +147 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +45 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +115 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RunnerJob.js +17 -2
- package/build/dist/Models/DatabaseModels/RunnerJob.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +9 -1
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.js +33 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.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/NetworkDeviceLabelRuleEngineService.js +202 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceLinkService.js +253 -1
- package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +223 -12
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/RunnerJobService.js +20 -2
- package/build/dist/Server/Services/RunnerJobService.js.map +1 -1
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +12 -5
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
- package/build/dist/Server/Types/Database/JSONColumnQuery.js +40 -4
- package/build/dist/Server/Types/Database/JSONColumnQuery.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +78 -22
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -98
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +7 -254
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +14 -2
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +27 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +285 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -0
- package/build/dist/Server/Utils/SSRFProtection.js +5 -4
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +128 -35
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
- package/build/dist/Types/API/Protocol.js +9 -0
- package/build/dist/Types/API/Protocol.js.map +1 -1
- package/build/dist/Types/API/URL.js +241 -18
- package/build/dist/Types/API/URL.js.map +1 -1
- package/build/dist/Types/Billing/PayAsYouGoPricing.js +41 -0
- package/build/dist/Types/Billing/PayAsYouGoPricing.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldType.js +26 -0
- package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +10 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js +39 -0
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepType.js +21 -0
- package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
- package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js +1 -1
- package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +10 -16
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +2 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +2 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +12 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js +2 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +17 -10
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js +4 -18
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +1 -1
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +3 -3
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +5 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsPagination.js +14 -44
- package/build/dist/UI/Components/LogsViewer/components/LogsPagination.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js +20 -2
- package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +42 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -1
- package/build/dist/UI/Components/Pagination/Pagination.js +174 -199
- package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
- package/build/dist/UI/Components/Pagination/PaginationUtil.js +160 -0
- package/build/dist/UI/Components/Pagination/PaginationUtil.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +20 -2
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryPagination.js +23 -47
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryPagination.js.map +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js +14 -2
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.js +86 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.js +119 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnControl.js +206 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnControl.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.js +57 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnOperators.js +150 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnOperators.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRow.js +67 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRow.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.js +309 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnValueInput.js +204 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnValueInput.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +66 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelRecordForm.js +83 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelRecordForm.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +187 -68
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -1
- package/build/dist/UI/Utils/NetworkAutomation/RunNetworkRule.js +75 -0
- package/build/dist/UI/Utils/NetworkAutomation/RunNetworkRule.js.map +1 -0
- package/build/dist/Utils/API.js +175 -34
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +37 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +25 -3
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkAutomation/RuleRunSummary.js +78 -0
- package/build/dist/Utils/NetworkAutomation/RuleRunSummary.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import CephCluster from "../../../Models/DatabaseModels/CephCluster";
|
|
2
|
-
import DockerSwarmCluster from "../../../Models/DatabaseModels/DockerSwarmCluster";
|
|
3
|
-
import DockerHost from "../../../Models/DatabaseModels/DockerHost";
|
|
4
|
-
import Host from "../../../Models/DatabaseModels/Host";
|
|
5
1
|
import Incident from "../../../Models/DatabaseModels/Incident";
|
|
6
2
|
import IncidentSeverity from "../../../Models/DatabaseModels/IncidentSeverity";
|
|
7
3
|
import IncidentStateTimeline from "../../../Models/DatabaseModels/IncidentStateTimeline";
|
|
8
4
|
import IncidentMember from "../../../Models/DatabaseModels/IncidentMember";
|
|
9
|
-
import KubernetesCluster from "../../../Models/DatabaseModels/KubernetesCluster";
|
|
10
5
|
import Label from "../../../Models/DatabaseModels/Label";
|
|
11
6
|
import Monitor from "../../../Models/DatabaseModels/Monitor";
|
|
12
7
|
import OnCallDutyPolicy from "../../../Models/DatabaseModels/OnCallDutyPolicy";
|
|
13
|
-
import PodmanHost from "../../../Models/DatabaseModels/PodmanHost";
|
|
14
|
-
import ProxmoxCluster from "../../../Models/DatabaseModels/ProxmoxCluster";
|
|
15
|
-
import IoTFleet from "../../../Models/DatabaseModels/IoTFleet";
|
|
16
|
-
import Service from "../../../Models/DatabaseModels/Service";
|
|
17
|
-
import Includes from "../../../Types/BaseDatabase/Includes";
|
|
18
8
|
import SortOrder from "../../../Types/BaseDatabase/SortOrder";
|
|
19
9
|
import { LIMIT_PER_PROJECT } from "../../../Types/Database/LimitMax";
|
|
20
10
|
import Dictionary from "../../../Types/Dictionary";
|
|
@@ -25,14 +15,7 @@ import ObjectID from "../../../Types/ObjectID";
|
|
|
25
15
|
import ProbeMonitorResponse from "../../../Types/Probe/ProbeMonitorResponse";
|
|
26
16
|
import { TelemetryQuery } from "../../../Types/Telemetry/TelemetryQuery";
|
|
27
17
|
import { DisableAutomaticIncidentCreation } from "../../EnvironmentConfig";
|
|
28
|
-
import CephClusterService from "../../Services/CephClusterService";
|
|
29
|
-
import DockerHostService from "../../Services/DockerHostService";
|
|
30
|
-
import HostService from "../../Services/HostService";
|
|
31
18
|
import IncidentService from "../../Services/IncidentService";
|
|
32
|
-
import KubernetesClusterService from "../../Services/KubernetesClusterService";
|
|
33
|
-
import PodmanHostService from "../../Services/PodmanHostService";
|
|
34
|
-
import ProxmoxClusterService from "../../Services/ProxmoxClusterService";
|
|
35
|
-
import ServiceService from "../../Services/ServiceService";
|
|
36
19
|
import IncidentSeverityService from "../../Services/IncidentSeverityService";
|
|
37
20
|
import ProjectScopedReferenceValidator from "../Database/ProjectScopedReferenceValidator";
|
|
38
21
|
import IncidentStateTimelineService from "../../Services/IncidentStateTimelineService";
|
|
@@ -57,9 +40,7 @@ import { PerSeriesCriteriaMatch } from "../../../Types/Probe/ProbeApiIngestRespo
|
|
|
57
40
|
import MonitorClusterContextUtil, {
|
|
58
41
|
MonitorClusterContext,
|
|
59
42
|
} from "./MonitorClusterContext";
|
|
60
|
-
import
|
|
61
|
-
SeriesResourceRefs,
|
|
62
|
-
} from "./SeriesResourceLabels";
|
|
43
|
+
import SeriesResourceLinker from "./SeriesResourceLinker";
|
|
63
44
|
|
|
64
45
|
export default class MonitorIncident {
|
|
65
46
|
@CaptureSpan()
|
|
@@ -671,8 +652,8 @@ export default class MonitorIncident {
|
|
|
671
652
|
if (seriesLabels && Object.keys(seriesLabels).length > 0) {
|
|
672
653
|
incident.seriesLabels = seriesLabels;
|
|
673
654
|
|
|
674
|
-
await
|
|
675
|
-
incident,
|
|
655
|
+
await SeriesResourceLinker.linkSeriesResourcesToModel({
|
|
656
|
+
model: incident,
|
|
676
657
|
seriesLabels,
|
|
677
658
|
projectId: input.monitor.projectId!,
|
|
678
659
|
});
|
|
@@ -685,7 +666,10 @@ export default class MonitorIncident {
|
|
|
685
666
|
* path resolved, so the per-cluster Activity tabs always see
|
|
686
667
|
* monitor-created incidents.
|
|
687
668
|
*/
|
|
688
|
-
|
|
669
|
+
SeriesResourceLinker.attachClusterContext({
|
|
670
|
+
model: incident,
|
|
671
|
+
clusterContext,
|
|
672
|
+
});
|
|
689
673
|
|
|
690
674
|
incident.onCallDutyPolicies =
|
|
691
675
|
criteriaIncident.onCallPolicyIds?.map((id: ObjectID) => {
|
|
@@ -881,320 +865,6 @@ export default class MonitorIncident {
|
|
|
881
865
|
return mergedIds;
|
|
882
866
|
}
|
|
883
867
|
|
|
884
|
-
/*
|
|
885
|
-
* Pull every host / docker-host / k8s-cluster / proxmox-cluster /
|
|
886
|
-
* ceph-cluster / service identifier out of the series labels and
|
|
887
|
-
* attach the matching project-scoped records to the incident. The
|
|
888
|
-
* label-key → resource-type mapping lives in SeriesResourceLabels
|
|
889
|
-
* (shared with the scheduled-maintenance suppression path so the two
|
|
890
|
-
* never disagree about which labels identify which resource). Lookups
|
|
891
|
-
* are always project-scoped so a stale or hostile stamp can't pull in
|
|
892
|
-
* a record from another tenant.
|
|
893
|
-
*/
|
|
894
|
-
private static async linkResourceContextFromSeries(input: {
|
|
895
|
-
incident: Incident;
|
|
896
|
-
seriesLabels: JSONObject;
|
|
897
|
-
projectId: ObjectID;
|
|
898
|
-
}): Promise<void> {
|
|
899
|
-
const refs: SeriesResourceRefs = SeriesResourceLabels.extractResourceRefs(
|
|
900
|
-
input.seriesLabels,
|
|
901
|
-
);
|
|
902
|
-
|
|
903
|
-
const [
|
|
904
|
-
resolvedHosts,
|
|
905
|
-
resolvedDockerHosts,
|
|
906
|
-
resolvedPodmanHosts,
|
|
907
|
-
resolvedClusters,
|
|
908
|
-
resolvedServices,
|
|
909
|
-
resolvedProxmoxClusters,
|
|
910
|
-
resolvedCephClusters,
|
|
911
|
-
] = await Promise.all([
|
|
912
|
-
this.resolveResourceIds({
|
|
913
|
-
ids: refs.hostIds,
|
|
914
|
-
names: refs.hostNames,
|
|
915
|
-
nameColumn: "hostIdentifier",
|
|
916
|
-
projectId: input.projectId,
|
|
917
|
-
findBy: HostService.findBy.bind(HostService),
|
|
918
|
-
}),
|
|
919
|
-
this.resolveResourceIds({
|
|
920
|
-
ids: refs.dockerHostIds,
|
|
921
|
-
names: refs.dockerHostNames,
|
|
922
|
-
nameColumn: "hostIdentifier",
|
|
923
|
-
projectId: input.projectId,
|
|
924
|
-
findBy: DockerHostService.findBy.bind(DockerHostService),
|
|
925
|
-
}),
|
|
926
|
-
this.resolveResourceIds({
|
|
927
|
-
ids: refs.podmanHostIds,
|
|
928
|
-
names: refs.podmanHostNames,
|
|
929
|
-
nameColumn: "hostIdentifier",
|
|
930
|
-
projectId: input.projectId,
|
|
931
|
-
findBy: PodmanHostService.findBy.bind(PodmanHostService),
|
|
932
|
-
}),
|
|
933
|
-
this.resolveResourceIds({
|
|
934
|
-
ids: refs.kubernetesClusterIds,
|
|
935
|
-
names: refs.kubernetesClusterNames,
|
|
936
|
-
nameColumn: "clusterIdentifier",
|
|
937
|
-
projectId: input.projectId,
|
|
938
|
-
findBy: KubernetesClusterService.findBy.bind(KubernetesClusterService),
|
|
939
|
-
}),
|
|
940
|
-
this.resolveResourceIds({
|
|
941
|
-
ids: refs.serviceIds,
|
|
942
|
-
names: refs.serviceNames,
|
|
943
|
-
nameColumn: "name",
|
|
944
|
-
projectId: input.projectId,
|
|
945
|
-
findBy: ServiceService.findBy.bind(ServiceService),
|
|
946
|
-
}),
|
|
947
|
-
this.resolveResourceIds({
|
|
948
|
-
ids: [],
|
|
949
|
-
names: refs.proxmoxClusterNames,
|
|
950
|
-
nameColumn: "name",
|
|
951
|
-
projectId: input.projectId,
|
|
952
|
-
findBy: ProxmoxClusterService.findBy.bind(ProxmoxClusterService),
|
|
953
|
-
}),
|
|
954
|
-
this.resolveResourceIds({
|
|
955
|
-
ids: [],
|
|
956
|
-
names: refs.cephClusterNames,
|
|
957
|
-
nameColumn: "name",
|
|
958
|
-
projectId: input.projectId,
|
|
959
|
-
findBy: CephClusterService.findBy.bind(CephClusterService),
|
|
960
|
-
}),
|
|
961
|
-
]);
|
|
962
|
-
|
|
963
|
-
if (resolvedHosts.length > 0) {
|
|
964
|
-
input.incident.hosts = resolvedHosts.map((id: string): Host => {
|
|
965
|
-
const host: Host = new Host();
|
|
966
|
-
host._id = id;
|
|
967
|
-
return host;
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
if (resolvedDockerHosts.length > 0) {
|
|
971
|
-
input.incident.dockerHosts = resolvedDockerHosts.map(
|
|
972
|
-
(id: string): DockerHost => {
|
|
973
|
-
const dockerHost: DockerHost = new DockerHost();
|
|
974
|
-
dockerHost._id = id;
|
|
975
|
-
return dockerHost;
|
|
976
|
-
},
|
|
977
|
-
);
|
|
978
|
-
}
|
|
979
|
-
if (resolvedPodmanHosts.length > 0) {
|
|
980
|
-
input.incident.podmanHosts = resolvedPodmanHosts.map(
|
|
981
|
-
(id: string): PodmanHost => {
|
|
982
|
-
const podmanHost: PodmanHost = new PodmanHost();
|
|
983
|
-
podmanHost._id = id;
|
|
984
|
-
return podmanHost;
|
|
985
|
-
},
|
|
986
|
-
);
|
|
987
|
-
}
|
|
988
|
-
if (resolvedClusters.length > 0) {
|
|
989
|
-
input.incident.kubernetesClusters = resolvedClusters.map(
|
|
990
|
-
(id: string): KubernetesCluster => {
|
|
991
|
-
const cluster: KubernetesCluster = new KubernetesCluster();
|
|
992
|
-
cluster._id = id;
|
|
993
|
-
return cluster;
|
|
994
|
-
},
|
|
995
|
-
);
|
|
996
|
-
}
|
|
997
|
-
if (resolvedServices.length > 0) {
|
|
998
|
-
input.incident.services = resolvedServices.map((id: string): Service => {
|
|
999
|
-
const service: Service = new Service();
|
|
1000
|
-
service._id = id;
|
|
1001
|
-
return service;
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
if (resolvedProxmoxClusters.length > 0) {
|
|
1005
|
-
input.incident.proxmoxClusters = resolvedProxmoxClusters.map(
|
|
1006
|
-
(id: string): ProxmoxCluster => {
|
|
1007
|
-
const cluster: ProxmoxCluster = new ProxmoxCluster();
|
|
1008
|
-
cluster._id = id;
|
|
1009
|
-
return cluster;
|
|
1010
|
-
},
|
|
1011
|
-
);
|
|
1012
|
-
}
|
|
1013
|
-
if (resolvedCephClusters.length > 0) {
|
|
1014
|
-
input.incident.cephClusters = resolvedCephClusters.map(
|
|
1015
|
-
(id: string): CephCluster => {
|
|
1016
|
-
const cluster: CephCluster = new CephCluster();
|
|
1017
|
-
cluster._id = id;
|
|
1018
|
-
return cluster;
|
|
1019
|
-
},
|
|
1020
|
-
);
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
/*
|
|
1025
|
-
* Attach the monitor-step-resolved Proxmox/Ceph cluster ids to the
|
|
1026
|
-
* incident, merging with (never overwriting) anything the
|
|
1027
|
-
* series-label path already linked. Both paths can resolve the same
|
|
1028
|
-
* cluster, so dedupe by id.
|
|
1029
|
-
*/
|
|
1030
|
-
private static attachClusterContext(input: {
|
|
1031
|
-
incident: Incident;
|
|
1032
|
-
clusterContext: MonitorClusterContext;
|
|
1033
|
-
}): void {
|
|
1034
|
-
if (input.clusterContext.proxmoxClusterIds.length > 0) {
|
|
1035
|
-
const existingIds: Set<string> = new Set<string>(
|
|
1036
|
-
(input.incident.proxmoxClusters || []).map(
|
|
1037
|
-
(cluster: ProxmoxCluster) => {
|
|
1038
|
-
return String(cluster._id);
|
|
1039
|
-
},
|
|
1040
|
-
),
|
|
1041
|
-
);
|
|
1042
|
-
|
|
1043
|
-
const merged: Array<ProxmoxCluster> = [
|
|
1044
|
-
...(input.incident.proxmoxClusters || []),
|
|
1045
|
-
];
|
|
1046
|
-
|
|
1047
|
-
for (const id of input.clusterContext.proxmoxClusterIds) {
|
|
1048
|
-
if (existingIds.has(id)) {
|
|
1049
|
-
continue;
|
|
1050
|
-
}
|
|
1051
|
-
const cluster: ProxmoxCluster = new ProxmoxCluster();
|
|
1052
|
-
cluster._id = id;
|
|
1053
|
-
merged.push(cluster);
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
input.incident.proxmoxClusters = merged;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
if (input.clusterContext.cephClusterIds.length > 0) {
|
|
1060
|
-
const existingIds: Set<string> = new Set<string>(
|
|
1061
|
-
(input.incident.cephClusters || []).map((cluster: CephCluster) => {
|
|
1062
|
-
return String(cluster._id);
|
|
1063
|
-
}),
|
|
1064
|
-
);
|
|
1065
|
-
|
|
1066
|
-
const merged: Array<CephCluster> = [
|
|
1067
|
-
...(input.incident.cephClusters || []),
|
|
1068
|
-
];
|
|
1069
|
-
|
|
1070
|
-
for (const id of input.clusterContext.cephClusterIds) {
|
|
1071
|
-
if (existingIds.has(id)) {
|
|
1072
|
-
continue;
|
|
1073
|
-
}
|
|
1074
|
-
const cluster: CephCluster = new CephCluster();
|
|
1075
|
-
cluster._id = id;
|
|
1076
|
-
merged.push(cluster);
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
input.incident.cephClusters = merged;
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
if (input.clusterContext.dockerSwarmClusterIds.length > 0) {
|
|
1083
|
-
const existingIds: Set<string> = new Set<string>(
|
|
1084
|
-
(input.incident.dockerSwarmClusters || []).map(
|
|
1085
|
-
(cluster: DockerSwarmCluster) => {
|
|
1086
|
-
return String(cluster._id);
|
|
1087
|
-
},
|
|
1088
|
-
),
|
|
1089
|
-
);
|
|
1090
|
-
|
|
1091
|
-
const merged: Array<DockerSwarmCluster> = [
|
|
1092
|
-
...(input.incident.dockerSwarmClusters || []),
|
|
1093
|
-
];
|
|
1094
|
-
|
|
1095
|
-
for (const id of input.clusterContext.dockerSwarmClusterIds) {
|
|
1096
|
-
if (existingIds.has(id)) {
|
|
1097
|
-
continue;
|
|
1098
|
-
}
|
|
1099
|
-
const cluster: DockerSwarmCluster = new DockerSwarmCluster();
|
|
1100
|
-
cluster._id = id;
|
|
1101
|
-
merged.push(cluster);
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
input.incident.dockerSwarmClusters = merged;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
if (input.clusterContext.iotFleetIds.length > 0) {
|
|
1108
|
-
const existingIds: Set<string> = new Set<string>(
|
|
1109
|
-
(input.incident.iotFleets || []).map((fleet: IoTFleet) => {
|
|
1110
|
-
return String(fleet._id);
|
|
1111
|
-
}),
|
|
1112
|
-
);
|
|
1113
|
-
|
|
1114
|
-
const merged: Array<IoTFleet> = [...(input.incident.iotFleets || [])];
|
|
1115
|
-
|
|
1116
|
-
for (const id of input.clusterContext.iotFleetIds) {
|
|
1117
|
-
if (existingIds.has(id)) {
|
|
1118
|
-
continue;
|
|
1119
|
-
}
|
|
1120
|
-
const fleet: IoTFleet = new IoTFleet();
|
|
1121
|
-
fleet._id = id;
|
|
1122
|
-
merged.push(fleet);
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
input.incident.iotFleets = merged;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
/*
|
|
1130
|
-
* Resolve a mix of ids and names to a deduped set of database ids
|
|
1131
|
-
* for one resource type, project-scoped. Either or both lists may
|
|
1132
|
-
* be empty; if both are empty the method short-circuits with no DB
|
|
1133
|
-
* round-trip.
|
|
1134
|
-
*/
|
|
1135
|
-
private static async resolveResourceIds(input: {
|
|
1136
|
-
ids: Array<string>;
|
|
1137
|
-
names: Array<string>;
|
|
1138
|
-
nameColumn: string;
|
|
1139
|
-
projectId: ObjectID;
|
|
1140
|
-
/*
|
|
1141
|
-
* Loosely typed because the three resource services (Host,
|
|
1142
|
-
* DockerHost, KubernetesCluster) each have their own
|
|
1143
|
-
* `Query<TBaseModel>` shape and we deliberately abstract over
|
|
1144
|
-
* them. We only need the row's `_id` back, which every model
|
|
1145
|
-
* exposes via `DatabaseBaseModel`.
|
|
1146
|
-
*/
|
|
1147
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1148
|
-
findBy: (args: any) => Promise<Array<{ _id?: string | undefined }>>;
|
|
1149
|
-
}): Promise<Array<string>> {
|
|
1150
|
-
if (input.ids.length === 0 && input.names.length === 0) {
|
|
1151
|
-
return [];
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
const resolved: Set<string> = new Set<string>();
|
|
1155
|
-
|
|
1156
|
-
const lookups: Array<Promise<Array<{ _id?: string | undefined }>>> = [];
|
|
1157
|
-
if (input.ids.length > 0) {
|
|
1158
|
-
lookups.push(
|
|
1159
|
-
input.findBy({
|
|
1160
|
-
query: {
|
|
1161
|
-
projectId: input.projectId,
|
|
1162
|
-
_id: new Includes(input.ids),
|
|
1163
|
-
},
|
|
1164
|
-
select: { _id: true },
|
|
1165
|
-
skip: 0,
|
|
1166
|
-
limit: LIMIT_PER_PROJECT,
|
|
1167
|
-
props: { isRoot: true },
|
|
1168
|
-
}),
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
if (input.names.length > 0) {
|
|
1172
|
-
lookups.push(
|
|
1173
|
-
input.findBy({
|
|
1174
|
-
query: {
|
|
1175
|
-
projectId: input.projectId,
|
|
1176
|
-
[input.nameColumn]: new Includes(input.names),
|
|
1177
|
-
},
|
|
1178
|
-
select: { _id: true },
|
|
1179
|
-
skip: 0,
|
|
1180
|
-
limit: LIMIT_PER_PROJECT,
|
|
1181
|
-
props: { isRoot: true },
|
|
1182
|
-
}),
|
|
1183
|
-
);
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
const buckets: Array<Array<{ _id?: string | undefined }>> =
|
|
1187
|
-
await Promise.all(lookups);
|
|
1188
|
-
for (const bucket of buckets) {
|
|
1189
|
-
for (const row of bucket) {
|
|
1190
|
-
if (row._id) {
|
|
1191
|
-
resolved.add(String(row._id));
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
return Array.from(resolved);
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
868
|
private static async resolveOpenIncident(input: {
|
|
1199
869
|
openIncident: Incident;
|
|
1200
870
|
rootCause: string;
|
|
@@ -31,6 +31,12 @@ export interface MaintainedResourceKeys {
|
|
|
31
31
|
*/
|
|
32
32
|
proxmoxClusters: ResourceKeySet;
|
|
33
33
|
cephClusters: ResourceKeySet;
|
|
34
|
+
/*
|
|
35
|
+
* Docker Swarm clusters, like Proxmox/Ceph clusters, have no
|
|
36
|
+
* `oneuptime.*.id` label stamp, so only the name set is ever matched;
|
|
37
|
+
* the id set exists for shape parity.
|
|
38
|
+
*/
|
|
39
|
+
dockerSwarmClusters: ResourceKeySet;
|
|
34
40
|
/*
|
|
35
41
|
* IoT fleets, like Proxmox/Ceph clusters, have no `oneuptime.*.id`
|
|
36
42
|
* label stamp, so only the name set is ever matched; the id set
|
|
@@ -140,6 +146,10 @@ export default class MonitorMaintenanceSuppression {
|
|
|
140
146
|
refs.cephClusterNames,
|
|
141
147
|
input.maintained.cephClusters.names,
|
|
142
148
|
) ||
|
|
149
|
+
this.intersects(
|
|
150
|
+
refs.dockerSwarmClusterNames,
|
|
151
|
+
input.maintained.dockerSwarmClusters.names,
|
|
152
|
+
) ||
|
|
143
153
|
this.intersects(refs.iotFleetNames, input.maintained.iotFleets.names) ||
|
|
144
154
|
this.intersects(refs.serviceIds, input.maintained.services.ids) ||
|
|
145
155
|
this.intersects(refs.serviceNames, input.maintained.services.names);
|
|
@@ -177,6 +187,8 @@ export default class MonitorMaintenanceSuppression {
|
|
|
177
187
|
maintained.proxmoxClusters.names.size > 0 ||
|
|
178
188
|
maintained.cephClusters.ids.size > 0 ||
|
|
179
189
|
maintained.cephClusters.names.size > 0 ||
|
|
190
|
+
maintained.dockerSwarmClusters.ids.size > 0 ||
|
|
191
|
+
maintained.dockerSwarmClusters.names.size > 0 ||
|
|
180
192
|
maintained.iotFleets.ids.size > 0 ||
|
|
181
193
|
maintained.iotFleets.names.size > 0 ||
|
|
182
194
|
maintained.services.ids.size > 0 ||
|
|
@@ -186,8 +198,9 @@ export default class MonitorMaintenanceSuppression {
|
|
|
186
198
|
|
|
187
199
|
/*
|
|
188
200
|
* Collect the ids + identifiers of every Host / DockerHost /
|
|
189
|
-
* KubernetesCluster / ProxmoxCluster / CephCluster /
|
|
190
|
-
*
|
|
201
|
+
* PodmanHost / KubernetesCluster / ProxmoxCluster / CephCluster /
|
|
202
|
+
* DockerSwarmCluster / IoTFleet / Service attached to an ongoing
|
|
203
|
+
* maintenance event in this project. Monitors attached
|
|
191
204
|
* to the event are intentionally not collected here — those are
|
|
192
205
|
* already handled upstream by the whole-monitor disable flag, which
|
|
193
206
|
* short-circuits evaluation before we ever reach per-series creation.
|
|
@@ -202,6 +215,10 @@ export default class MonitorMaintenanceSuppression {
|
|
|
202
215
|
kubernetesClusters: { ids: new Set<string>(), names: new Set<string>() },
|
|
203
216
|
proxmoxClusters: { ids: new Set<string>(), names: new Set<string>() },
|
|
204
217
|
cephClusters: { ids: new Set<string>(), names: new Set<string>() },
|
|
218
|
+
dockerSwarmClusters: {
|
|
219
|
+
ids: new Set<string>(),
|
|
220
|
+
names: new Set<string>(),
|
|
221
|
+
},
|
|
205
222
|
iotFleets: { ids: new Set<string>(), names: new Set<string>() },
|
|
206
223
|
services: { ids: new Set<string>(), names: new Set<string>() },
|
|
207
224
|
};
|
|
@@ -222,6 +239,7 @@ export default class MonitorMaintenanceSuppression {
|
|
|
222
239
|
kubernetesClusters: { _id: true, clusterIdentifier: true },
|
|
223
240
|
proxmoxClusters: { _id: true, name: true },
|
|
224
241
|
cephClusters: { _id: true, name: true },
|
|
242
|
+
dockerSwarmClusters: { _id: true, name: true },
|
|
225
243
|
iotFleets: { _id: true, name: true },
|
|
226
244
|
services: { _id: true, name: true },
|
|
227
245
|
},
|
|
@@ -267,6 +285,13 @@ export default class MonitorMaintenanceSuppression {
|
|
|
267
285
|
for (const cephCluster of event.cephClusters || []) {
|
|
268
286
|
this.addKey(maintained.cephClusters, cephCluster._id, cephCluster.name);
|
|
269
287
|
}
|
|
288
|
+
for (const swarmCluster of event.dockerSwarmClusters || []) {
|
|
289
|
+
this.addKey(
|
|
290
|
+
maintained.dockerSwarmClusters,
|
|
291
|
+
swarmCluster._id,
|
|
292
|
+
swarmCluster.name,
|
|
293
|
+
);
|
|
294
|
+
}
|
|
270
295
|
for (const iotFleet of event.iotFleets || []) {
|
|
271
296
|
this.addKey(maintained.iotFleets, iotFleet._id, iotFleet.name);
|
|
272
297
|
}
|
|
@@ -64,6 +64,25 @@ export const PodmanHostNameLabelKeys: ReadonlyArray<string> = [
|
|
|
64
64
|
"oneuptime.podman.host.name",
|
|
65
65
|
];
|
|
66
66
|
|
|
67
|
+
/*
|
|
68
|
+
* Docker Swarm cluster identity rides the agent-stamped resource
|
|
69
|
+
* attribute (`docker.swarm.cluster.name`) and its ClickHouse
|
|
70
|
+
* `resource.`-prefixed twin. The Swarm agent's collector config stamps
|
|
71
|
+
* it on every signal as the documented join key, and ingest keys cluster
|
|
72
|
+
* rows by that name only — there is no `oneuptime.*.id` stamp — so only
|
|
73
|
+
* name keys exist. The name maps to the cluster model's `name` column.
|
|
74
|
+
* Like Proxmox/Ceph, the shipped Swarm alert templates group by
|
|
75
|
+
* datapoint labels (`container.name`), so their series labels do NOT
|
|
76
|
+
* carry this key; the deterministic cluster link for those monitors
|
|
77
|
+
* comes from the monitor step config instead (see MonitorClusterContext).
|
|
78
|
+
* These keys cover user-built monitors that group by the cluster
|
|
79
|
+
* attribute.
|
|
80
|
+
*/
|
|
81
|
+
export const DockerSwarmClusterNameLabelKeys: ReadonlyArray<string> = [
|
|
82
|
+
"resource.docker.swarm.cluster.name",
|
|
83
|
+
"docker.swarm.cluster.name",
|
|
84
|
+
];
|
|
85
|
+
|
|
67
86
|
export const KubernetesClusterIdLabelKeys: ReadonlyArray<string> = [
|
|
68
87
|
"resource.oneuptime.kubernetes.cluster.id",
|
|
69
88
|
"oneuptime.kubernetes.cluster.id",
|
|
@@ -129,6 +148,14 @@ export const ServiceIdLabelKeys: ReadonlyArray<string> = [
|
|
|
129
148
|
];
|
|
130
149
|
|
|
131
150
|
export const ServiceNameLabelKeys: ReadonlyArray<string> = [
|
|
151
|
+
/*
|
|
152
|
+
* Ingest stamps `oneuptime.service.name` alongside `oneuptime.service.id`
|
|
153
|
+
* on every row (Telemetry.getAttributesForServiceIdAndServiceName). It
|
|
154
|
+
* carries the same Service row's name as the raw `service.name` resource
|
|
155
|
+
* attribute, so the group-by dropdown can surface either spelling.
|
|
156
|
+
*/
|
|
157
|
+
"resource.oneuptime.service.name",
|
|
158
|
+
"oneuptime.service.name",
|
|
132
159
|
"resource.service.name",
|
|
133
160
|
"service.name",
|
|
134
161
|
];
|
|
@@ -149,6 +176,7 @@ export interface SeriesResourceRefs {
|
|
|
149
176
|
podmanHostNames: Array<string>;
|
|
150
177
|
kubernetesClusterIds: Array<string>;
|
|
151
178
|
kubernetesClusterNames: Array<string>;
|
|
179
|
+
dockerSwarmClusterNames: Array<string>;
|
|
152
180
|
proxmoxClusterNames: Array<string>;
|
|
153
181
|
cephClusterNames: Array<string>;
|
|
154
182
|
iotFleetNames: Array<string>;
|
|
@@ -218,6 +246,10 @@ export default class SeriesResourceLabels {
|
|
|
218
246
|
seriesLabels,
|
|
219
247
|
KubernetesClusterNameLabelKeys,
|
|
220
248
|
),
|
|
249
|
+
dockerSwarmClusterNames: this.collectLabelValues(
|
|
250
|
+
seriesLabels,
|
|
251
|
+
DockerSwarmClusterNameLabelKeys,
|
|
252
|
+
),
|
|
221
253
|
proxmoxClusterNames: this.collectLabelValues(
|
|
222
254
|
seriesLabels,
|
|
223
255
|
ProxmoxClusterNameLabelKeys,
|