nuxt-observe 0.0.2
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/README.md +92 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +393 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/components/ObserveActivityFeed.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue +77 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityTable.d.vue.ts +30 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue +187 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue.d.ts +30 -0
- package/dist/runtime/app/components/ObserveCan.d.vue.ts +27 -0
- package/dist/runtime/app/components/ObserveCan.vue +16 -0
- package/dist/runtime/app/components/ObserveCan.vue.d.ts +27 -0
- package/dist/runtime/app/components/ObserveErrorsTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue +105 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/ObserveHealthHero.d.vue.ts +16 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue +114 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue.d.ts +16 -0
- package/dist/runtime/app/components/ObserveJourneySearch.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue +55 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue +119 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue.d.ts +14 -0
- package/dist/runtime/app/components/ObserveLogDetail.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue +187 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.d.vue.ts +10 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue +29 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue.d.ts +10 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue +134 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue +92 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObservePeriodSelector.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue +22 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue +27 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue +49 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveServicesTable.d.vue.ts +15 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue +109 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue.d.ts +15 -0
- package/dist/runtime/app/components/ObserveStatCard.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveStatCard.vue +34 -0
- package/dist/runtime/app/components/ObserveStatCard.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.d.vue.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue +170 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue.d.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.d.vue.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue.d.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue +190 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.d.vue.ts +16 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue +199 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue.d.ts +16 -0
- package/dist/runtime/app/components/charts/chart-core.d.ts +64 -0
- package/dist/runtime/app/components/charts/chart-core.js +136 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.d.vue.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue +145 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue.d.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue +106 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.d.vue.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue +67 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue.d.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.d.vue.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue +60 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue.d.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.d.vue.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue +21 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue.d.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.d.vue.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue +63 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue.d.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.d.vue.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue +216 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue.d.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.d.vue.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue +192 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue.d.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.d.vue.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue +18 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue.d.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue +132 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.d.vue.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue +108 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue.d.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.d.vue.ts +17 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue +20 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveAbility.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveAbility.js +20 -0
- package/dist/runtime/app/composables/useObserveActivity.d.ts +22 -0
- package/dist/runtime/app/composables/useObserveActivity.js +44 -0
- package/dist/runtime/app/composables/useObserveApiKeys.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveApiKeys.js +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.js +16 -0
- package/dist/runtime/app/composables/useObserveErrors.d.ts +33 -0
- package/dist/runtime/app/composables/useObserveErrors.js +85 -0
- package/dist/runtime/app/composables/useObserveGroups.d.ts +27 -0
- package/dist/runtime/app/composables/useObserveGroups.js +33 -0
- package/dist/runtime/app/composables/useObserveJourney.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveJourney.js +19 -0
- package/dist/runtime/app/composables/useObserveLogFacets.d.ts +11 -0
- package/dist/runtime/app/composables/useObserveLogFacets.js +21 -0
- package/dist/runtime/app/composables/useObserveLogs.d.ts +28 -0
- package/dist/runtime/app/composables/useObserveLogs.js +100 -0
- package/dist/runtime/app/composables/useObserveMigrations.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveMigrations.js +49 -0
- package/dist/runtime/app/composables/useObserveOverview.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveOverview.js +23 -0
- package/dist/runtime/app/composables/useObservePeriod.d.ts +11 -0
- package/dist/runtime/app/composables/useObservePeriod.js +18 -0
- package/dist/runtime/app/composables/useObserveRollout.d.ts +20 -0
- package/dist/runtime/app/composables/useObserveRollout.js +55 -0
- package/dist/runtime/app/composables/useObserveScope.d.ts +13 -0
- package/dist/runtime/app/composables/useObserveScope.js +17 -0
- package/dist/runtime/app/composables/useObserveServices.d.ts +26 -0
- package/dist/runtime/app/composables/useObserveServices.js +33 -0
- package/dist/runtime/app/composables/useObserveStats.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveStats.js +23 -0
- package/dist/runtime/app/composables/useObserveUsers.d.ts +29 -0
- package/dist/runtime/app/composables/useObserveUsers.js +33 -0
- package/dist/runtime/app/layouts/observe.d.vue.ts +13 -0
- package/dist/runtime/app/layouts/observe.vue +138 -0
- package/dist/runtime/app/layouts/observe.vue.d.ts +13 -0
- package/dist/runtime/app/middleware/observe-auth.global.d.ts +9 -0
- package/dist/runtime/app/middleware/observe-auth.global.js +8 -0
- package/dist/runtime/app/pages/activity.d.vue.ts +3 -0
- package/dist/runtime/app/pages/activity.vue +54 -0
- package/dist/runtime/app/pages/activity.vue.d.ts +3 -0
- package/dist/runtime/app/pages/error-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/error-detail.vue +190 -0
- package/dist/runtime/app/pages/error-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/errors.d.vue.ts +3 -0
- package/dist/runtime/app/pages/errors.vue +47 -0
- package/dist/runtime/app/pages/errors.vue.d.ts +3 -0
- package/dist/runtime/app/pages/journey.d.vue.ts +3 -0
- package/dist/runtime/app/pages/journey.vue +96 -0
- package/dist/runtime/app/pages/journey.vue.d.ts +3 -0
- package/dist/runtime/app/pages/log-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/log-detail.vue +35 -0
- package/dist/runtime/app/pages/log-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/login.d.vue.ts +3 -0
- package/dist/runtime/app/pages/login.vue +69 -0
- package/dist/runtime/app/pages/login.vue.d.ts +3 -0
- package/dist/runtime/app/pages/logs.d.vue.ts +3 -0
- package/dist/runtime/app/pages/logs.vue +36 -0
- package/dist/runtime/app/pages/logs.vue.d.ts +3 -0
- package/dist/runtime/app/pages/metrics.d.vue.ts +3 -0
- package/dist/runtime/app/pages/metrics.vue +68 -0
- package/dist/runtime/app/pages/metrics.vue.d.ts +3 -0
- package/dist/runtime/app/pages/overview.d.vue.ts +3 -0
- package/dist/runtime/app/pages/overview.vue +65 -0
- package/dist/runtime/app/pages/overview.vue.d.ts +3 -0
- package/dist/runtime/app/pages/rollout.d.vue.ts +3 -0
- package/dist/runtime/app/pages/rollout.vue +188 -0
- package/dist/runtime/app/pages/rollout.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.vue +149 -0
- package/dist/runtime/app/pages/settings/group-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.vue +107 -0
- package/dist/runtime/app/pages/settings/groups.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/index.vue +47 -0
- package/dist/runtime/app/pages/settings/index.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.vue +275 -0
- package/dist/runtime/app/pages/settings/migrations.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.vue +133 -0
- package/dist/runtime/app/pages/settings/service-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/services.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/services.vue +66 -0
- package/dist/runtime/app/pages/settings/services.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].vue +243 -0
- package/dist/runtime/app/pages/settings/users/[id].vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.vue +129 -0
- package/dist/runtime/app/pages/settings/users/index.vue.d.ts +3 -0
- package/dist/runtime/options.d.ts +1 -0
- package/dist/runtime/options.js +1 -0
- package/dist/runtime/server/api/observe/activity.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/activity.get.js +30 -0
- package/dist/runtime/server/api/observe/auth/login.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/login.post.js +13 -0
- package/dist/runtime/server/api/observe/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/logout.post.js +6 -0
- package/dist/runtime/server/api/observe/auth/me.get.d.ts +2 -0
- package/dist/runtime/server/api/observe/auth/me.get.js +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.js +56 -0
- package/dist/runtime/server/api/observe/errors/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/index.get.js +41 -0
- package/dist/runtime/server/api/observe/facets.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/facets.get.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.js +13 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/groups/[id].get.d.ts +6 -0
- package/dist/runtime/server/api/observe/groups/[id].get.js +14 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.js +12 -0
- package/dist/runtime/server/api/observe/groups/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.get.js +7 -0
- package/dist/runtime/server/api/observe/groups/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.post.js +11 -0
- package/dist/runtime/server/api/observe/health.get.d.ts +6 -0
- package/dist/runtime/server/api/observe/health.get.js +10 -0
- package/dist/runtime/server/api/observe/ingest/frogger.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest/frogger.js +42 -0
- package/dist/runtime/server/api/observe/ingest.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest.js +38 -0
- package/dist/runtime/server/api/observe/journey.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/journey.get.js +31 -0
- package/dist/runtime/server/api/observe/logs/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs/[id].get.js +19 -0
- package/dist/runtime/server/api/observe/logs.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs.get.js +54 -0
- package/dist/runtime/server/api/observe/migrations/index.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/migrations/index.get.js +14 -0
- package/dist/runtime/server/api/observe/migrations/run.post.d.ts +13 -0
- package/dist/runtime/server/api/observe/migrations/run.post.js +35 -0
- package/dist/runtime/server/api/observe/overview.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/overview.get.js +19 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.js +24 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.js +31 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.js +20 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.d.ts +7 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.js +10 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.d.ts +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].get.js +12 -0
- package/dist/runtime/server/api/observe/services/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].patch.js +13 -0
- package/dist/runtime/server/api/observe/services/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.get.js +7 -0
- package/dist/runtime/server/api/observe/services/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.post.js +16 -0
- package/dist/runtime/server/api/observe/stats.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/stats.get.js +28 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.js +14 -0
- package/dist/runtime/server/api/observe/users/[id].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/users/[id].delete.js +15 -0
- package/dist/runtime/server/api/observe/users/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].get.js +11 -0
- package/dist/runtime/server/api/observe/users/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].patch.js +25 -0
- package/dist/runtime/server/api/observe/users/index.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/users/index.get.js +7 -0
- package/dist/runtime/server/api/observe/users/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/index.post.js +29 -0
- package/dist/runtime/server/auth/authorization.d.ts +7 -0
- package/dist/runtime/server/auth/authorization.js +5 -0
- package/dist/runtime/server/auth/provider.d.ts +17 -0
- package/dist/runtime/server/auth/provider.js +44 -0
- package/dist/runtime/server/auth/providers/config-provider.d.ts +18 -0
- package/dist/runtime/server/auth/providers/config-provider.js +54 -0
- package/dist/runtime/server/auth/providers/db-provider.d.ts +16 -0
- package/dist/runtime/server/auth/providers/db-provider.js +42 -0
- package/dist/runtime/server/auth/providers/jwt-provider.d.ts +24 -0
- package/dist/runtime/server/auth/providers/jwt-provider.js +72 -0
- package/dist/runtime/server/migrations/0001-services-kind.d.ts +8 -0
- package/dist/runtime/server/migrations/0001-services-kind.js +14 -0
- package/dist/runtime/server/migrations/0002-services-type.d.ts +7 -0
- package/dist/runtime/server/migrations/0002-services-type.js +14 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.d.ts +6 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.js +14 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.d.ts +11 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.js +15 -0
- package/dist/runtime/server/migrations/0005-users-columns.d.ts +9 -0
- package/dist/runtime/server/migrations/0005-users-columns.js +25 -0
- package/dist/runtime/server/migrations/index.d.ts +13 -0
- package/dist/runtime/server/migrations/index.js +13 -0
- package/dist/runtime/server/migrations/types.d.ts +15 -0
- package/dist/runtime/server/migrations/types.js +0 -0
- package/dist/runtime/server/plugins/observe-migrate.server.d.ts +2 -0
- package/dist/runtime/server/plugins/observe-migrate.server.js +18 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.d.ts +11 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.js +41 -0
- package/dist/runtime/server/tasks/purge.d.ts +5 -0
- package/dist/runtime/server/tasks/purge.js +12 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/activity-query.d.ts +28 -0
- package/dist/runtime/server/utils/activity-query.js +70 -0
- package/dist/runtime/server/utils/api-keys.d.ts +48 -0
- package/dist/runtime/server/utils/api-keys.js +67 -0
- package/dist/runtime/server/utils/authz.d.ts +50 -0
- package/dist/runtime/server/utils/authz.js +60 -0
- package/dist/runtime/server/utils/db/users.d.ts +91 -0
- package/dist/runtime/server/utils/db/users.js +128 -0
- package/dist/runtime/server/utils/db.d.ts +10 -0
- package/dist/runtime/server/utils/db.js +5 -0
- package/dist/runtime/server/utils/frogger-adapter.d.ts +40 -0
- package/dist/runtime/server/utils/frogger-adapter.js +97 -0
- package/dist/runtime/server/utils/groups.d.ts +35 -0
- package/dist/runtime/server/utils/groups.js +59 -0
- package/dist/runtime/server/utils/ingest-cors.d.ts +23 -0
- package/dist/runtime/server/utils/ingest-cors.js +27 -0
- package/dist/runtime/server/utils/journey.d.ts +20 -0
- package/dist/runtime/server/utils/journey.js +44 -0
- package/dist/runtime/server/utils/logs.d.ts +50 -0
- package/dist/runtime/server/utils/logs.js +154 -0
- package/dist/runtime/server/utils/loop-guard.d.ts +11 -0
- package/dist/runtime/server/utils/loop-guard.js +11 -0
- package/dist/runtime/server/utils/migrate.d.ts +21 -0
- package/dist/runtime/server/utils/migrate.js +144 -0
- package/dist/runtime/server/utils/migration-runner.d.ts +42 -0
- package/dist/runtime/server/utils/migration-runner.js +129 -0
- package/dist/runtime/server/utils/observe-errors.d.ts +58 -0
- package/dist/runtime/server/utils/observe-errors.js +206 -0
- package/dist/runtime/server/utils/overview.d.ts +20 -0
- package/dist/runtime/server/utils/overview.js +119 -0
- package/dist/runtime/server/utils/provisioning.d.ts +62 -0
- package/dist/runtime/server/utils/provisioning.js +299 -0
- package/dist/runtime/server/utils/rate-limit.d.ts +11 -0
- package/dist/runtime/server/utils/rate-limit.js +22 -0
- package/dist/runtime/server/utils/require-observe-session.d.ts +15 -0
- package/dist/runtime/server/utils/require-observe-session.js +25 -0
- package/dist/runtime/server/utils/rollout.d.ts +19 -0
- package/dist/runtime/server/utils/rollout.js +56 -0
- package/dist/runtime/server/utils/scope.d.ts +14 -0
- package/dist/runtime/server/utils/scope.js +28 -0
- package/dist/runtime/server/utils/seed.d.ts +18 -0
- package/dist/runtime/server/utils/seed.js +70 -0
- package/dist/runtime/server/utils/services.d.ts +91 -0
- package/dist/runtime/server/utils/services.js +142 -0
- package/dist/runtime/server/utils/stats-query.d.ts +40 -0
- package/dist/runtime/server/utils/stats-query.js +104 -0
- package/dist/runtime/shared/auth/roles.d.ts +34 -0
- package/dist/runtime/shared/auth/roles.js +6 -0
- package/dist/runtime/shared/auth/schema.d.ts +85 -0
- package/dist/runtime/shared/auth/schema.js +41 -0
- package/dist/runtime/shared/auth/types.d.ts +68 -0
- package/dist/runtime/shared/auth/types.js +0 -0
- package/dist/runtime/shared/rbac/capabilities.d.ts +46 -0
- package/dist/runtime/shared/rbac/capabilities.js +48 -0
- package/dist/runtime/shared/schema/activity.d.ts +77 -0
- package/dist/runtime/shared/schema/activity.js +22 -0
- package/dist/runtime/shared/schema/adapters/frogger.d.ts +52 -0
- package/dist/runtime/shared/schema/adapters/frogger.js +17 -0
- package/dist/runtime/shared/schema/batch.d.ts +33 -0
- package/dist/runtime/shared/schema/batch.js +9 -0
- package/dist/runtime/shared/schema/error-fingerprint.d.ts +53 -0
- package/dist/runtime/shared/schema/error-fingerprint.js +47 -0
- package/dist/runtime/shared/schema/errors-query.d.ts +136 -0
- package/dist/runtime/shared/schema/errors-query.js +47 -0
- package/dist/runtime/shared/schema/event.d.ts +48 -0
- package/dist/runtime/shared/schema/event.js +41 -0
- package/dist/runtime/shared/schema/frogger-map.d.ts +62 -0
- package/dist/runtime/shared/schema/frogger-map.js +30 -0
- package/dist/runtime/shared/schema/index.d.ts +17 -0
- package/dist/runtime/shared/schema/index.js +17 -0
- package/dist/runtime/shared/schema/journey.d.ts +99 -0
- package/dist/runtime/shared/schema/journey.js +96 -0
- package/dist/runtime/shared/schema/levels.d.ts +37 -0
- package/dist/runtime/shared/schema/levels.js +72 -0
- package/dist/runtime/shared/schema/log-row.d.ts +31 -0
- package/dist/runtime/shared/schema/log-row.js +0 -0
- package/dist/runtime/shared/schema/logs-query.d.ts +91 -0
- package/dist/runtime/shared/schema/logs-query.js +72 -0
- package/dist/runtime/shared/schema/migrations.d.ts +34 -0
- package/dist/runtime/shared/schema/migrations.js +0 -0
- package/dist/runtime/shared/schema/overview.d.ts +78 -0
- package/dist/runtime/shared/schema/overview.js +9 -0
- package/dist/runtime/shared/schema/provisioning.d.ts +230 -0
- package/dist/runtime/shared/schema/provisioning.js +52 -0
- package/dist/runtime/shared/schema/registry.d.ts +115 -0
- package/dist/runtime/shared/schema/registry.js +27 -0
- package/dist/runtime/shared/schema/rollout.d.ts +103 -0
- package/dist/runtime/shared/schema/rollout.js +66 -0
- package/dist/runtime/shared/schema/stats.d.ts +64 -0
- package/dist/runtime/shared/schema/stats.js +15 -0
- package/dist/runtime/shared/schema/tiers.d.ts +5 -0
- package/dist/runtime/shared/schema/tiers.js +9 -0
- package/dist/runtime/shared/types/module-options.d.ts +119 -0
- package/dist/runtime/shared/types/module-options.js +13 -0
- package/dist/runtime/shared/types/storage.d.ts +31 -0
- package/dist/runtime/shared/types/storage.js +0 -0
- package/dist/runtime/shared/utils/format-relative.d.ts +7 -0
- package/dist/runtime/shared/utils/format-relative.js +11 -0
- package/dist/runtime/shared/utils/frogger-snippet.d.ts +19 -0
- package/dist/runtime/shared/utils/frogger-snippet.js +33 -0
- package/dist/runtime/shared/utils/observe-config.d.ts +9 -0
- package/dist/runtime/shared/utils/observe-config.js +17 -0
- package/dist/runtime/shared/utils/period.d.ts +13 -0
- package/dist/runtime/shared/utils/period.js +15 -0
- package/dist/runtime/shared/utils/slug.d.ts +1 -0
- package/dist/runtime/shared/utils/slug.js +5 -0
- package/dist/runtime/shared/utils/uuid.d.ts +187 -0
- package/dist/runtime/shared/utils/uuid.js +345 -0
- package/dist/runtime/types/nuxt-auth-utils-imports.d.ts +25 -0
- package/dist/runtime/types/observe-app-imports.d.ts +20 -0
- package/dist/runtime/types/session.d.ts +17 -0
- package/dist/schema.d.mts +1318 -0
- package/dist/schema.mjs +629 -0
- package/dist/types.d.mts +3 -0
- package/package.json +93 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const FROGGER_FIELD_MAP = {
|
|
2
|
+
log: {
|
|
3
|
+
"time": "time",
|
|
4
|
+
"lvl": "level",
|
|
5
|
+
"type": "(dropped: redundant with lvl)",
|
|
6
|
+
"msg": "message",
|
|
7
|
+
"ctx": "ctx (+ derived: error/session/user/route/feature)",
|
|
8
|
+
"tags": "tags",
|
|
9
|
+
"env": "source.env",
|
|
10
|
+
"source.name": "source.app",
|
|
11
|
+
"source.version": "source.version",
|
|
12
|
+
"trace.traceId": "trace.traceId",
|
|
13
|
+
"trace.spanId": "trace.spanId",
|
|
14
|
+
"trace.parentId": "trace.parentId",
|
|
15
|
+
"trace.flags": "(dropped: canonical omits flags)"
|
|
16
|
+
},
|
|
17
|
+
batch: {
|
|
18
|
+
"logs": "events",
|
|
19
|
+
"app.name": "source.app",
|
|
20
|
+
"app.version": "source.version",
|
|
21
|
+
"meta": "meta (passthrough)"
|
|
22
|
+
},
|
|
23
|
+
ctxDerived: {
|
|
24
|
+
"ctx.error": "error",
|
|
25
|
+
"ctx.session": "session",
|
|
26
|
+
"ctx.user": "user",
|
|
27
|
+
"ctx.route": "route",
|
|
28
|
+
"ctx.feature": "feature"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './levels.js';
|
|
2
|
+
export * from './event.js';
|
|
3
|
+
export * from './batch.js';
|
|
4
|
+
export * from './log-row.js';
|
|
5
|
+
export * from './tiers.js';
|
|
6
|
+
export * from './frogger-map.js';
|
|
7
|
+
export * from './adapters/frogger.js';
|
|
8
|
+
export * from './registry.js';
|
|
9
|
+
export * from './provisioning.js';
|
|
10
|
+
export * from './overview.js';
|
|
11
|
+
export * from './stats.js';
|
|
12
|
+
export * from './logs-query.js';
|
|
13
|
+
export * from './activity.js';
|
|
14
|
+
export * from './journey.js';
|
|
15
|
+
export * from './rollout.js';
|
|
16
|
+
export * from './error-fingerprint.js';
|
|
17
|
+
export * from './errors-query.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./levels.js";
|
|
2
|
+
export * from "./event.js";
|
|
3
|
+
export * from "./batch.js";
|
|
4
|
+
export * from "./log-row.js";
|
|
5
|
+
export * from "./tiers.js";
|
|
6
|
+
export * from "./frogger-map.js";
|
|
7
|
+
export * from "./adapters/frogger.js";
|
|
8
|
+
export * from "./registry.js";
|
|
9
|
+
export * from "./provisioning.js";
|
|
10
|
+
export * from "./overview.js";
|
|
11
|
+
export * from "./stats.js";
|
|
12
|
+
export * from "./logs-query.js";
|
|
13
|
+
export * from "./activity.js";
|
|
14
|
+
export * from "./journey.js";
|
|
15
|
+
export * from "./rollout.js";
|
|
16
|
+
export * from "./error-fingerprint.js";
|
|
17
|
+
export * from "./errors-query.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Mirrored from frogger trace-headers.ts:63-79 (frogger is a read-only companion,
|
|
4
|
+
* not a dependency): rejects the all-zero id that the W3C spec forbids but the
|
|
5
|
+
* canonical zTraceContext regex alone would accept.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isValidTraceId(traceId: unknown): traceId is string;
|
|
8
|
+
export declare const journeyQuerySchema: z.ZodObject<{
|
|
9
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
session: z.ZodOptional<z.ZodString>;
|
|
11
|
+
user: z.ZodOptional<z.ZodString>;
|
|
12
|
+
from: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
13
|
+
to: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
14
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type JourneyQuery = z.infer<typeof journeyQuerySchema>;
|
|
17
|
+
export type JourneyMode = 'trace' | 'session' | 'user';
|
|
18
|
+
/** Resolve which mode a validated query is in (exactly one selector guaranteed by the refine). */
|
|
19
|
+
export declare function journeyMode(q: JourneyQuery): {
|
|
20
|
+
mode: JourneyMode;
|
|
21
|
+
key: string;
|
|
22
|
+
};
|
|
23
|
+
/** The selector param name each mode maps to on the wire (trace -> traceId). */
|
|
24
|
+
export declare const MODE_PARAM: Record<JourneyMode, 'traceId' | 'session' | 'user'>;
|
|
25
|
+
export interface JourneyEvent {
|
|
26
|
+
id: string;
|
|
27
|
+
time: number;
|
|
28
|
+
offsetMs: number;
|
|
29
|
+
level: number;
|
|
30
|
+
message: string;
|
|
31
|
+
app: string;
|
|
32
|
+
version: string | null;
|
|
33
|
+
service_id: string | null;
|
|
34
|
+
route: string | null;
|
|
35
|
+
feature: string | null;
|
|
36
|
+
session: string | null;
|
|
37
|
+
error: {
|
|
38
|
+
name?: string;
|
|
39
|
+
message?: string;
|
|
40
|
+
code?: string;
|
|
41
|
+
} | null;
|
|
42
|
+
traceId: string | null;
|
|
43
|
+
spanId: string | null;
|
|
44
|
+
parentId: string | null;
|
|
45
|
+
hasTrace: boolean;
|
|
46
|
+
hasParent: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface JourneyStats {
|
|
49
|
+
count: number;
|
|
50
|
+
start: number | null;
|
|
51
|
+
end: number | null;
|
|
52
|
+
durationMs: number;
|
|
53
|
+
services: string[];
|
|
54
|
+
levels: Record<string, number>;
|
|
55
|
+
}
|
|
56
|
+
export type JourneyReason = 'empty' | 'missing-correlation' | 'dangling-parent' | 'truncated';
|
|
57
|
+
export interface JourneyResponse {
|
|
58
|
+
mode: JourneyMode;
|
|
59
|
+
key: string;
|
|
60
|
+
partial: boolean;
|
|
61
|
+
reasons: JourneyReason[];
|
|
62
|
+
stats: JourneyStats;
|
|
63
|
+
events: JourneyEvent[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Aggregate over an already-ordered journey. Pure (uses only the levels.ts name
|
|
67
|
+
* map), so it unit-tests in node env alongside buildSpanTree/detectPartial.
|
|
68
|
+
*/
|
|
69
|
+
export declare function computeJourneyStats(events: JourneyEvent[]): JourneyStats;
|
|
70
|
+
/**
|
|
71
|
+
* Flags the ways a journey can be an incomplete picture, so the page can signal
|
|
72
|
+
* it honestly rather than look broken. `hitLimit` is passed in (the DB layer
|
|
73
|
+
* knows whether the row count reached the scan cap).
|
|
74
|
+
*/
|
|
75
|
+
export declare function detectPartial(events: JourneyEvent[], hitLimit: boolean): {
|
|
76
|
+
partial: boolean;
|
|
77
|
+
reasons: JourneyReason[];
|
|
78
|
+
};
|
|
79
|
+
export interface SpanNode {
|
|
80
|
+
event: JourneyEvent;
|
|
81
|
+
children: SpanNode[];
|
|
82
|
+
depth: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Links parentId -> spanId into a forest for the trace-mode waterfall. Session/
|
|
86
|
+
* user modes render a flat chronological list instead and do NOT call this.
|
|
87
|
+
*
|
|
88
|
+
* Edge cases: an event with no spanId becomes its own root; a dangling parentId
|
|
89
|
+
* (parent not in the set) promotes the node to a root lane; a parentId cycle
|
|
90
|
+
* cannot form a tree because a child is only ever attached to a parent already
|
|
91
|
+
* in `bySpan` and no node is re-parented after placement; a duplicate spanId
|
|
92
|
+
* (retries) is last-writer-wins in the map, which is acceptable here.
|
|
93
|
+
*/
|
|
94
|
+
export declare function buildSpanTree(events: JourneyEvent[]): SpanNode[];
|
|
95
|
+
/** Depth-first flatten of the span forest into render rows, tree order preserved. */
|
|
96
|
+
export declare function flattenSpanTree(roots: SpanNode[]): Array<{
|
|
97
|
+
event: JourneyEvent;
|
|
98
|
+
depth: number;
|
|
99
|
+
}>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { levelName } from "./levels.js";
|
|
3
|
+
const TRACE_ID_RE = /^[0-9a-f]{32}$/;
|
|
4
|
+
const ALL_ZERO_TRACE = "00000000000000000000000000000000";
|
|
5
|
+
export function isValidTraceId(traceId) {
|
|
6
|
+
return typeof traceId === "string" && TRACE_ID_RE.test(traceId) && traceId !== ALL_ZERO_TRACE;
|
|
7
|
+
}
|
|
8
|
+
export const journeyQuerySchema = z.object({
|
|
9
|
+
traceId: z.string().optional(),
|
|
10
|
+
session: z.string().min(1).max(200).optional(),
|
|
11
|
+
user: z.string().min(1).max(200).optional(),
|
|
12
|
+
from: z.coerce.number().int().positive().optional(),
|
|
13
|
+
to: z.coerce.number().int().positive().optional(),
|
|
14
|
+
limit: z.coerce.number().int().min(1).max(5e3).default(2e3)
|
|
15
|
+
}).superRefine((v, ctx) => {
|
|
16
|
+
const present = [v.traceId, v.session, v.user].filter((x) => x !== void 0);
|
|
17
|
+
if (present.length !== 1) {
|
|
18
|
+
ctx.addIssue({ code: "custom", message: "Provide exactly one of traceId, session, or user" });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (v.traceId !== void 0 && !isValidTraceId(v.traceId)) {
|
|
22
|
+
ctx.addIssue({ code: "custom", path: ["traceId"], message: "traceId must be 32 lowercase hex, non-zero" });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export function journeyMode(q) {
|
|
26
|
+
if (q.traceId !== void 0) return { mode: "trace", key: q.traceId };
|
|
27
|
+
if (q.session !== void 0) return { mode: "session", key: q.session };
|
|
28
|
+
return { mode: "user", key: q.user };
|
|
29
|
+
}
|
|
30
|
+
export const MODE_PARAM = {
|
|
31
|
+
trace: "traceId",
|
|
32
|
+
session: "session",
|
|
33
|
+
user: "user"
|
|
34
|
+
};
|
|
35
|
+
export function computeJourneyStats(events) {
|
|
36
|
+
if (events.length === 0) {
|
|
37
|
+
return { count: 0, start: null, end: null, durationMs: 0, services: [], levels: {} };
|
|
38
|
+
}
|
|
39
|
+
let start = events[0].time;
|
|
40
|
+
let end = events[0].time;
|
|
41
|
+
const services = [];
|
|
42
|
+
const seen = /* @__PURE__ */ new Set();
|
|
43
|
+
const levels = {};
|
|
44
|
+
for (const e of events) {
|
|
45
|
+
if (e.time < start) start = e.time;
|
|
46
|
+
if (e.time > end) end = e.time;
|
|
47
|
+
if (e.app && !seen.has(e.app)) {
|
|
48
|
+
seen.add(e.app);
|
|
49
|
+
services.push(e.app);
|
|
50
|
+
}
|
|
51
|
+
const name = levelName(e.level);
|
|
52
|
+
levels[name] = (levels[name] ?? 0) + 1;
|
|
53
|
+
}
|
|
54
|
+
return { count: events.length, start, end, durationMs: end - start, services, levels };
|
|
55
|
+
}
|
|
56
|
+
export function detectPartial(events, hitLimit) {
|
|
57
|
+
const reasons = /* @__PURE__ */ new Set();
|
|
58
|
+
if (events.length === 0) reasons.add("empty");
|
|
59
|
+
const spans = new Set(events.map((e) => e.spanId).filter(Boolean));
|
|
60
|
+
for (const e of events) {
|
|
61
|
+
if (!e.hasTrace) reasons.add("missing-correlation");
|
|
62
|
+
if (e.parentId && !spans.has(e.parentId)) reasons.add("dangling-parent");
|
|
63
|
+
}
|
|
64
|
+
if (hitLimit) reasons.add("truncated");
|
|
65
|
+
return { partial: reasons.size > 0, reasons: [...reasons] };
|
|
66
|
+
}
|
|
67
|
+
export function buildSpanTree(events) {
|
|
68
|
+
const bySpan = /* @__PURE__ */ new Map();
|
|
69
|
+
for (const e of events) {
|
|
70
|
+
if (e.spanId) bySpan.set(e.spanId, { event: e, children: [], depth: 0 });
|
|
71
|
+
}
|
|
72
|
+
const roots = [];
|
|
73
|
+
for (const e of events) {
|
|
74
|
+
const node = e.spanId ? bySpan.get(e.spanId) : { event: e, children: [], depth: 0 };
|
|
75
|
+
const parent = e.parentId ? bySpan.get(e.parentId) : void 0;
|
|
76
|
+
if (parent && parent !== node) parent.children.push(node);
|
|
77
|
+
else roots.push(node);
|
|
78
|
+
}
|
|
79
|
+
const walk = (n, d) => {
|
|
80
|
+
n.depth = d;
|
|
81
|
+
n.children.sort((a, b) => a.event.time - b.event.time);
|
|
82
|
+
n.children.forEach((c) => walk(c, d + 1));
|
|
83
|
+
};
|
|
84
|
+
roots.sort((a, b) => a.event.time - b.event.time);
|
|
85
|
+
roots.forEach((r) => walk(r, 0));
|
|
86
|
+
return roots;
|
|
87
|
+
}
|
|
88
|
+
export function flattenSpanTree(roots) {
|
|
89
|
+
const out = [];
|
|
90
|
+
const walk = (n) => {
|
|
91
|
+
out.push({ event: n.event, depth: n.depth });
|
|
92
|
+
n.children.forEach(walk);
|
|
93
|
+
};
|
|
94
|
+
roots.forEach(walk);
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Canonical severity: 0..5, lower = more severe (preserves frogger `lvl` 1:1). */
|
|
3
|
+
export declare const CANONICAL_LEVELS: {
|
|
4
|
+
readonly 0: "error";
|
|
5
|
+
readonly 1: "warn";
|
|
6
|
+
readonly 2: "notice";
|
|
7
|
+
readonly 3: "info";
|
|
8
|
+
readonly 4: "debug";
|
|
9
|
+
readonly 5: "trace";
|
|
10
|
+
};
|
|
11
|
+
export type CanonicalLevel = keyof typeof CANONICAL_LEVELS;
|
|
12
|
+
export type CanonicalLevelName = (typeof CANONICAL_LEVELS)[CanonicalLevel];
|
|
13
|
+
/** zod: an int strictly in 0..5. Sentinels are NOT valid stored levels. */
|
|
14
|
+
export declare const zLevel: z.ZodNumber;
|
|
15
|
+
/** frogger numeric `lvl` -> canonical level. 1:1 for 0..5; sentinels handled in parseLevel(). */
|
|
16
|
+
export declare const FROGGER_LEVEL_MAP: Record<number, CanonicalLevel>;
|
|
17
|
+
/** frogger `type` string / any known level name -> canonical level (mirrors frogger LEVEL_TO_NUMBER). */
|
|
18
|
+
export declare const NAME_TO_LEVEL: Record<string, CanonicalLevel>;
|
|
19
|
+
/**
|
|
20
|
+
* syslog severity (0=Emergency..7=Debug) -> canonical. Same orientation (lower=severe).
|
|
21
|
+
* Note: syslog Notice(5) maps cleanly to canonical notice(2).
|
|
22
|
+
*/
|
|
23
|
+
export declare const SYSLOG_TO_CANONICAL: Record<number, CanonicalLevel>;
|
|
24
|
+
/**
|
|
25
|
+
* OTel severityNumber (1..24) -> canonical. INVERTED orientation: OTel is higher=severe
|
|
26
|
+
* while this scale is lower=severe, so this is a hand-authored range table, not arithmetic.
|
|
27
|
+
* No OTel range maps to notice(2); that level is frogger-specific.
|
|
28
|
+
* TRACE 1-4 -> 5 · DEBUG 5-8 -> 4 · INFO 9-12 -> 3 · WARN 13-16 -> 1 · ERROR 17-20 -> 0 · FATAL 21-24 -> 0
|
|
29
|
+
*/
|
|
30
|
+
export declare function otelSeverityToCanonical(severityNumber: number): CanonicalLevel;
|
|
31
|
+
export declare function levelName(n: number): CanonicalLevelName | 'unknown';
|
|
32
|
+
/**
|
|
33
|
+
* Normalise an incoming frogger numeric `lvl` OR a level name into canonical 0..5.
|
|
34
|
+
* verbose(999) -> 5 (clamp). silent(-999) -> null (drop, never store).
|
|
35
|
+
* Out-of-range or unknown -> null (caller decides: reject or default).
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseLevel(input: number | string): CanonicalLevel | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CANONICAL_LEVELS = {
|
|
3
|
+
0: "error",
|
|
4
|
+
1: "warn",
|
|
5
|
+
2: "notice",
|
|
6
|
+
// frogger alias: 'log'
|
|
7
|
+
3: "info",
|
|
8
|
+
4: "debug",
|
|
9
|
+
5: "trace"
|
|
10
|
+
};
|
|
11
|
+
export const zLevel = z.number().int().min(0).max(5);
|
|
12
|
+
export const FROGGER_LEVEL_MAP = {
|
|
13
|
+
0: 0,
|
|
14
|
+
1: 1,
|
|
15
|
+
2: 2,
|
|
16
|
+
3: 3,
|
|
17
|
+
4: 4,
|
|
18
|
+
5: 5
|
|
19
|
+
};
|
|
20
|
+
export const NAME_TO_LEVEL = {
|
|
21
|
+
fatal: 0,
|
|
22
|
+
error: 0,
|
|
23
|
+
warn: 1,
|
|
24
|
+
log: 2,
|
|
25
|
+
notice: 2,
|
|
26
|
+
info: 3,
|
|
27
|
+
success: 3,
|
|
28
|
+
fail: 3,
|
|
29
|
+
ready: 3,
|
|
30
|
+
start: 3,
|
|
31
|
+
debug: 4,
|
|
32
|
+
trace: 5
|
|
33
|
+
};
|
|
34
|
+
export const SYSLOG_TO_CANONICAL = {
|
|
35
|
+
0: 0,
|
|
36
|
+
// Emergency
|
|
37
|
+
1: 0,
|
|
38
|
+
// Alert
|
|
39
|
+
2: 0,
|
|
40
|
+
// Critical
|
|
41
|
+
3: 0,
|
|
42
|
+
// Error
|
|
43
|
+
4: 1,
|
|
44
|
+
// Warning
|
|
45
|
+
5: 2,
|
|
46
|
+
// Notice
|
|
47
|
+
6: 3,
|
|
48
|
+
// Informational
|
|
49
|
+
7: 4
|
|
50
|
+
// Debug
|
|
51
|
+
};
|
|
52
|
+
export function otelSeverityToCanonical(severityNumber) {
|
|
53
|
+
if (severityNumber >= 21) return 0;
|
|
54
|
+
if (severityNumber >= 17) return 0;
|
|
55
|
+
if (severityNumber >= 13) return 1;
|
|
56
|
+
if (severityNumber >= 9) return 3;
|
|
57
|
+
if (severityNumber >= 5) return 4;
|
|
58
|
+
return 5;
|
|
59
|
+
}
|
|
60
|
+
export function levelName(n) {
|
|
61
|
+
return CANONICAL_LEVELS[n] ?? "unknown";
|
|
62
|
+
}
|
|
63
|
+
export function parseLevel(input) {
|
|
64
|
+
if (typeof input === "string") {
|
|
65
|
+
const byName = NAME_TO_LEVEL[input.toLowerCase()];
|
|
66
|
+
return byName ?? null;
|
|
67
|
+
}
|
|
68
|
+
if (input === 999) return 5;
|
|
69
|
+
if (input === -999) return null;
|
|
70
|
+
if (Number.isInteger(input) && input >= 0 && input <= 5) return input;
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flat DB projection of a CanonicalEvent (one table row).
|
|
3
|
+
* `id` and `received_at` are ingest-assigned (NOT from the event).
|
|
4
|
+
* `app` is non-optional: the CP4 adapter guarantees it before insert
|
|
5
|
+
* (from batch app.name / log source.name), even though event.source is optional.
|
|
6
|
+
*/
|
|
7
|
+
export interface LogRow {
|
|
8
|
+
id: string;
|
|
9
|
+
time: number;
|
|
10
|
+
received_at: number;
|
|
11
|
+
level: number;
|
|
12
|
+
message: string;
|
|
13
|
+
error_name?: string;
|
|
14
|
+
error_message?: string;
|
|
15
|
+
error_stack?: string;
|
|
16
|
+
error_code?: string;
|
|
17
|
+
error_fingerprint?: string;
|
|
18
|
+
app: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
env?: string;
|
|
21
|
+
service_id?: string;
|
|
22
|
+
session?: string;
|
|
23
|
+
user?: string;
|
|
24
|
+
route?: string;
|
|
25
|
+
feature?: string;
|
|
26
|
+
trace_id?: string;
|
|
27
|
+
span_id?: string;
|
|
28
|
+
parent_id?: string;
|
|
29
|
+
tags?: string;
|
|
30
|
+
ctx?: string;
|
|
31
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { LogRow } from './log-row.js';
|
|
3
|
+
export declare const logsQuerySchema: z.ZodObject<{
|
|
4
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
"15m": "15m";
|
|
6
|
+
"1h": "1h";
|
|
7
|
+
"24h": "24h";
|
|
8
|
+
"7d": "7d";
|
|
9
|
+
"30d": "30d";
|
|
10
|
+
}>>;
|
|
11
|
+
service: z.ZodOptional<z.ZodString>;
|
|
12
|
+
group: z.ZodOptional<z.ZodString>;
|
|
13
|
+
levels: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number[], string>>, z.ZodArray<z.ZodNumber>>>;
|
|
14
|
+
versions: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodString>>>;
|
|
15
|
+
route: z.ZodOptional<z.ZodString>;
|
|
16
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
17
|
+
q: z.ZodOptional<z.ZodString>;
|
|
18
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
20
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type LogsQuery = z.infer<typeof logsQuerySchema>;
|
|
23
|
+
/** The facets endpoint narrows its version list by the same scope slugs. */
|
|
24
|
+
export declare const logsFacetsQuerySchema: z.ZodObject<{
|
|
25
|
+
service: z.ZodOptional<z.ZodString>;
|
|
26
|
+
group: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type LogsFacetsQuery = z.infer<typeof logsFacetsQuerySchema>;
|
|
29
|
+
export interface LogListItem {
|
|
30
|
+
id: string;
|
|
31
|
+
time: number;
|
|
32
|
+
level: number;
|
|
33
|
+
message: string;
|
|
34
|
+
app: string;
|
|
35
|
+
version: string | null;
|
|
36
|
+
env: string | null;
|
|
37
|
+
service_id: string | null;
|
|
38
|
+
route: string | null;
|
|
39
|
+
feature: string | null;
|
|
40
|
+
error_name: string | null;
|
|
41
|
+
trace_id: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface LogDetail {
|
|
44
|
+
id: string;
|
|
45
|
+
time: number;
|
|
46
|
+
received_at: number;
|
|
47
|
+
level: number;
|
|
48
|
+
message: string;
|
|
49
|
+
app: string;
|
|
50
|
+
version: string | null;
|
|
51
|
+
env: string | null;
|
|
52
|
+
service_id: string | null;
|
|
53
|
+
session: string | null;
|
|
54
|
+
user: string | null;
|
|
55
|
+
route: string | null;
|
|
56
|
+
feature: string | null;
|
|
57
|
+
error: {
|
|
58
|
+
name?: string;
|
|
59
|
+
message?: string;
|
|
60
|
+
stack?: string;
|
|
61
|
+
code?: string;
|
|
62
|
+
} | null;
|
|
63
|
+
trace: {
|
|
64
|
+
traceId?: string;
|
|
65
|
+
spanId?: string;
|
|
66
|
+
parentId?: string;
|
|
67
|
+
} | null;
|
|
68
|
+
tags: string[] | null;
|
|
69
|
+
ctx: Record<string, unknown> | null;
|
|
70
|
+
}
|
|
71
|
+
export interface LogListResponse {
|
|
72
|
+
period: {
|
|
73
|
+
from: number;
|
|
74
|
+
to: number;
|
|
75
|
+
label: string;
|
|
76
|
+
};
|
|
77
|
+
rows: LogListItem[];
|
|
78
|
+
total: number;
|
|
79
|
+
limit: number;
|
|
80
|
+
offset: number;
|
|
81
|
+
}
|
|
82
|
+
export interface LogsFacetsResponse {
|
|
83
|
+
versions: string[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Reassembles error/trace objects from the flat error and trace columns (null when
|
|
87
|
+
* every part is absent), JSON-parses tags/ctx inside a guard (malformed JSON -> null,
|
|
88
|
+
* never a 500), and passes `user` through (the SELECT alias already restored it).
|
|
89
|
+
* Pure, so it unit-tests in node env.
|
|
90
|
+
*/
|
|
91
|
+
export declare function rowToDetail(row: LogRow): LogDetail;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PERIODS } from "../utils/period.js";
|
|
3
|
+
const csvLevels = z.string().transform((s) => s.split(",").map((v) => v.trim()).filter((v) => v.length > 0).map(Number)).pipe(z.array(z.number().int().min(0).max(5)).min(1).max(6)).optional();
|
|
4
|
+
const csvStrings = z.string().transform((s) => s.split(",").map((v) => v.trim()).filter((v) => v.length > 0)).pipe(z.array(z.string().min(1).max(100)).min(1).max(20)).optional();
|
|
5
|
+
export const logsQuerySchema = z.object({
|
|
6
|
+
period: z.enum(PERIODS).default("24h"),
|
|
7
|
+
/** service slug; resolved to an id and intersected with the caller's scope */
|
|
8
|
+
service: z.string().optional(),
|
|
9
|
+
/** group slug; expanded to member service ids and intersected with the caller's scope */
|
|
10
|
+
group: z.string().optional(),
|
|
11
|
+
/** CSV of exact levels, e.g. "0,1" -> level IN (0,1) */
|
|
12
|
+
levels: csvLevels,
|
|
13
|
+
/** CSV of exact versions -> version IN (...) */
|
|
14
|
+
versions: csvStrings,
|
|
15
|
+
/** exact route filter, e.g. from the activity drill-through (CP10) */
|
|
16
|
+
route: z.string().min(1).max(200).optional(),
|
|
17
|
+
/** exact feature filter, e.g. from the activity drill-through (CP10) */
|
|
18
|
+
feature: z.string().min(1).max(200).optional(),
|
|
19
|
+
/** free-text message search; message LIKE %q% ESCAPE '\' */
|
|
20
|
+
q: z.string().trim().min(1).max(200).optional(),
|
|
21
|
+
/** exact trace id; when present the period window is NOT applied (see handler §3.3) */
|
|
22
|
+
traceId: z.string().min(1).max(64).optional(),
|
|
23
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
24
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
25
|
+
});
|
|
26
|
+
export const logsFacetsQuerySchema = z.object({
|
|
27
|
+
service: z.string().optional(),
|
|
28
|
+
group: z.string().optional()
|
|
29
|
+
});
|
|
30
|
+
function parseJson(raw, guard) {
|
|
31
|
+
if (raw == null) return null;
|
|
32
|
+
try {
|
|
33
|
+
const parsed = JSON.parse(raw);
|
|
34
|
+
return guard(parsed) ? parsed : null;
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const isStringArray = (v) => Array.isArray(v) && v.every((x) => typeof x === "string");
|
|
40
|
+
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
41
|
+
export function rowToDetail(row) {
|
|
42
|
+
const error = row.error_name || row.error_message || row.error_stack || row.error_code ? {
|
|
43
|
+
...row.error_name ? { name: row.error_name } : {},
|
|
44
|
+
...row.error_message ? { message: row.error_message } : {},
|
|
45
|
+
...row.error_stack ? { stack: row.error_stack } : {},
|
|
46
|
+
...row.error_code ? { code: row.error_code } : {}
|
|
47
|
+
} : null;
|
|
48
|
+
const trace = row.trace_id || row.span_id || row.parent_id ? {
|
|
49
|
+
...row.trace_id ? { traceId: row.trace_id } : {},
|
|
50
|
+
...row.span_id ? { spanId: row.span_id } : {},
|
|
51
|
+
...row.parent_id ? { parentId: row.parent_id } : {}
|
|
52
|
+
} : null;
|
|
53
|
+
return {
|
|
54
|
+
id: row.id,
|
|
55
|
+
time: row.time,
|
|
56
|
+
received_at: row.received_at,
|
|
57
|
+
level: row.level,
|
|
58
|
+
message: row.message,
|
|
59
|
+
app: row.app,
|
|
60
|
+
version: row.version ?? null,
|
|
61
|
+
env: row.env ?? null,
|
|
62
|
+
service_id: row.service_id ?? null,
|
|
63
|
+
session: row.session ?? null,
|
|
64
|
+
user: row.user ?? null,
|
|
65
|
+
route: row.route ?? null,
|
|
66
|
+
feature: row.feature ?? null,
|
|
67
|
+
error,
|
|
68
|
+
trace,
|
|
69
|
+
tags: parseJson(row.tags, isStringArray),
|
|
70
|
+
ctx: parseJson(row.ctx, isObject)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-free wire types for the CP17 migration console, shared by the server routes
|
|
3
|
+
* (server/utils/migration-runner.ts, server/api/observe/migrations/*) and the client
|
|
4
|
+
* composable (app/composables/useObserveMigrations.ts) so the status shape and the SSE
|
|
5
|
+
* frame shape never drift between the two sides.
|
|
6
|
+
*/
|
|
7
|
+
export type MigrationClass = 'additive' | 'destructive';
|
|
8
|
+
/** 'blocked' = pending but sits behind an earlier pending destructive migration. */
|
|
9
|
+
export type MigrationState = 'applied' | 'pending' | 'blocked';
|
|
10
|
+
export interface MigrationStatus {
|
|
11
|
+
id: string;
|
|
12
|
+
class: MigrationClass;
|
|
13
|
+
description: string;
|
|
14
|
+
state: MigrationState;
|
|
15
|
+
applied_at?: number;
|
|
16
|
+
driftWarning?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface MigrationStatusResponse {
|
|
19
|
+
statuses: MigrationStatus[];
|
|
20
|
+
pendingDestructive: number;
|
|
21
|
+
driftWarnings: string[];
|
|
22
|
+
}
|
|
23
|
+
/** One SSE frame from POST /api/observe/migrations/run. */
|
|
24
|
+
export type MigrationRunFrame = {
|
|
25
|
+
type: 'log';
|
|
26
|
+
line: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'complete';
|
|
29
|
+
applied: string[];
|
|
30
|
+
failedAt?: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'error';
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Contract for GET /api/observe/overview (CP7): the query the client may send and
|
|
4
|
+
* the response shape both sides type against. Framework-free (zod only) so it loads
|
|
5
|
+
* in node-env unit tests, the Nitro handler, and the browser composable alike.
|
|
6
|
+
*/
|
|
7
|
+
export declare const overviewQuerySchema: z.ZodObject<{
|
|
8
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
"15m": "15m";
|
|
10
|
+
"1h": "1h";
|
|
11
|
+
"24h": "24h";
|
|
12
|
+
"7d": "7d";
|
|
13
|
+
"30d": "30d";
|
|
14
|
+
}>>;
|
|
15
|
+
service: z.ZodOptional<z.ZodString>;
|
|
16
|
+
group: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type OverviewQuery = z.infer<typeof overviewQuerySchema>;
|
|
19
|
+
export interface OverviewStats {
|
|
20
|
+
totalEvents: number;
|
|
21
|
+
errorCount: number;
|
|
22
|
+
/** errorCount / totalEvents, 0 when totalEvents === 0 */
|
|
23
|
+
errorRate: number;
|
|
24
|
+
warnCount: number;
|
|
25
|
+
activeServices: number;
|
|
26
|
+
activeVersions: number;
|
|
27
|
+
latestError?: {
|
|
28
|
+
time: number;
|
|
29
|
+
message: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
/** human slug, falling back to the raw `app` column when service_id did not join */
|
|
32
|
+
service: string;
|
|
33
|
+
route?: string;
|
|
34
|
+
traceId?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface OverviewServiceRollup {
|
|
38
|
+
id: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
name: string;
|
|
41
|
+
env?: string;
|
|
42
|
+
totalEvents: number;
|
|
43
|
+
errorCount: number;
|
|
44
|
+
errorRate: number;
|
|
45
|
+
warnCount: number;
|
|
46
|
+
lastSeen: number;
|
|
47
|
+
versions: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface OverviewActivityItem {
|
|
50
|
+
time: number;
|
|
51
|
+
level: number;
|
|
52
|
+
message: string;
|
|
53
|
+
/** human slug, falling back to the raw `app` column when service_id did not join */
|
|
54
|
+
service: string;
|
|
55
|
+
route?: string;
|
|
56
|
+
session?: string;
|
|
57
|
+
user?: string;
|
|
58
|
+
traceId?: string;
|
|
59
|
+
errorName?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface OverviewResponse {
|
|
62
|
+
period: {
|
|
63
|
+
from: number;
|
|
64
|
+
to: number;
|
|
65
|
+
label: string;
|
|
66
|
+
};
|
|
67
|
+
/** isAll=true for admin ('*'); serviceIds is [] then, not the full id list */
|
|
68
|
+
scope: {
|
|
69
|
+
serviceIds: string[];
|
|
70
|
+
isAll: boolean;
|
|
71
|
+
};
|
|
72
|
+
stats: OverviewStats;
|
|
73
|
+
services: OverviewServiceRollup[];
|
|
74
|
+
/** newest first, LIMIT 50 */
|
|
75
|
+
activity: OverviewActivityItem[];
|
|
76
|
+
}
|
|
77
|
+
/** The db-derived slice getOverview() assembles; the handler adds period + scope. */
|
|
78
|
+
export type OverviewData = Pick<OverviewResponse, 'stats' | 'services' | 'activity'>;
|