@oneuptime/common 12.0.15 → 12.0.17
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/AnalyticsModels/Index.ts +10 -0
- package/Models/AnalyticsModels/LogCountBaseline.ts +174 -0
- package/Models/AnalyticsModels/SecurityEvent.ts +794 -0
- package/Models/AnalyticsModels/Span.ts +29 -1
- package/Models/AnalyticsModels/SpanCountBaseline.ts +198 -0
- package/Models/DatabaseModels/Alert.ts +42 -0
- package/Models/DatabaseModels/AlertMeasurement.ts +1114 -0
- package/Models/DatabaseModels/AlertMeasurementValue.ts +501 -0
- package/Models/DatabaseModels/AlertStateTimeline.ts +10 -2
- package/Models/DatabaseModels/BillingPaymentMethod.ts +8 -10
- package/Models/DatabaseModels/DetectionRule.ts +568 -0
- package/Models/DatabaseModels/GoogleSecOpsConnection.ts +382 -0
- package/Models/DatabaseModels/Incident.ts +42 -0
- package/Models/DatabaseModels/IncidentMeasurement.ts +1114 -0
- package/Models/DatabaseModels/IncidentMeasurementValue.ts +501 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +10 -2
- package/Models/DatabaseModels/IncomingCallPolicyLabelRule.ts +36 -0
- package/Models/DatabaseModels/IncomingCallPolicyOwnerRule.ts +42 -0
- package/Models/DatabaseModels/Index.ts +20 -0
- package/Models/DatabaseModels/Label.ts +11 -0
- package/Models/DatabaseModels/LlmCostBudget.ts +655 -0
- package/Models/DatabaseModels/LlmModelPrice.ts +481 -0
- package/Models/DatabaseModels/LogSavedView.ts +87 -0
- package/Models/DatabaseModels/MarketingConversion.ts +210 -8
- package/Models/DatabaseModels/MetricSavedView.ts +59 -0
- package/Models/DatabaseModels/OnCallDutyPolicyLabelRule.ts +36 -0
- package/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.ts +42 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.ts +36 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.ts +42 -0
- package/Models/DatabaseModels/Probe.ts +21 -0
- package/Models/DatabaseModels/RunbookLabelRule.ts +36 -0
- package/Models/DatabaseModels/RunbookOwnerRule.ts +42 -0
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.ts +1104 -0
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.ts +491 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +10 -2
- package/Models/DatabaseModels/StatusPageLabelRule.ts +36 -0
- package/Models/DatabaseModels/StatusPageOwnerRule.ts +42 -0
- package/Models/DatabaseModels/TableView.ts +15 -0
- package/Models/DatabaseModels/Team.ts +13 -0
- package/Models/DatabaseModels/TeamMember.ts +8 -0
- package/Models/DatabaseModels/TraceSavedView.ts +52 -0
- package/Models/DatabaseModels/WorkflowLabelRule.ts +36 -0
- package/Models/DatabaseModels/WorkflowOwnerRule.ts +42 -0
- package/Server/API/TelemetryAPI.ts +252 -6
- package/Server/API/UserAPI.ts +88 -0
- package/Server/EnvironmentConfig.ts +36 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.ts +88 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.ts +457 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.ts +97 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.ts +45 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.ts +105 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.ts +77 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788600000000-AddDetectionRuleIncidentColumns.ts +39 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Middleware/IdentityRateLimit.ts +672 -0
- package/Server/Services/AccessTokenService.ts +15 -2
- package/Server/Services/AlertMeasurementService.ts +302 -0
- package/Server/Services/AlertMeasurementValueService.ts +508 -0
- package/Server/Services/AlertService.ts +50 -0
- package/Server/Services/AlertStateTimelineService.ts +54 -0
- package/Server/Services/DetectionRuleService.ts +74 -0
- package/Server/Services/GoogleSecOpsConnectionService.ts +89 -0
- package/Server/Services/IncidentMeasurementService.ts +304 -0
- package/Server/Services/IncidentMeasurementValueService.ts +523 -0
- package/Server/Services/IncidentService.ts +51 -0
- package/Server/Services/IncidentStateTimelineService.ts +54 -0
- package/Server/Services/Index.ts +30 -0
- package/Server/Services/LlmCostBudgetService.ts +93 -0
- package/Server/Services/LlmModelPriceService.ts +202 -0
- package/Server/Services/LogAggregationService.ts +1106 -2
- package/Server/Services/LogCountBaselineService.ts +163 -0
- package/Server/Services/MutableMetricService.ts +30 -9
- package/Server/Services/ScheduledMaintenanceMeasurementService.ts +311 -0
- package/Server/Services/ScheduledMaintenanceMeasurementValueService.ts +546 -0
- package/Server/Services/ScheduledMaintenanceService.ts +53 -0
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +188 -1
- package/Server/Services/SecurityEventService.ts +104 -0
- package/Server/Services/SpanCountBaselineService.ts +173 -0
- package/Server/Services/StatusPageService.ts +4 -3
- package/Server/Services/TelemetryUsageBillingService.ts +17 -2
- package/Server/Services/UserService.ts +284 -51
- package/Server/Services/UserTotpAuthService.ts +27 -86
- package/Server/Services/UserWebAuthnService.ts +26 -86
- package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +14 -0
- package/Server/Types/Database/Permissions/TenantPermission.ts +10 -0
- package/Server/Types/Database/QueryHelper.ts +1 -1
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +1 -1
- package/Server/Utils/AI/Toolbox/Index.ts +6 -0
- package/Server/Utils/AI/Toolbox/SecurityEventTools.ts +349 -0
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +13 -4
- package/Server/Utils/Attribution.ts +130 -34
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +98 -16
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +70 -7
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +54 -16
- package/Server/Utils/Marketing/Providers/Meta.ts +52 -18
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +37 -10
- package/Server/Utils/Marketing/Providers/Reddit.ts +45 -15
- package/Server/Utils/Measurement/MeasurementDefinitionValidator.ts +209 -0
- package/Server/Utils/Measurement/MeasurementMetricWriter.ts +189 -0
- package/Server/Utils/Monitor/Criteria/CountAnomaly.ts +182 -0
- package/Server/Utils/Monitor/Criteria/LogMonitorCriteria.ts +132 -0
- package/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.ts +35 -0
- package/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts +132 -0
- package/Server/Utils/Monitor/DataToProcess.ts +2 -0
- package/Server/Utils/Monitor/MonitorCriteriaDataExtractor.ts +14 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -0
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +20 -0
- package/Server/Utils/Monitor/MonitorResource.ts +16 -0
- package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +1 -0
- package/Server/Utils/Monitor/MonitorStepsReferenceExtractor.ts +1 -0
- package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +805 -0
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.ts +262 -0
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +212 -0
- package/Server/Utils/SecurityEvent/SecurityEventRow.ts +101 -0
- package/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.ts +635 -0
- package/Server/Utils/Telemetry/LlmCostBudgetEvaluator.ts +379 -0
- package/Server/Utils/Telemetry/LlmSpan.ts +83 -4
- package/Server/Utils/Telemetry/LogErrorPatternSql.ts +136 -0
- package/Server/Utils/UserPermission/UserPermission.ts +57 -1
- package/Tests/App/Dashboard/AlertsSideMenu.test.tsx +4 -0
- package/Tests/App/Dashboard/CreatePageEntryPointPermissions.test.tsx +306 -0
- package/Tests/App/Dashboard/DangerZone.test.tsx +11 -0
- package/Tests/App/Dashboard/IncidentsSideMenu.test.tsx +4 -0
- package/Tests/App/Dashboard/LogMonitorAttributeOperatorPreview.test.tsx +459 -0
- package/Tests/App/Dashboard/OverviewCustomFields.test.tsx +24 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceSideMenu.test.tsx +6 -0
- package/Tests/App/Dashboard/SecurityEventsDetectionRulesPage.test.tsx +250 -0
- package/Tests/App/Dashboard/SecurityEventsMonitorStepForm.test.tsx +106 -0
- package/Tests/App/Dashboard/SecurityEventsMonitorsPage.test.tsx +185 -0
- package/Tests/App/Dashboard/SecurityEventsSetupGuide.test.tsx +200 -0
- package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +323 -0
- package/Tests/Models/DatabaseModels/ProjectSharedResources.test.ts +386 -0
- package/Tests/Models/DetectionRuleCreateContract.test.ts +35 -0
- package/Tests/Server/API/LogErrorPatternAPI.test.ts +811 -0
- package/Tests/Server/API/UserAuthenticationAPI.test.ts +11 -0
- package/Tests/Server/API/UserProjectsAPI.test.ts +11 -2
- package/Tests/Server/API/UserTwoFactorAuthAdminAPI.test.ts +918 -0
- package/Tests/Server/Infrastructure/LocalCache.test.ts +149 -0
- package/Tests/Server/Services/AccessTokenProjectUserGrant.test.ts +249 -0
- package/Tests/Server/Services/AlertMeasurementService.test.ts +665 -0
- package/Tests/Server/Services/AlertMeasurementValueService.test.ts +389 -0
- package/Tests/Server/Services/DetectionRuleService.test.ts +254 -0
- package/Tests/Server/Services/IncidentMeasurementService.test.ts +394 -0
- package/Tests/Server/Services/IncidentMeasurementValueService.test.ts +816 -0
- package/Tests/Server/Services/LlmCostBudgetService.test.ts +104 -0
- package/Tests/Server/Services/LogAggregationAttributeOperators.test.ts +405 -0
- package/Tests/Server/Services/LogErrorPatternAggregation.test.ts +804 -0
- package/Tests/Server/Services/MutableMetricNameRouting.test.ts +83 -0
- package/Tests/Server/Services/ScheduledMaintenanceMeasurementService.test.ts +750 -0
- package/Tests/Server/Services/ScheduledMaintenanceMeasurementValueService.test.ts +478 -0
- package/Tests/Server/Services/UserAuthenticationService.test.ts +216 -4
- package/Tests/Server/Services/UserTwoFactorAuthAdmin.test.ts +1190 -0
- package/Tests/Server/Types/Database/Permissions/ScopedRoleSharedResourceAccess.test.ts +466 -0
- package/Tests/Server/Types/Database/QueryHelperOperators.test.ts +265 -0
- package/Tests/Server/Types/Database/QueryHelperTextAndStructuralOperators.test.ts +206 -0
- package/Tests/Server/Utils/AnalyticsDatabase/ClusterAwareSchema.test.ts +6 -0
- package/Tests/Server/Utils/AnalyticsDatabase/FractionalAttributeThreshold.test.ts +224 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +172 -2
- package/Tests/Server/Utils/Attribution.test.ts +228 -1
- package/Tests/Server/Utils/Marketing/AdUploadableConversionTypes.test.ts +153 -92
- package/Tests/Server/Utils/Marketing/ConversionUploadProvider.test.ts +123 -6
- package/Tests/Server/Utils/Marketing/GoogleAds.test.ts +253 -1
- package/Tests/Server/Utils/Marketing/LinkedIn.test.ts +282 -0
- package/Tests/Server/Utils/Marketing/Meta.test.ts +304 -0
- package/Tests/Server/Utils/Marketing/MicrosoftAds.test.ts +263 -0
- package/Tests/Server/Utils/Marketing/Reddit.test.ts +259 -0
- package/Tests/Server/Utils/Measurement/MeasurementDefinitionValidator.test.ts +322 -0
- package/Tests/Server/Utils/Measurement/MeasurementMetricWriter.test.ts +373 -0
- package/Tests/Server/Utils/Monitor/Criteria/CountAnomaly.test.ts +221 -0
- package/Tests/Server/Utils/Monitor/Criteria/LogMonitorCriteria.test.ts +236 -0
- package/Tests/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.test.ts +147 -0
- package/Tests/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.test.ts +274 -0
- package/Tests/Server/Utils/Monitor/SecurityEventsMonitorDataExtractor.test.ts +93 -0
- package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +1098 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsClient.test.ts +308 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +271 -0
- package/Tests/Server/Utils/SecurityEvent/SecurityEventRow.test.ts +272 -0
- package/Tests/Server/Utils/SecurityEvent/SigmaClickhouseCompiler.test.ts +511 -0
- package/Tests/Server/Utils/Telemetry/LlmCostBudgetEvaluator.test.ts +497 -0
- package/Tests/Server/Utils/Telemetry/LlmSpan.test.ts +380 -0
- package/Tests/Server/Utils/Telemetry/LogErrorPatternSql.test.ts +207 -0
- package/Tests/Server/Utils/UserPermission/ProjectUserGrant.test.ts +293 -0
- package/Tests/Types/Monitor/MonitorStepInfraMonitorUtils.test.ts +194 -0
- package/Tests/Types/Monitor/MonitorStepSecurityEventsMonitor.test.ts +201 -0
- package/Tests/Types/SecurityEvent/OcsfEventClass.test.ts +105 -0
- package/Tests/Types/SecurityEvent/OcsfSeverity.test.ts +111 -0
- package/Tests/Types/Telemetry/LlmCostCatalog.test.ts +516 -0
- package/Tests/UI/Components/ActiveFilterChipsOperatorValues.test.tsx +222 -0
- package/Tests/UI/Components/BulkActionPermissionGating.test.tsx +296 -0
- package/Tests/UI/Components/CardModelDetailPermissionGating.test.tsx +305 -0
- package/Tests/UI/Components/CustomFields/CustomFieldsDetail.test.tsx +23 -0
- package/Tests/UI/Components/DictionaryFilterOperatorDisplay.test.ts +239 -0
- package/Tests/UI/Components/DisabledButtonTooltip.test.tsx +267 -0
- package/Tests/UI/Components/DuplicateModel.test.tsx +37 -0
- package/Tests/UI/Components/ModelCardPermissionGating.test.tsx +348 -0
- package/Tests/UI/Components/ModelDelete.test.tsx +25 -1
- package/Tests/UI/Components/ModelFormCreatePermission.test.tsx +342 -0
- package/Tests/UI/Components/ModelTable/BaseModelTablePermissionGating.test.tsx +680 -0
- package/Tests/UI/Components/OrderedStatesListCreateGate.test.tsx +174 -0
- package/Tests/UI/Components/SavedViewsDropdownSearch.test.tsx +1127 -0
- package/Tests/UI/Components/SavedViewsFacetSection.test.tsx +958 -0
- package/Tests/UI/Components/SavedViewsList.test.ts +699 -0
- package/Tests/UI/Components/SavedViewsSidebarIntegration.test.tsx +640 -0
- package/Tests/UI/Components/SavedViewsSurfaceParity.test.tsx +679 -0
- package/Tests/UI/Components/TableViewLoadFailure.test.tsx +248 -0
- package/Tests/UI/Types/UseComponentOutsideClick.test.tsx +226 -0
- package/Tests/UI/Utils/PermissionGate.test.ts +467 -0
- package/Tests/Utils/Measurement/MeasurementEvaluator.test.ts +639 -0
- package/Tests/Utils/Monitor/MonitorSummarySnapshotUtil.test.ts +1 -0
- package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +285 -0
- package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +433 -0
- package/Tests/Utils/SecurityEvent/GenericNormalizer.test.ts +204 -0
- package/Tests/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.test.ts +252 -0
- package/Tests/Utils/SecurityEvent/NormalizerHelpers.test.ts +274 -0
- package/Tests/Utils/SecurityEvent/OcsfNormalizer.test.ts +208 -0
- package/Tests/Utils/SecurityEvent/SecurityEventNormalizer.test.ts +172 -0
- package/Tests/Utils/SecurityEvent/SigmaRuleParser.test.ts +471 -0
- package/Tests/Utils/SecurityEvent/UdmNormalizer.test.ts +361 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +82 -0
- package/Tests/Utils/Telemetry/LogErrorPattern.test.ts +463 -0
- package/Types/AI/AIChatTypes.ts +1 -0
- package/Types/Alerts/AlertMeasurementAnchorType.ts +14 -0
- package/Types/Alerts/AlertStateRole.ts +11 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +16 -0
- package/Types/Dashboard/Chart/ChartType.ts +1 -0
- package/Types/Dashboard/DashboardComponentType.ts +2 -0
- package/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.ts +18 -0
- package/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.ts +16 -0
- package/Types/Incident/IncidentMeasurementAnchorType.ts +34 -0
- package/Types/Incident/IncidentStateRole.ts +14 -0
- package/Types/Marketing/Attribution.ts +75 -0
- package/Types/Marketing/MarketingConversion.ts +37 -7
- package/Types/Measurement/MeasurementAggregationType.ts +43 -0
- package/Types/Measurement/MeasurementAnchorKind.ts +23 -0
- package/Types/Measurement/MeasurementOccurrence.ts +14 -0
- package/Types/Measurement/MeasurementStatus.ts +34 -0
- package/Types/MeteredPlan/ProductType.ts +1 -0
- package/Types/Monitor/CriteriaFilter.ts +3 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +64 -0
- package/Types/Monitor/MonitorStep.ts +28 -0
- package/Types/Monitor/MonitorStepSecurityEventsMonitor.ts +100 -0
- package/Types/Monitor/MonitorType.ts +20 -0
- package/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.ts +17 -0
- package/Types/Permission.ts +399 -2
- package/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.ts +20 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.ts +16 -0
- package/Types/SecurityEvent/DetectionFindingConstants.ts +24 -0
- package/Types/SecurityEvent/NormalizedSecurityEvent.ts +92 -0
- package/Types/SecurityEvent/OcsfEventClass.ts +205 -0
- package/Types/SecurityEvent/OcsfSeverity.ts +88 -0
- package/Types/SecurityEvent/SecurityEventFormat.ts +23 -0
- package/Types/SecurityEvent/SigmaRule.ts +70 -0
- package/Types/Telemetry/LlmConventions.ts +20 -1
- package/Types/Telemetry/LlmCostCatalog.ts +557 -0
- package/Types/Telemetry/ServiceType.ts +1 -0
- package/Types/Telemetry/TelemetryRetentionConfig.ts +5 -1
- package/Types/Telemetry/TelemetryType.ts +1 -0
- package/Types/TwoFactorAuthStatus.ts +42 -0
- package/Types/UserAuthenticationStatus.ts +18 -0
- package/UI/Components/ActionButton/ActionButtonSchema.ts +7 -0
- package/UI/Components/BulkUpdate/BulkArchiveActions.tsx +35 -2
- package/UI/Components/BulkUpdate/BulkLabelActions.tsx +34 -1
- package/UI/Components/BulkUpdate/BulkOwnerActions.tsx +45 -1
- package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +3 -0
- package/UI/Components/Button/Button.tsx +37 -2
- package/UI/Components/Card/Card.tsx +6 -0
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +24 -1
- package/UI/Components/Dictionary/DictionaryFilterOperator.ts +57 -0
- package/UI/Components/DuplicateModel/DuplicateModel.tsx +16 -0
- package/UI/Components/Forms/ModelForm.tsx +54 -2
- package/UI/Components/List/ListRow.tsx +6 -0
- package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +34 -7
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +7 -40
- package/UI/Components/LogsViewer/components/SavedViewsDropdown.tsx +155 -3
- package/UI/Components/ModelDelete/ModelDelete.tsx +20 -0
- package/UI/Components/ModelDetail/CardModelDetail.tsx +36 -23
- package/UI/Components/ModelList/ModelList.tsx +21 -2
- package/UI/Components/ModelList/StaticModelList.tsx +11 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +168 -62
- package/UI/Components/ModelTable/ModelTable.tsx +16 -10
- package/UI/Components/ModelTable/TableView.tsx +36 -4
- package/UI/Components/MoreMenu/MoreMenuItem.tsx +36 -4
- package/UI/Components/OrderedStatesList/Item.tsx +6 -0
- package/UI/Components/OrderedStatesList/OrderedStatesList.tsx +81 -47
- package/UI/Components/ResetObjectID/ResetObjectID.tsx +16 -0
- package/UI/Components/SavedViews/SavedViewsFacetSection.tsx +242 -0
- package/UI/Components/SavedViews/SavedViewsList.ts +168 -0
- package/UI/Components/SavedViews/SavedViewsSearchInput.tsx +46 -0
- package/UI/Components/SavedViews/SavedViewsShowMoreButton.tsx +44 -0
- package/UI/Components/Table/TableRow.tsx +12 -0
- package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +152 -2
- package/UI/Types/UseComponentOutsideClick.ts +47 -0
- package/UI/Utils/PermissionGate.ts +277 -0
- package/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.ts +84 -0
- package/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.ts +110 -0
- package/Utils/Dashboard/Components/Index.ts +14 -0
- package/Utils/Measurement/MeasurementEvaluator.ts +359 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.ts +1 -0
- package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +93 -11
- package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +231 -0
- package/Utils/SecurityEvent/GenericNormalizer.ts +208 -0
- package/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.ts +206 -0
- package/Utils/SecurityEvent/NormalizerHelpers.ts +263 -0
- package/Utils/SecurityEvent/OcsfNormalizer.ts +194 -0
- package/Utils/SecurityEvent/SecurityEventNormalizer.ts +82 -0
- package/Utils/SecurityEvent/Sigma/SigmaRuleParser.ts +579 -0
- package/Utils/SecurityEvent/UdmNormalizer.ts +442 -0
- package/Utils/Telemetry/CrossSignalScope.ts +46 -9
- package/Utils/Telemetry/LogErrorPattern.ts +350 -0
- package/build/dist/Models/AnalyticsModels/Index.js +10 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/LogCountBaseline.js +159 -0
- package/build/dist/Models/AnalyticsModels/LogCountBaseline.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/SecurityEvent.js +596 -0
- package/build/dist/Models/AnalyticsModels/SecurityEvent.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/Span.js +24 -1
- package/build/dist/Models/AnalyticsModels/Span.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/SpanCountBaseline.js +181 -0
- package/build/dist/Models/AnalyticsModels/SpanCountBaseline.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Alert.js +43 -0
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertMeasurement.js +1143 -0
- package/build/dist/Models/DatabaseModels/AlertMeasurement.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertMeasurementValue.js +523 -0
- package/build/dist/Models/DatabaseModels/AlertMeasurementValue.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +9 -2
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js +10 -11
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DetectionRule.js +598 -0
- package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +410 -0
- package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Incident.js +43 -0
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentMeasurement.js +1143 -0
- package/build/dist/Models/DatabaseModels/IncidentMeasurement.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentMeasurementValue.js +523 -0
- package/build/dist/Models/DatabaseModels/IncidentMeasurementValue.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +9 -2
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyOwnerRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +20 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Label.js +11 -0
- package/build/dist/Models/DatabaseModels/Label.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmCostBudget.js +681 -0
- package/build/dist/Models/DatabaseModels/LlmCostBudget.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmModelPrice.js +503 -0
- package/build/dist/Models/DatabaseModels/LlmModelPrice.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LogSavedView.js +87 -0
- package/build/dist/Models/DatabaseModels/LogSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +224 -8
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricSavedView.js +59 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Probe.js +21 -0
- package/build/dist/Models/DatabaseModels/Probe.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RunbookLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/RunbookLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RunbookOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/RunbookOwnerRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +1133 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +515 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +9 -2
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/StatusPageLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/StatusPageOwnerRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TableView.js +15 -0
- package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Team.js +13 -0
- package/build/dist/Models/DatabaseModels/Team.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TeamMember.js +8 -0
- package/build/dist/Models/DatabaseModels/TeamMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceSavedView.js +52 -0
- package/build/dist/Models/DatabaseModels/TraceSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowLabelRule.js +36 -0
- package/build/dist/Models/DatabaseModels/WorkflowLabelRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowOwnerRule.js +42 -0
- package/build/dist/Models/DatabaseModels/WorkflowOwnerRule.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +136 -0
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/API/UserAPI.js +75 -2
- package/build/dist/Server/API/UserAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +29 -1
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.js +36 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.js +162 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.js +52 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788600000000-AddDetectionRuleIncidentColumns.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788600000000-AddDetectionRuleIncidentColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/IdentityRateLimit.js +491 -0
- package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -0
- package/build/dist/Server/Services/AccessTokenService.js +13 -2
- package/build/dist/Server/Services/AccessTokenService.js.map +1 -1
- package/build/dist/Server/Services/AlertMeasurementService.js +250 -0
- package/build/dist/Server/Services/AlertMeasurementService.js.map +1 -0
- package/build/dist/Server/Services/AlertMeasurementValueService.js +400 -0
- package/build/dist/Server/Services/AlertMeasurementValueService.js.map +1 -0
- package/build/dist/Server/Services/AlertService.js +37 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AlertStateTimelineService.js +48 -0
- package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/DetectionRuleService.js +50 -0
- package/build/dist/Server/Services/DetectionRuleService.js.map +1 -0
- package/build/dist/Server/Services/GoogleSecOpsConnectionService.js +55 -0
- package/build/dist/Server/Services/GoogleSecOpsConnectionService.js.map +1 -0
- package/build/dist/Server/Services/IncidentMeasurementService.js +252 -0
- package/build/dist/Server/Services/IncidentMeasurementService.js.map +1 -0
- package/build/dist/Server/Services/IncidentMeasurementValueService.js +413 -0
- package/build/dist/Server/Services/IncidentMeasurementValueService.js.map +1 -0
- package/build/dist/Server/Services/IncidentService.js +41 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +50 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +30 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LlmCostBudgetService.js +89 -0
- package/build/dist/Server/Services/LlmCostBudgetService.js.map +1 -0
- package/build/dist/Server/Services/LlmModelPriceService.js +163 -0
- package/build/dist/Server/Services/LlmModelPriceService.js.map +1 -0
- package/build/dist/Server/Services/LogAggregationService.js +709 -0
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/LogCountBaselineService.js +112 -0
- package/build/dist/Server/Services/LogCountBaselineService.js.map +1 -0
- package/build/dist/Server/Services/MutableMetricService.js +28 -9
- package/build/dist/Server/Services/MutableMetricService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceMeasurementService.js +254 -0
- package/build/dist/Server/Services/ScheduledMaintenanceMeasurementService.js.map +1 -0
- package/build/dist/Server/Services/ScheduledMaintenanceMeasurementValueService.js +434 -0
- package/build/dist/Server/Services/ScheduledMaintenanceMeasurementValueService.js.map +1 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +37 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +134 -0
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/SecurityEventService.js +64 -0
- package/build/dist/Server/Services/SecurityEventService.js.map +1 -0
- package/build/dist/Server/Services/SpanCountBaselineService.js +122 -0
- package/build/dist/Server/Services/SpanCountBaselineService.js.map +1 -0
- package/build/dist/Server/Services/StatusPageService.js +4 -3
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +15 -3
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +262 -42
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserTotpAuthService.js +0 -73
- package/build/dist/Server/Services/UserTotpAuthService.js.map +1 -1
- package/build/dist/Server/Services/UserWebAuthnService.js +1 -73
- package/build/dist/Server/Services/UserWebAuthnService.js.map +1 -1
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +13 -0
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +10 -0
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +3 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/SecurityEventTools.js +257 -0
- package/build/dist/Server/Utils/AI/Toolbox/SecurityEventTools.js.map +1 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +13 -4
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Attribution.js +77 -33
- package/build/dist/Server/Utils/Attribution.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +46 -9
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +52 -8
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +41 -17
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +42 -18
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +24 -11
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +34 -15
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -1
- package/build/dist/Server/Utils/Measurement/MeasurementDefinitionValidator.js +109 -0
- package/build/dist/Server/Utils/Measurement/MeasurementDefinitionValidator.js.map +1 -0
- package/build/dist/Server/Utils/Measurement/MeasurementMetricWriter.js +131 -0
- package/build/dist/Server/Utils/Measurement/MeasurementMetricWriter.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/CountAnomaly.js +111 -0
- package/build/dist/Server/Utils/Monitor/Criteria/CountAnomaly.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/LogMonitorCriteria.js +84 -1
- package/build/dist/Server/Utils/Monitor/Criteria/LogMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.js +35 -0
- package/build/dist/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.js +84 -1
- package/build/dist/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js +7 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +12 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +9 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +10 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +6 -5
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +600 -0
- package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js +145 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +176 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventRow.js +69 -0
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventRow.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js +493 -0
- package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js +317 -0
- package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/LlmSpan.js +56 -4
- package/build/dist/Server/Utils/Telemetry/LlmSpan.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/LogErrorPatternSql.js +112 -0
- package/build/dist/Server/Utils/Telemetry/LogErrorPatternSql.js.map +1 -0
- package/build/dist/Server/Utils/UserPermission/UserPermission.js +46 -1
- package/build/dist/Server/Utils/UserPermission/UserPermission.js.map +1 -1
- package/build/dist/Types/AI/AIChatTypes.js +1 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/Alerts/AlertMeasurementAnchorType.js +15 -0
- package/build/dist/Types/Alerts/AlertMeasurementAnchorType.js.map +1 -0
- package/build/dist/Types/Alerts/AlertStateRole.js +12 -0
- package/build/dist/Types/Alerts/AlertStateRole.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +16 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/Dashboard/Chart/ChartType.js +1 -0
- package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.js.map +1 -0
- package/build/dist/Types/Incident/IncidentMeasurementAnchorType.js +29 -0
- package/build/dist/Types/Incident/IncidentMeasurementAnchorType.js.map +1 -0
- package/build/dist/Types/Incident/IncidentStateRole.js +15 -0
- package/build/dist/Types/Incident/IncidentStateRole.js.map +1 -0
- package/build/dist/Types/Marketing/Attribution.js +68 -0
- package/build/dist/Types/Marketing/Attribution.js.map +1 -0
- package/build/dist/Types/Marketing/MarketingConversion.js +36 -7
- package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -1
- package/build/dist/Types/Measurement/MeasurementAggregationType.js +40 -0
- package/build/dist/Types/Measurement/MeasurementAggregationType.js.map +1 -0
- package/build/dist/Types/Measurement/MeasurementAnchorKind.js +22 -0
- package/build/dist/Types/Measurement/MeasurementAnchorKind.js.map +1 -0
- package/build/dist/Types/Measurement/MeasurementOccurrence.js +15 -0
- package/build/dist/Types/Measurement/MeasurementOccurrence.js.map +1 -0
- package/build/dist/Types/Measurement/MeasurementStatus.js +32 -0
- package/build/dist/Types/Measurement/MeasurementStatus.js.map +1 -0
- package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
- package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +2 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +59 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +17 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSecurityEventsMonitor.js +64 -0
- package/build/dist/Types/Monitor/MonitorStepSecurityEventsMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +19 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.js.map +1 -0
- package/build/dist/Types/Permission.js +347 -2
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.js +19 -0
- package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.js.map +1 -0
- package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.js +17 -0
- package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.js.map +1 -0
- package/build/dist/Types/SecurityEvent/DetectionFindingConstants.js +18 -0
- package/build/dist/Types/SecurityEvent/DetectionFindingConstants.js.map +1 -0
- package/build/dist/Types/SecurityEvent/NormalizedSecurityEvent.js +2 -0
- package/build/dist/Types/SecurityEvent/NormalizedSecurityEvent.js.map +1 -0
- package/build/dist/Types/SecurityEvent/OcsfEventClass.js +181 -0
- package/build/dist/Types/SecurityEvent/OcsfEventClass.js.map +1 -0
- package/build/dist/Types/SecurityEvent/OcsfSeverity.js +81 -0
- package/build/dist/Types/SecurityEvent/OcsfSeverity.js.map +1 -0
- package/build/dist/Types/SecurityEvent/SecurityEventFormat.js +21 -0
- package/build/dist/Types/SecurityEvent/SecurityEventFormat.js.map +1 -0
- package/build/dist/Types/SecurityEvent/SigmaRule.js +16 -0
- package/build/dist/Types/SecurityEvent/SigmaRule.js.map +1 -0
- package/build/dist/Types/Telemetry/LlmConventions.js +19 -1
- package/build/dist/Types/Telemetry/LlmConventions.js.map +1 -1
- package/build/dist/Types/Telemetry/LlmCostCatalog.js +484 -0
- package/build/dist/Types/Telemetry/LlmCostCatalog.js.map +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetryRetentionConfig.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
- package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
- package/build/dist/Types/TwoFactorAuthStatus.js +41 -0
- package/build/dist/Types/TwoFactorAuthStatus.js.map +1 -0
- package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js +16 -2
- package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +15 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkOwnerActions.js +20 -1
- package/build/dist/UI/Components/BulkUpdate/BulkOwnerActions.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +22 -1
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +1 -1
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +14 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js +47 -0
- package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js.map +1 -1
- package/build/dist/UI/Components/DuplicateModel/DuplicateModel.js +8 -0
- package/build/dist/UI/Components/DuplicateModel/DuplicateModel.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +40 -1
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/List/ListRow.js +4 -1
- package/build/dist/UI/Components/List/ListRow.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +32 -7
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +2 -17
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js +93 -4
- package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Components/ModelDelete/ModelDelete.js +13 -0
- package/build/dist/UI/Components/ModelDelete/ModelDelete.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +27 -11
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelList/ModelList.js +13 -2
- package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
- package/build/dist/UI/Components/ModelList/StaticModelList.js +4 -1
- package/build/dist/UI/Components/ModelList/StaticModelList.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +101 -40
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ModelTable.js +9 -7
- package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/TableView.js +32 -4
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +19 -2
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
- package/build/dist/UI/Components/OrderedStatesList/Item.js +4 -1
- package/build/dist/UI/Components/OrderedStatesList/Item.js.map +1 -1
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js +33 -32
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js.map +1 -1
- package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js +8 -0
- package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js.map +1 -1
- package/build/dist/UI/Components/SavedViews/SavedViewsFacetSection.js +98 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsFacetSection.js.map +1 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsList.js +99 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsList.js.map +1 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsSearchInput.js +17 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsSearchInput.js.map +1 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsShowMoreButton.js +15 -0
- package/build/dist/UI/Components/SavedViews/SavedViewsShowMoreButton.js.map +1 -0
- package/build/dist/UI/Components/Table/TableRow.js +8 -2
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +93 -4
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Types/UseComponentOutsideClick.js +39 -0
- package/build/dist/UI/Types/UseComponentOutsideClick.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +164 -0
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.js +70 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.js +92 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +8 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/Measurement/MeasurementEvaluator.js +210 -0
- package/build/dist/Utils/Measurement/MeasurementEvaluator.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorSummarySnapshotUtil.js +1 -0
- package/build/dist/Utils/Monitor/MonitorSummarySnapshotUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +51 -10
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +108 -0
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/GenericNormalizer.js +176 -0
- package/build/dist/Utils/SecurityEvent/GenericNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js +146 -0
- package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/NormalizerHelpers.js +196 -0
- package/build/dist/Utils/SecurityEvent/NormalizerHelpers.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/OcsfNormalizer.js +136 -0
- package/build/dist/Utils/SecurityEvent/OcsfNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/SecurityEventNormalizer.js +64 -0
- package/build/dist/Utils/SecurityEvent/SecurityEventNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +388 -0
- package/build/dist/Utils/SecurityEvent/Sigma/SigmaRuleParser.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/UdmNormalizer.js +328 -0
- package/build/dist/Utils/SecurityEvent/UdmNormalizer.js.map +1 -0
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +29 -7
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
- package/build/dist/Utils/Telemetry/LogErrorPattern.js +284 -0
- package/build/dist/Utils/Telemetry/LogErrorPattern.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Error-message clustering for the Logs Insights surface.
|
|
3
|
+
*
|
|
4
|
+
* "30 x connection refused" is only a useful headline if the thirty raw
|
|
5
|
+
* bodies — each carrying its own timestamp, request id, port and latency —
|
|
6
|
+
* collapse onto one row. That collapse is a normalization: every span of
|
|
7
|
+
* text that varies per occurrence is rewritten to a placeholder, and what
|
|
8
|
+
* remains is the pattern the occurrences share.
|
|
9
|
+
*
|
|
10
|
+
* The rule table below is the single source of truth for that rewrite. It
|
|
11
|
+
* is consumed twice:
|
|
12
|
+
*
|
|
13
|
+
* - by `normalizeLogBodyToErrorPattern` here, in plain JavaScript, for
|
|
14
|
+
* client-side previews and for the test suite; and
|
|
15
|
+
* - by Common/Server/Utils/Telemetry/LogErrorPatternSql, which compiles
|
|
16
|
+
* the same rules into a nest of ClickHouse `replaceRegexpAll` calls so
|
|
17
|
+
* the GROUP BY happens in the database over the whole window rather
|
|
18
|
+
* than over a sampled page of rows.
|
|
19
|
+
*
|
|
20
|
+
* Because both readers share this table they cannot drift apart, and every
|
|
21
|
+
* pattern here is therefore restricted to the syntax BOTH engines accept:
|
|
22
|
+
* RE2 (ClickHouse) has no lookaround and no backreferences, so rules use
|
|
23
|
+
* only character classes, quantifiers, alternation and `\b`.
|
|
24
|
+
*
|
|
25
|
+
* Rule ORDER is part of the contract — rules apply in sequence, each over
|
|
26
|
+
* the output of the last:
|
|
27
|
+
*
|
|
28
|
+
* 1. timestamps first, because their digits and dashes would otherwise be
|
|
29
|
+
* shredded by the numeric rule into an unrecognizable shape;
|
|
30
|
+
* 2. URLs before emails and IPs, so `https://user@10.0.0.1/x` collapses
|
|
31
|
+
* to one `<url>` instead of three overlapping placeholders;
|
|
32
|
+
* 3. long hex runs before numbers, so a trace id stays one token;
|
|
33
|
+
* 4. numbers last of the value rules, as the catch-all;
|
|
34
|
+
* 5. whitespace collapse at the end, which is also what flattens a
|
|
35
|
+
* multi-line stack trace into a single groupable line.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
export interface LogErrorPatternRule {
|
|
39
|
+
/** Stable identifier — used by tests and by the SQL compiler's comments. */
|
|
40
|
+
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* Regular expression source accepted by BOTH the JavaScript engine and
|
|
43
|
+
* RE2. Applied globally (every match is replaced).
|
|
44
|
+
*/
|
|
45
|
+
pattern: string;
|
|
46
|
+
/** Literal replacement text. Never contains `$` or `\` — see below. */
|
|
47
|
+
replacement: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The normalization rules, in application order. See the file header for
|
|
52
|
+
* why the order matters.
|
|
53
|
+
*
|
|
54
|
+
* Replacements are deliberately plain literals: `String.replace` treats
|
|
55
|
+
* `$&`/`$1` in a replacement specially and ClickHouse treats `\1`
|
|
56
|
+
* specially, so keeping them free of both characters means the two engines
|
|
57
|
+
* substitute identical text.
|
|
58
|
+
*/
|
|
59
|
+
export const LOG_ERROR_PATTERN_RULES: Array<LogErrorPatternRule> = [
|
|
60
|
+
{
|
|
61
|
+
name: "timestamp",
|
|
62
|
+
pattern:
|
|
63
|
+
"\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:?\\d{2})?",
|
|
64
|
+
replacement: "<timestamp>",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "uuid",
|
|
68
|
+
pattern:
|
|
69
|
+
"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}",
|
|
70
|
+
replacement: "<uuid>",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
/*
|
|
74
|
+
* Before `email` and `ip`: a URL can contain both, and the whole URL is
|
|
75
|
+
* the varying part.
|
|
76
|
+
*/
|
|
77
|
+
name: "url",
|
|
78
|
+
pattern: "[a-zA-Z][a-zA-Z0-9+.-]*://[^\\s\"'<>]+",
|
|
79
|
+
replacement: "<url>",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "email",
|
|
83
|
+
pattern: "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}",
|
|
84
|
+
replacement: "<email>",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "ip",
|
|
88
|
+
pattern: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}",
|
|
89
|
+
replacement: "<ip>",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
/*
|
|
93
|
+
* Trace ids, span ids, content hashes, object ids. 16 is the shortest
|
|
94
|
+
* run this fires on so ordinary hex-looking words ("deadbeef", "cafe")
|
|
95
|
+
* survive as themselves.
|
|
96
|
+
*/
|
|
97
|
+
name: "hex",
|
|
98
|
+
pattern: "\\b[0-9a-fA-F]{16,}\\b",
|
|
99
|
+
replacement: "<hex>",
|
|
100
|
+
},
|
|
101
|
+
/*
|
|
102
|
+
* DELIBERATELY NO "mask any quoted span" RULE HERE.
|
|
103
|
+
*
|
|
104
|
+
* A `"[^"]*"` -> `"<str>"` rule looks reasonable on prose like
|
|
105
|
+
* `unknown field "customerRef"`, and it is catastrophic on structured
|
|
106
|
+
* logs. In JSON and logfmt — the two commonest shapes there are — the
|
|
107
|
+
* human-readable message IS a quoted value, so such a rule masks the only
|
|
108
|
+
* part that identifies the error:
|
|
109
|
+
*
|
|
110
|
+
* {"level":"error","msg":"connection refused","attempt":3}
|
|
111
|
+
* {"level":"error","msg":"permission denied","attempt":3}
|
|
112
|
+
*
|
|
113
|
+
* would both collapse to `{"<str>":"<str>","<str>":"<str>","<str>":<num>}`,
|
|
114
|
+
* summing two unrelated failures into one Top Errors row headed by
|
|
115
|
+
* whichever sample body argMax happened to pick.
|
|
116
|
+
*
|
|
117
|
+
* Nothing is lost by leaving it out: every quoted span that genuinely
|
|
118
|
+
* VARIES is a uuid, number, ip, url, timestamp, hex id or email, and the
|
|
119
|
+
* rules above already mask those — more informatively, since `"<uuid>"`
|
|
120
|
+
* says more than `"<str>"`. All such a rule uniquely added was collapsing
|
|
121
|
+
* quoted WORDS, which is exactly the destructive case. Two different
|
|
122
|
+
* quoted field names therefore stay two rows: under-collapsing is the
|
|
123
|
+
* safe direction, because a split incident is still visible while a
|
|
124
|
+
* merged one is hidden.
|
|
125
|
+
*/
|
|
126
|
+
{
|
|
127
|
+
name: "number",
|
|
128
|
+
pattern: "\\d+(\\.\\d+)?",
|
|
129
|
+
replacement: "<num>",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
/*
|
|
133
|
+
* Last: collapses the newlines and indentation of a stack trace onto
|
|
134
|
+
* one line so the truncation below keeps the exception type and the
|
|
135
|
+
* top frames — the part that identifies the error.
|
|
136
|
+
*/
|
|
137
|
+
name: "whitespace",
|
|
138
|
+
pattern: "\\s+",
|
|
139
|
+
replacement: " ",
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Longest pattern kept, in characters.
|
|
145
|
+
*
|
|
146
|
+
* A stack trace normalizes to a very long single line; grouping on the
|
|
147
|
+
* whole thing would split occurrences whose tails differ (different frame
|
|
148
|
+
* counts, different truncation by the emitting library) while adding
|
|
149
|
+
* nothing to what identifies the error. 300 characters comfortably covers
|
|
150
|
+
* an exception type plus its first frames.
|
|
151
|
+
*/
|
|
152
|
+
export const LOG_ERROR_PATTERN_MAX_LENGTH: number = 300;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The placeholders the rules can emit. Exported so consumers (the deep-link
|
|
156
|
+
* builder below, the UI's pattern renderer) can recognize the variable
|
|
157
|
+
* spans without re-deriving them from the rule table.
|
|
158
|
+
*/
|
|
159
|
+
export const LOG_ERROR_PATTERN_PLACEHOLDERS: Array<string> =
|
|
160
|
+
LOG_ERROR_PATTERN_RULES.filter((rule: LogErrorPatternRule): boolean => {
|
|
161
|
+
return rule.replacement.startsWith("<") && rule.replacement.endsWith(">");
|
|
162
|
+
}).map((rule: LogErrorPatternRule): string => {
|
|
163
|
+
return rule.replacement;
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
/*
|
|
167
|
+
* Any placeholder token, for splitting a pattern back into its literal
|
|
168
|
+
* spans. Matches the shape every rule's replacement uses rather than being
|
|
169
|
+
* built from the table itself, so a rule added later is understood here
|
|
170
|
+
* without a second edit.
|
|
171
|
+
*/
|
|
172
|
+
const PLACEHOLDER_TOKEN: RegExp = /<[a-z]+>/g;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Collapse one raw log body to its error pattern.
|
|
176
|
+
*
|
|
177
|
+
* Non-string input (a log row can arrive with a null/absent body) yields
|
|
178
|
+
* the empty string rather than throwing, because this runs over rows the
|
|
179
|
+
* caller did not construct.
|
|
180
|
+
*/
|
|
181
|
+
export function normalizeLogBodyToErrorPattern(
|
|
182
|
+
body: string | undefined | null,
|
|
183
|
+
): string {
|
|
184
|
+
if (typeof body !== "string" || body.length === 0) {
|
|
185
|
+
return "";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let normalized: string = body;
|
|
189
|
+
|
|
190
|
+
for (const rule of LOG_ERROR_PATTERN_RULES) {
|
|
191
|
+
/*
|
|
192
|
+
* A replacer function rather than the literal string: it makes the `$`
|
|
193
|
+
* substitution rules of String.replace unreachable, so the replacement
|
|
194
|
+
* text is inserted verbatim exactly as ClickHouse inserts it.
|
|
195
|
+
*/
|
|
196
|
+
normalized = normalized.replace(
|
|
197
|
+
new RegExp(rule.pattern, "g"),
|
|
198
|
+
(): string => {
|
|
199
|
+
return rule.replacement;
|
|
200
|
+
},
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
normalized = normalized.trim();
|
|
205
|
+
|
|
206
|
+
if (normalized.length > LOG_ERROR_PATTERN_MAX_LENGTH) {
|
|
207
|
+
normalized = normalized.slice(0, LOG_ERROR_PATTERN_MAX_LENGTH).trim();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return normalized;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface ErrorPatternSearchTextOptions {
|
|
214
|
+
/** Literal runs shorter than this are not selective enough to be useful. */
|
|
215
|
+
minimumLength?: number | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* A real body from the group, when the caller has one. Used to CHECK a
|
|
218
|
+
* candidate rather than to produce it — see below.
|
|
219
|
+
*/
|
|
220
|
+
sampleBody?: string | undefined;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/*
|
|
224
|
+
* Leading punctuation a placeholder leaves behind — `to <ip>:<num>` splits
|
|
225
|
+
* into `to ` and `:` — so the search text comes out as words, not as the
|
|
226
|
+
* glue between them.
|
|
227
|
+
*/
|
|
228
|
+
const LEADING_GLUE: RegExp = /^[\s"':,;=([{]+/;
|
|
229
|
+
|
|
230
|
+
/*
|
|
231
|
+
* Named rather than inlined at the use sites: an inline literal used as
|
|
232
|
+
* `/\s/.test(x)` trips eslint's wrap-regex, whose fix prettier then undoes
|
|
233
|
+
* (the same fight CrossSignalScope documents).
|
|
234
|
+
*/
|
|
235
|
+
const ANY_WHITESPACE: RegExp = /\s/;
|
|
236
|
+
const WHITESPACE_RUN: RegExp = /\s+/;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* A literal run from the pattern that can be handed to a substring search.
|
|
240
|
+
*
|
|
241
|
+
* This is what turns "Insights says this happened 30 times" into a Logs
|
|
242
|
+
* viewer deep link that actually lists those 30 rows: the viewer filters
|
|
243
|
+
* `body` with a contains-match, which a pattern containing `<num>` would
|
|
244
|
+
* never satisfy.
|
|
245
|
+
*
|
|
246
|
+
* The subtlety is that a pattern is NOT a substring of the body it came
|
|
247
|
+
* from, even between placeholders. The last normalization rule collapses
|
|
248
|
+
* `\s+` to a single space, so any run spanning a line break in the original
|
|
249
|
+
* — every stack trace — reads `is null at com.example.Service.process(` in
|
|
250
|
+
* the pattern where the body has `is null\n\tat com.example...`. Handing
|
|
251
|
+
* that to `body ILIKE '%...%'` matches nothing, landing the user on an
|
|
252
|
+
* empty list: the precise failure this function exists to avoid.
|
|
253
|
+
*
|
|
254
|
+
* So the candidates are ranked longest-first and the first SAFE one wins:
|
|
255
|
+
*
|
|
256
|
+
* - a whitespace-free token is always safe, because there was no
|
|
257
|
+
* whitespace inside it to collapse;
|
|
258
|
+
* - a longer multi-word run is used only when `sampleBody` proves it
|
|
259
|
+
* survived the collapse verbatim.
|
|
260
|
+
*
|
|
261
|
+
* Returns "" when nothing usable survives (an all-placeholder pattern, or
|
|
262
|
+
* runs too short to be selective), which callers read as "no body filter"
|
|
263
|
+
* rather than as a filter matching everything.
|
|
264
|
+
*/
|
|
265
|
+
export function getErrorPatternSearchText(
|
|
266
|
+
pattern: string | undefined | null,
|
|
267
|
+
options: ErrorPatternSearchTextOptions | number = {},
|
|
268
|
+
): string {
|
|
269
|
+
/*
|
|
270
|
+
* Number form kept for the original `(pattern, minimumLength)` callers.
|
|
271
|
+
*/
|
|
272
|
+
const resolved: ErrorPatternSearchTextOptions =
|
|
273
|
+
typeof options === "number" ? { minimumLength: options } : options;
|
|
274
|
+
|
|
275
|
+
const minimumLength: number = resolved.minimumLength ?? 4;
|
|
276
|
+
const sampleBody: string =
|
|
277
|
+
typeof resolved.sampleBody === "string" ? resolved.sampleBody : "";
|
|
278
|
+
|
|
279
|
+
if (typeof pattern !== "string" || pattern.length === 0) {
|
|
280
|
+
return "";
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const candidates: Array<string> = [];
|
|
284
|
+
|
|
285
|
+
for (const segment of pattern.split(PLACEHOLDER_TOKEN)) {
|
|
286
|
+
const run: string = segment.replace(LEADING_GLUE, "").trim();
|
|
287
|
+
|
|
288
|
+
if (run.length > 0) {
|
|
289
|
+
// The multi-word run: strongest, but only safe when verified.
|
|
290
|
+
candidates.push(run);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/*
|
|
294
|
+
* ...and every whitespace-free token inside it, which needs no
|
|
295
|
+
* verification at all.
|
|
296
|
+
*/
|
|
297
|
+
for (const token of segment.split(WHITESPACE_RUN)) {
|
|
298
|
+
const trimmed: string = token.replace(LEADING_GLUE, "").trim();
|
|
299
|
+
|
|
300
|
+
if (trimmed.length > 0) {
|
|
301
|
+
candidates.push(trimmed);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
candidates.sort((a: string, b: string): number => {
|
|
307
|
+
return b.length - a.length;
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
for (const candidate of candidates) {
|
|
311
|
+
if (candidate.length < minimumLength) {
|
|
312
|
+
// Sorted longest-first, so everything after this is too short too.
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const isSingleToken: boolean = !ANY_WHITESPACE.test(candidate);
|
|
317
|
+
|
|
318
|
+
if (isSingleToken) {
|
|
319
|
+
return candidate;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (sampleBody.length > 0 && sampleBody.includes(candidate)) {
|
|
323
|
+
return candidate;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return "";
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* A short, single-line label for a pattern, for list rows and chips.
|
|
332
|
+
* Truncation is by characters with an ellipsis; the full pattern stays
|
|
333
|
+
* available for tooltips and for the detail panel.
|
|
334
|
+
*/
|
|
335
|
+
export function truncateErrorPattern(
|
|
336
|
+
pattern: string | undefined | null,
|
|
337
|
+
maxLength: number,
|
|
338
|
+
): string {
|
|
339
|
+
if (typeof pattern !== "string") {
|
|
340
|
+
return "";
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const collapsed: string = pattern.replace(/\s+/g, " ").trim();
|
|
344
|
+
|
|
345
|
+
if (maxLength <= 0 || collapsed.length <= maxLength) {
|
|
346
|
+
return collapsed;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return `${collapsed.slice(0, maxLength).trim()}...`;
|
|
350
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Log from "./Log";
|
|
2
|
+
import SecurityEvent from "./SecurityEvent";
|
|
2
3
|
import Metric from "./Metric";
|
|
3
4
|
import MetricItemAggMV1m from "./MetricItemAggMV1m";
|
|
4
5
|
import MetricItemAggMV1mByHostV2 from "./MetricItemAggMV1mByHostV2";
|
|
@@ -6,6 +7,8 @@ import MetricItemAggMV1mByService from "./MetricItemAggMV1mByService";
|
|
|
6
7
|
import MetricItemAggMV1mByK8sCluster from "./MetricItemAggMV1mByK8sCluster";
|
|
7
8
|
import MetricItemAggMV1mByContainer from "./MetricItemAggMV1mByContainer";
|
|
8
9
|
import MetricBaselineHourly from "./MetricBaselineHourly";
|
|
10
|
+
import SpanCountBaseline from "./SpanCountBaseline";
|
|
11
|
+
import LogCountBaseline from "./LogCountBaseline";
|
|
9
12
|
import SloHistory from "./SloHistory";
|
|
10
13
|
import Span from "./Span";
|
|
11
14
|
import ExceptionInstance from "./ExceptionInstance";
|
|
@@ -41,6 +44,12 @@ const AnalyticsModels = [
|
|
|
41
44
|
MetricItemAggMV1mByK8sCluster,
|
|
42
45
|
MetricItemAggMV1mByContainer,
|
|
43
46
|
MetricBaselineHourly,
|
|
47
|
+
/*
|
|
48
|
+
* Hour-of-week volume baselines for span/log count anomaly criteria.
|
|
49
|
+
* AggregatingMergeTree targets populated by MVs on Span/Log inserts.
|
|
50
|
+
*/
|
|
51
|
+
SpanCountBaseline,
|
|
52
|
+
LogCountBaseline,
|
|
44
53
|
SloHistory,
|
|
45
54
|
ExceptionInstance,
|
|
46
55
|
MonitorLog,
|
|
@@ -57,6 +66,7 @@ const AnalyticsModels = [
|
|
|
57
66
|
RumSession,
|
|
58
67
|
RumSessionChunk,
|
|
59
68
|
AuditLog,
|
|
69
|
+
SecurityEvent,
|
|
60
70
|
];
|
|
61
71
|
const modelTypeMap = {};
|
|
62
72
|
export const getModelTypeByName = (tableName) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../../../Models/AnalyticsModels/Index.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AACtE,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAC5E,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,eAAe,GAA0C;IAC7D,GAAG;IACH,IAAI;IACJ,MAAM;IACN;;;OAGG;IACH,iBAAiB;IACjB;;;;OAIG;IACH,yBAAyB;IACzB;;;;OAIG;IACH,0BAA0B;IAC1B,6BAA6B;IAC7B,4BAA4B;IAC5B,oBAAoB;IACpB,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,wBAAwB;IACxB,OAAO;IACP,aAAa;IACb;;;;;OAKG;IACH,UAAU;IACV,eAAe;IACf,QAAQ;
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../../../Models/AnalyticsModels/Index.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AACtE,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAC5E,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,eAAe,GAA0C;IAC7D,GAAG;IACH,IAAI;IACJ,MAAM;IACN;;;OAGG;IACH,iBAAiB;IACjB;;;;OAIG;IACH,yBAAyB;IACzB;;;;OAIG;IACH,0BAA0B;IAC1B,6BAA6B;IAC7B,4BAA4B;IAC5B,oBAAoB;IACpB;;;OAGG;IACH,iBAAiB;IACjB,gBAAgB;IAChB,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,wBAAwB;IACxB,OAAO;IACP,aAAa;IACb;;;;;OAKG;IACH,UAAU;IACV,eAAe;IACf,QAAQ;IACR,aAAa;CACd,CAAC;AAEF,MAAM,YAAY,GAAsD,EAAE,CAAC;AAM3E,MAAM,CAAC,MAAM,kBAAkB,GAAuB,CACpD,SAAiB,EACsB,EAAE;IACzC,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,OAAO,YAAY,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IACzC,CAAC;IAED,MAAM,SAAS,GACb,eAAe,CAAC,IAAI,CAAC,CAAC,SAAyC,EAAE,EAAE;QACjE,OAAO,IAAI,SAAS,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC;IACjD,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAEpC,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
|
2
|
+
import AnalyticsTableEngine from "../../Types/AnalyticsDatabase/AnalyticsTableEngine";
|
|
3
|
+
import AnalyticsTableName from "../../Types/AnalyticsDatabase/AnalyticsTableName";
|
|
4
|
+
import AnalyticsTableColumn from "../../Types/AnalyticsDatabase/TableColumn";
|
|
5
|
+
import TableColumnType from "../../Types/AnalyticsDatabase/TableColumnType";
|
|
6
|
+
/**
|
|
7
|
+
* Per-(day, hour-of-week, minute-of-hour) log-volume baseline —
|
|
8
|
+
* backbone of log-count anomaly detection for Logs monitors. Peer of
|
|
9
|
+
* `SpanCountBaseline` (see that model for the full rationale on the
|
|
10
|
+
* minute-of-hour sub-bucket, cold start and read semantics) and of
|
|
11
|
+
* `MetricBaselineHourly` for count-shaped telemetry.
|
|
12
|
+
*
|
|
13
|
+
* Populated by `LogCountBaseline_mv`, which fires on every insert into
|
|
14
|
+
* `LogItemV3` and groups by `(projectId, primaryEntityId, severityText,
|
|
15
|
+
* day, hourOfWeek, minuteOfHour)`. Each row holds a single
|
|
16
|
+
* AggregateFunction(count) state — finalize via `countMerge()`.
|
|
17
|
+
*
|
|
18
|
+
* `severityText` is part of the key so a monitor scoped to Error/Fatal
|
|
19
|
+
* logs baselines error volume only — not total log traffic. Read-side
|
|
20
|
+
* queries that don't filter on it merge across the values.
|
|
21
|
+
*
|
|
22
|
+
* Read access goes through `LogCountBaselineService`. No CRUD API is
|
|
23
|
+
* exposed; this is read-only baseline storage.
|
|
24
|
+
*/
|
|
25
|
+
export default class LogCountBaseline extends AnalyticsBaseModel {
|
|
26
|
+
constructor() {
|
|
27
|
+
const projectIdColumn = new AnalyticsTableColumn({
|
|
28
|
+
key: "projectId",
|
|
29
|
+
title: "Project ID",
|
|
30
|
+
description: "ID of project (tenant key, replicated from LogItemV3)",
|
|
31
|
+
required: true,
|
|
32
|
+
type: TableColumnType.Text,
|
|
33
|
+
isTenantId: true,
|
|
34
|
+
});
|
|
35
|
+
const primaryEntityIdColumn = new AnalyticsTableColumn({
|
|
36
|
+
key: "primaryEntityId",
|
|
37
|
+
title: "Service ID",
|
|
38
|
+
description: "Telemetry service the logs belong to (replicated from LogItemV3)",
|
|
39
|
+
required: true,
|
|
40
|
+
type: TableColumnType.Text,
|
|
41
|
+
});
|
|
42
|
+
const severityTextColumn = new AnalyticsTableColumn({
|
|
43
|
+
key: "severityText",
|
|
44
|
+
title: "Severity Text",
|
|
45
|
+
description: "Log severity (Information, Error, ...). In the key so error-scoped monitors baseline error volume only.",
|
|
46
|
+
required: true,
|
|
47
|
+
type: TableColumnType.Text,
|
|
48
|
+
isLowCardinality: true,
|
|
49
|
+
});
|
|
50
|
+
const dayColumn = new AnalyticsTableColumn({
|
|
51
|
+
key: "day",
|
|
52
|
+
title: "Day",
|
|
53
|
+
description: "Calendar day this row aggregates (toDate(time)). Drives the table TTL of 90 days.",
|
|
54
|
+
required: true,
|
|
55
|
+
type: TableColumnType.Date,
|
|
56
|
+
});
|
|
57
|
+
const hourOfWeekColumn = new AnalyticsTableColumn({
|
|
58
|
+
key: "hourOfWeek",
|
|
59
|
+
title: "Hour Of Week",
|
|
60
|
+
description: "(toDayOfWeek(time, 1) - 1) * 24 + toHour(time). Range 0..167 with Mon 00:00 = 0.",
|
|
61
|
+
required: true,
|
|
62
|
+
type: TableColumnType.UInt8,
|
|
63
|
+
});
|
|
64
|
+
const minuteOfHourColumn = new AnalyticsTableColumn({
|
|
65
|
+
key: "minuteOfHour",
|
|
66
|
+
title: "Minute Of Hour",
|
|
67
|
+
description: "toMinute(time), 0..59. One cell per minute — a per-minute log count is the baseline's raw sample.",
|
|
68
|
+
required: true,
|
|
69
|
+
type: TableColumnType.UInt8,
|
|
70
|
+
});
|
|
71
|
+
const logCountStateColumn = new AnalyticsTableColumn({
|
|
72
|
+
key: "logCountState",
|
|
73
|
+
title: "Log Count (state)",
|
|
74
|
+
description: "AggregateFunction(count) state — logs in this minute cell. Read via countMerge(logCountState).",
|
|
75
|
+
required: true,
|
|
76
|
+
type: TableColumnType.AggregateFunction,
|
|
77
|
+
aggregateFunctionDefinition: "count",
|
|
78
|
+
});
|
|
79
|
+
super({
|
|
80
|
+
tableName: AnalyticsTableName.LogCountBaseline,
|
|
81
|
+
tableEngine: AnalyticsTableEngine.AggregatingMergeTree,
|
|
82
|
+
singularName: "Log Count Baseline",
|
|
83
|
+
pluralName: "Log Count Baselines",
|
|
84
|
+
tableColumns: [
|
|
85
|
+
projectIdColumn,
|
|
86
|
+
primaryEntityIdColumn,
|
|
87
|
+
severityTextColumn,
|
|
88
|
+
dayColumn,
|
|
89
|
+
hourOfWeekColumn,
|
|
90
|
+
minuteOfHourColumn,
|
|
91
|
+
logCountStateColumn,
|
|
92
|
+
],
|
|
93
|
+
projections: [],
|
|
94
|
+
/*
|
|
95
|
+
* Baseline materialized view. Canonical definition applied
|
|
96
|
+
* idempotently by the analytics schema-sync on every boot (see
|
|
97
|
+
* AnalyticsTableManagement.createMaterializedViews), so a
|
|
98
|
+
* wiped/recreated ClickHouse volume self-heals. Counts each log
|
|
99
|
+
* into its (day, hour-of-week, minute-of-hour, severity) cell.
|
|
100
|
+
*/
|
|
101
|
+
materializedViews: [
|
|
102
|
+
{
|
|
103
|
+
name: "LogCountBaseline_mv",
|
|
104
|
+
query: `CREATE MATERIALIZED VIEW IF NOT EXISTS LogCountBaseline_mv
|
|
105
|
+
TO LogCountBaseline
|
|
106
|
+
AS
|
|
107
|
+
SELECT
|
|
108
|
+
projectId,
|
|
109
|
+
primaryEntityId,
|
|
110
|
+
severityText,
|
|
111
|
+
toDate(time) AS day,
|
|
112
|
+
toUInt8((toDayOfWeek(time, 1) - 1) * 24 + toHour(time)) AS hourOfWeek,
|
|
113
|
+
toUInt8(toMinute(time)) AS minuteOfHour,
|
|
114
|
+
countState() AS logCountState
|
|
115
|
+
FROM LogItemV3
|
|
116
|
+
GROUP BY projectId, primaryEntityId, severityText, day, hourOfWeek, minuteOfHour`,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
/*
|
|
120
|
+
* Sort key prefix matches the read-side WHERE clause of
|
|
121
|
+
* LogCountBaselineService.getBaseline (project → service →
|
|
122
|
+
* hourOfWeek → day range) so lookups touch a tight granule range.
|
|
123
|
+
* severityText sits last: most reads merge across it.
|
|
124
|
+
*/
|
|
125
|
+
sortKeys: [
|
|
126
|
+
"projectId",
|
|
127
|
+
"primaryEntityId",
|
|
128
|
+
"hourOfWeek",
|
|
129
|
+
"day",
|
|
130
|
+
"minuteOfHour",
|
|
131
|
+
"severityText",
|
|
132
|
+
],
|
|
133
|
+
primaryKeys: [
|
|
134
|
+
"projectId",
|
|
135
|
+
"primaryEntityId",
|
|
136
|
+
"hourOfWeek",
|
|
137
|
+
"day",
|
|
138
|
+
"minuteOfHour",
|
|
139
|
+
"severityText",
|
|
140
|
+
],
|
|
141
|
+
partitionKey: "toYYYYMM(day)",
|
|
142
|
+
/*
|
|
143
|
+
* Shard by (project, service) so each service's baseline states
|
|
144
|
+
* stay on a single shard and countMerge folds locally.
|
|
145
|
+
*/
|
|
146
|
+
shardingKey: "cityHash64(projectId, primaryEntityId)",
|
|
147
|
+
tableSettings: "ttl_only_drop_parts = 1, non_replicated_deduplication_window = 10000",
|
|
148
|
+
/*
|
|
149
|
+
* Locked to MetricBaselineService.MAX_WINDOW_DAYS (90) — the
|
|
150
|
+
* longest baseline window the criteria form offers. Bump both
|
|
151
|
+
* together or reads will silently truncate caller intent.
|
|
152
|
+
*/
|
|
153
|
+
ttlExpression: "day + INTERVAL 90 DAY",
|
|
154
|
+
includeBaseColumns: false,
|
|
155
|
+
defaultSortColumn: "day",
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=LogCountBaseline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogCountBaseline.js","sourceRoot":"","sources":["../../../../Models/AnalyticsModels/LogCountBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,oBAAoB,MAAM,oDAAoD,CAAC;AACtF,OAAO,kBAAkB,MAAM,kDAAkD,CAAC;AAClF,OAAO,oBAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,eAAe,MAAM,+CAA+C,CAAC;AAE5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,kBAAkB;IAC9D;QACE,MAAM,eAAe,GAAyB,IAAI,oBAAoB,CAAC;YACrE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,IAAI;YAC1B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,MAAM,qBAAqB,GACzB,IAAI,oBAAoB,CAAC;YACvB,GAAG,EAAE,iBAAiB;YACtB,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,IAAI;SAC3B,CAAC,CAAC;QAEL,MAAM,kBAAkB,GAAyB,IAAI,oBAAoB,CAAC;YACxE,GAAG,EAAE,cAAc;YACnB,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,yGAAyG;YAC3G,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,IAAI;YAC1B,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QAEH,MAAM,SAAS,GAAyB,IAAI,oBAAoB,CAAC;YAC/D,GAAG,EAAE,KAAK;YACV,KAAK,EAAE,KAAK;YACZ,WAAW,EACT,mFAAmF;YACrF,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,IAAI;SAC3B,CAAC,CAAC;QAEH,MAAM,gBAAgB,GAAyB,IAAI,oBAAoB,CAAC;YACtE,GAAG,EAAE,YAAY;YACjB,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,kFAAkF;YACpF,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,KAAK;SAC5B,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAyB,IAAI,oBAAoB,CAAC;YACxE,GAAG,EAAE,cAAc;YACnB,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,mGAAmG;YACrG,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,KAAK;SAC5B,CAAC,CAAC;QAEH,MAAM,mBAAmB,GAAyB,IAAI,oBAAoB,CAAC;YACzE,GAAG,EAAE,eAAe;YACpB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,gGAAgG;YAClG,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,eAAe,CAAC,iBAAiB;YACvC,2BAA2B,EAAE,OAAO;SACrC,CAAC,CAAC;QAEH,KAAK,CAAC;YACJ,SAAS,EAAE,kBAAkB,CAAC,gBAAgB;YAC9C,WAAW,EAAE,oBAAoB,CAAC,oBAAoB;YACtD,YAAY,EAAE,oBAAoB;YAClC,UAAU,EAAE,qBAAqB;YACjC,YAAY,EAAE;gBACZ,eAAe;gBACf,qBAAqB;gBACrB,kBAAkB;gBAClB,SAAS;gBACT,gBAAgB;gBAChB,kBAAkB;gBAClB,mBAAmB;aACpB;YACD,WAAW,EAAE,EAAE;YACf;;;;;;eAMG;YACH,iBAAiB,EAAE;gBACjB;oBACE,IAAI,EAAE,qBAAqB;oBAC3B,KAAK,EAAE;;;;;;;;;;;;iFAYgE;iBACxE;aACF;YACD;;;;;eAKG;YACH,QAAQ,EAAE;gBACR,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,KAAK;gBACL,cAAc;gBACd,cAAc;aACf;YACD,WAAW,EAAE;gBACX,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,KAAK;gBACL,cAAc;gBACd,cAAc;aACf;YACD,YAAY,EAAE,eAAe;YAC7B;;;eAGG;YACH,WAAW,EAAE,wCAAwC;YACrD,aAAa,EACX,sEAAsE;YACxE;;;;eAIG;YACH,aAAa,EAAE,uBAAuB;YACtC,kBAAkB,EAAE,KAAK;YACzB,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;IACL,CAAC;CACF"}
|