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,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Contract for GET /api/observe/activity (CP10): the ranked "top endpoints/features
|
|
4
|
+
* being hit" list. A GROUP BY over the canonical route/feature columns of `logs`,
|
|
5
|
+
* scoped and time-bounded exactly like /stats. Framework-free (zod only) so it loads
|
|
6
|
+
* in node-env unit tests, the Nitro handler, and the browser composable alike.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ACTIVITY_DIMENSIONS: readonly ["auto", "route", "feature"];
|
|
9
|
+
export type ActivityDimension = (typeof ACTIVITY_DIMENSIONS)[number];
|
|
10
|
+
export declare const ACTIVITY_SORTS: readonly ["count", "errors", "errorRate", "lastSeen"];
|
|
11
|
+
export type ActivitySort = (typeof ACTIVITY_SORTS)[number];
|
|
12
|
+
export declare const activityQuerySchema: z.ZodObject<{
|
|
13
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
"15m": "15m";
|
|
15
|
+
"1h": "1h";
|
|
16
|
+
"24h": "24h";
|
|
17
|
+
"7d": "7d";
|
|
18
|
+
"30d": "30d";
|
|
19
|
+
}>>;
|
|
20
|
+
service: z.ZodOptional<z.ZodString>;
|
|
21
|
+
group: z.ZodOptional<z.ZodString>;
|
|
22
|
+
dimension: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
auto: "auto";
|
|
24
|
+
route: "route";
|
|
25
|
+
feature: "feature";
|
|
26
|
+
}>>;
|
|
27
|
+
env: z.ZodOptional<z.ZodString>;
|
|
28
|
+
level: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
29
|
+
q: z.ZodOptional<z.ZodString>;
|
|
30
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
31
|
+
count: "count";
|
|
32
|
+
errors: "errors";
|
|
33
|
+
errorRate: "errorRate";
|
|
34
|
+
lastSeen: "lastSeen";
|
|
35
|
+
}>>;
|
|
36
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type ActivityQuery = z.infer<typeof activityQuerySchema>;
|
|
39
|
+
export interface ActivityItem {
|
|
40
|
+
key: string;
|
|
41
|
+
/** which column the key came from; resolved per item in 'auto' (route wins) */
|
|
42
|
+
dim: 'route' | 'feature';
|
|
43
|
+
count: number;
|
|
44
|
+
/** rows with level = 0 (CP10 D1: same predicate as overview/stats) */
|
|
45
|
+
errors: number;
|
|
46
|
+
/** 0..1, computed server-side from the integer sums */
|
|
47
|
+
errorRate: number;
|
|
48
|
+
/** MAX(time), ms epoch */
|
|
49
|
+
lastSeen: number;
|
|
50
|
+
/** MIN(time), ms epoch */
|
|
51
|
+
firstSeen: number;
|
|
52
|
+
}
|
|
53
|
+
/** The db-derived slice getActivity() assembles; the handler adds the envelope. */
|
|
54
|
+
export interface ActivityData {
|
|
55
|
+
items: ActivityItem[];
|
|
56
|
+
/** rows in scope+window+filters, keyed or not */
|
|
57
|
+
total: number;
|
|
58
|
+
/** rows carrying the selected dimension */
|
|
59
|
+
withKey: number;
|
|
60
|
+
/** total > 0 && withKey === 0: events exist but none carry the dimension (CP15 emit gap) */
|
|
61
|
+
degraded: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface ActivityResponse extends ActivityData {
|
|
64
|
+
dimension: ActivityDimension;
|
|
65
|
+
period: {
|
|
66
|
+
from: number;
|
|
67
|
+
to: number;
|
|
68
|
+
label: string;
|
|
69
|
+
};
|
|
70
|
+
/** isAll=true for admin ('*'); serviceIds is [] then, not the full id list */
|
|
71
|
+
scope: {
|
|
72
|
+
serviceIds: string[];
|
|
73
|
+
isAll: boolean;
|
|
74
|
+
};
|
|
75
|
+
sort: ActivitySort;
|
|
76
|
+
limit: number;
|
|
77
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PERIODS } from "../utils/period.js";
|
|
3
|
+
export const ACTIVITY_DIMENSIONS = ["auto", "route", "feature"];
|
|
4
|
+
export const ACTIVITY_SORTS = ["count", "errors", "errorRate", "lastSeen"];
|
|
5
|
+
export const activityQuerySchema = 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
|
+
/** grouping dimension; auto = COALESCE(route, feature) */
|
|
12
|
+
dimension: z.enum(ACTIVITY_DIMENSIONS).default("auto"),
|
|
13
|
+
/** exact env filter */
|
|
14
|
+
env: z.string().optional(),
|
|
15
|
+
/** exact-level filter, 0..5 (mirrors statsQuerySchema, CP8 D3) */
|
|
16
|
+
level: z.coerce.number().int().min(0).max(5).optional(),
|
|
17
|
+
/** substring match on the key; escaped LIKE (shared escapeLike) */
|
|
18
|
+
q: z.string().trim().min(1).max(200).optional(),
|
|
19
|
+
sort: z.enum(ACTIVITY_SORTS).default("count"),
|
|
20
|
+
/** rejected with 400 past the ceiling, never silently clamped */
|
|
21
|
+
limit: z.coerce.number().int().min(1).max(200).default(50)
|
|
22
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Permissive wire schema for a frogger LoggerObjectBatch. Deliberately does NOT
|
|
4
|
+
* hex-validate trace (the canonical zTraceContext does; the adapter demotes an
|
|
5
|
+
* invalid trace into ctx instead of 400-ing the batch) and passes unknown
|
|
6
|
+
* ctx/meta keys through. zod-only: keeps the `nuxt-observe/schema` subpath pure.
|
|
7
|
+
*/
|
|
8
|
+
export declare const zFroggerLog: z.ZodObject<{
|
|
9
|
+
time: z.ZodNumber;
|
|
10
|
+
lvl: z.ZodNumber;
|
|
11
|
+
type: z.ZodOptional<z.ZodString>;
|
|
12
|
+
msg: z.ZodString;
|
|
13
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
+
env: z.ZodOptional<z.ZodString>;
|
|
16
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
}, z.core.$loose>;
|
|
26
|
+
export declare const zFroggerBatch: z.ZodObject<{
|
|
27
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
28
|
+
time: z.ZodNumber;
|
|
29
|
+
lvl: z.ZodNumber;
|
|
30
|
+
type: z.ZodOptional<z.ZodString>;
|
|
31
|
+
msg: z.ZodString;
|
|
32
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
33
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
env: z.ZodOptional<z.ZodString>;
|
|
35
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
}, z.core.$loose>>;
|
|
45
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
version: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
50
|
+
}, z.core.$loose>;
|
|
51
|
+
export type FroggerLogInput = z.infer<typeof zFroggerLog>;
|
|
52
|
+
export type FroggerBatchInput = z.infer<typeof zFroggerBatch>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const zFroggerLog = z.object({
|
|
3
|
+
time: z.number(),
|
|
4
|
+
lvl: z.number(),
|
|
5
|
+
type: z.string().optional(),
|
|
6
|
+
msg: z.string(),
|
|
7
|
+
ctx: z.record(z.string(), z.unknown()).optional(),
|
|
8
|
+
tags: z.array(z.string()).optional(),
|
|
9
|
+
env: z.string().optional(),
|
|
10
|
+
source: z.object({ name: z.string().optional(), version: z.string().optional() }).partial().optional(),
|
|
11
|
+
trace: z.object({ traceId: z.string(), spanId: z.string(), parentId: z.string().optional() }).partial().optional()
|
|
12
|
+
}).passthrough();
|
|
13
|
+
export const zFroggerBatch = z.object({
|
|
14
|
+
logs: z.array(zFroggerLog).min(1),
|
|
15
|
+
app: z.object({ name: z.string(), version: z.string() }).partial().optional(),
|
|
16
|
+
meta: z.object({}).passthrough().optional()
|
|
17
|
+
}).passthrough();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MAX_BATCH_EVENTS = 500;
|
|
3
|
+
export declare const zCanonicalBatch: z.ZodObject<{
|
|
4
|
+
events: z.ZodArray<z.ZodObject<{
|
|
5
|
+
time: z.ZodNumber;
|
|
6
|
+
level: z.ZodNumber;
|
|
7
|
+
message: z.ZodString;
|
|
8
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
message: z.ZodString;
|
|
11
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
12
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
traceId: z.ZodString;
|
|
16
|
+
spanId: z.ZodString;
|
|
17
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
app: z.ZodString;
|
|
21
|
+
version: z.ZodOptional<z.ZodString>;
|
|
22
|
+
env: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
session: z.ZodOptional<z.ZodString>;
|
|
25
|
+
user: z.ZodOptional<z.ZodString>;
|
|
26
|
+
route: z.ZodOptional<z.ZodString>;
|
|
27
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type CanonicalBatch = z.infer<typeof zCanonicalBatch>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zCanonicalEvent } from "./event.js";
|
|
3
|
+
export const MAX_BATCH_EVENTS = 500;
|
|
4
|
+
export const zCanonicalBatch = z.object({
|
|
5
|
+
events: z.array(zCanonicalEvent).max(MAX_BATCH_EVENTS),
|
|
6
|
+
// empty allowed: a valid no-op batch
|
|
7
|
+
meta: z.record(z.string(), z.unknown()).optional()
|
|
8
|
+
// frogger meta.{processed,processChain,source,time} passes through
|
|
9
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error fingerprinting (CP14): a deterministic hash of the normalized
|
|
3
|
+
* stack top-frames + templatized message + code + name. Co-located under
|
|
4
|
+
* shared/schema/ next to journey.ts / logs-query.ts (pure fns + types beside the
|
|
5
|
+
* barrel). The ONLY input is the first-class CanonicalEvent.error object.
|
|
6
|
+
*
|
|
7
|
+
* `node:crypto` makes this server-only in practice (ingest, backfill, tests are
|
|
8
|
+
* all node). It is re-exported from #observe/schema, but Vite tree-shakes an
|
|
9
|
+
* uncalled value export, so no client bundle pulls in `node:crypto` as long as
|
|
10
|
+
* no client code CALLS fingerprintError (CP14-HANDOFF R1).
|
|
11
|
+
*/
|
|
12
|
+
export interface FingerprintResult {
|
|
13
|
+
/** `v1:` + 16 lowercase hex */
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
/** algorithm version, always 'v1' here */
|
|
16
|
+
version: string;
|
|
17
|
+
normalizedMessage: string;
|
|
18
|
+
/** the normalized top-N frames actually used (empty when no usable stack) */
|
|
19
|
+
frames: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface ErrorLike {
|
|
22
|
+
name?: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
stack?: string;
|
|
25
|
+
code?: string | number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Collapse dynamic values in a message to fixed placeholders so two occurrences of
|
|
29
|
+
* the same logical error (different ids/numbers/paths) hash identically. Applied in
|
|
30
|
+
* order: timestamps, then uuids, then long hex blobs, then urls/paths, then quoted
|
|
31
|
+
* literals, then bare numbers. The order matters (a timestamp contains digits a bare
|
|
32
|
+
* number rule would otherwise shred first).
|
|
33
|
+
*/
|
|
34
|
+
export declare function normalizeMessage(message: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Reduce one V8 stack frame to a stable `func (basename)` (or just `basename`) token:
|
|
37
|
+
* keep the function name + the file basename, drop `:line:col`, collapse a bundle chunk
|
|
38
|
+
* hash (`app.ab12cd.js` -> `app.js`), and drop anonymous / eval / native frames. Returns
|
|
39
|
+
* null for a line that is not a usable frame.
|
|
40
|
+
*/
|
|
41
|
+
export declare function normalizeFrame(line: string): string | null;
|
|
42
|
+
/** Top-N usable frames from a raw stack; [] when absent or fully unusable. */
|
|
43
|
+
export declare function normalizeStack(stack: string | undefined, topFrames: number): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Compute a stable fingerprint for an error. The hash input is, in this exact field
|
|
46
|
+
* order: `name | code | normalizedMessage | frames.join('\n')`, sha1-hexed, first 16
|
|
47
|
+
* chars, prefixed `v1:`. When the stack is absent or yields no usable frames, the
|
|
48
|
+
* fingerprint falls back to name + code + normalizedMessage only (frames = []), which
|
|
49
|
+
* is still deterministic.
|
|
50
|
+
*/
|
|
51
|
+
export declare function fingerprintError(err: ErrorLike, opts?: {
|
|
52
|
+
topFrames?: number;
|
|
53
|
+
}): FingerprintResult;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const VERSION = "v1";
|
|
3
|
+
const DEFAULT_TOP_FRAMES = 3;
|
|
4
|
+
export function normalizeMessage(message) {
|
|
5
|
+
return message.replace(/\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?/g, "<ts>").replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, "<uuid>").replace(/\b[0-9a-f]{8,}\b/gi, "<hex>").replace(/\b[a-z][a-z0-9+.-]*:\/\/[^\s'"]+/gi, "<path>").replace(/(?:[a-z]:\\|\.{0,2}\/)[^\s'"]*[^\s'".,;:]/gi, "<path>").replace(/'[^']*'/g, "<str>").replace(/"[^"]*"/g, "<str>").replace(/-?\d+(?:\.\d+)?/g, "<n>").trim();
|
|
6
|
+
}
|
|
7
|
+
const ANON_RE = /<anonymous>|\beval\b|\[native code\]/i;
|
|
8
|
+
export function normalizeFrame(line) {
|
|
9
|
+
const trimmed = line.trim().replace(/^at\s+/, "").replace(/^async\s+/, "");
|
|
10
|
+
if (!trimmed) return null;
|
|
11
|
+
const open = trimmed.lastIndexOf(" (");
|
|
12
|
+
let fn = "";
|
|
13
|
+
let loc = trimmed;
|
|
14
|
+
if (open > 0 && trimmed.endsWith(")")) {
|
|
15
|
+
fn = trimmed.slice(0, open).trim();
|
|
16
|
+
loc = trimmed.slice(open + 2, -1).trim();
|
|
17
|
+
}
|
|
18
|
+
if (loc.startsWith("node:") || /^(?:internal|native)\b/.test(loc)) return null;
|
|
19
|
+
if (ANON_RE.test(fn) || ANON_RE.test(loc)) return null;
|
|
20
|
+
loc = loc.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]+/i, "");
|
|
21
|
+
loc = loc.replace(/(?::\d+)+$/, "");
|
|
22
|
+
const base = loc.split(/[\\/]/).pop() ?? loc;
|
|
23
|
+
const cleaned = base.replace(/\.[0-9a-f]{6,}(?=\.[a-z0-9]+$)/i, "");
|
|
24
|
+
if (!cleaned) return fn || null;
|
|
25
|
+
return fn ? `${fn} (${cleaned})` : cleaned;
|
|
26
|
+
}
|
|
27
|
+
export function normalizeStack(stack, topFrames) {
|
|
28
|
+
if (!stack) return [];
|
|
29
|
+
const out = [];
|
|
30
|
+
for (const line of stack.split("\n")) {
|
|
31
|
+
if (!/^\s*at\s+/.test(line)) continue;
|
|
32
|
+
const frame = normalizeFrame(line);
|
|
33
|
+
if (frame) out.push(frame);
|
|
34
|
+
if (out.length >= topFrames) break;
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
export function fingerprintError(err, opts = {}) {
|
|
39
|
+
const topFrames = opts.topFrames ?? DEFAULT_TOP_FRAMES;
|
|
40
|
+
const name = err.name ?? "";
|
|
41
|
+
const code = String(err.code ?? "");
|
|
42
|
+
const normalizedMessage = normalizeMessage(err.message ?? "");
|
|
43
|
+
const frames = normalizeStack(err.stack, topFrames);
|
|
44
|
+
const input = [name, code, normalizedMessage, frames.join("\n")].join("|");
|
|
45
|
+
const hash = createHash("sha1").update(input).digest("hex").slice(0, 16);
|
|
46
|
+
return { fingerprint: `${VERSION}:${hash}`, version: VERSION, normalizedMessage, frames };
|
|
47
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { LogListItem } from './logs-query.js';
|
|
3
|
+
import type { StatsBucket } from './stats.js';
|
|
4
|
+
/**
|
|
5
|
+
* Contract for the error dashboard (CP14): the query schemas behind
|
|
6
|
+
* GET /api/observe/errors + /errors/:fingerprint, the wire shapes, and the pure
|
|
7
|
+
* query-time regression heuristic. Framework-free (zod v4 only + pure fns) so it
|
|
8
|
+
* loads in node-env unit tests, the Nitro handlers, and the browser composable
|
|
9
|
+
* alike, mirroring logs-query.ts / rollout.ts. The fingerprint hash itself lives in
|
|
10
|
+
* error-fingerprint.ts (server-only, node:crypto); nothing here imports it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NULL_VERSION = "(unversioned)";
|
|
13
|
+
/** How the grouped list is ordered; each maps to a fixed, never-interpolated column. */
|
|
14
|
+
export declare const ERROR_SORTS: readonly ["recent", "count", "first"];
|
|
15
|
+
export type ErrorSort = (typeof ERROR_SORTS)[number];
|
|
16
|
+
export declare const errorsQuerySchema: z.ZodObject<{
|
|
17
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
18
|
+
"15m": "15m";
|
|
19
|
+
"1h": "1h";
|
|
20
|
+
"24h": "24h";
|
|
21
|
+
"7d": "7d";
|
|
22
|
+
"30d": "30d";
|
|
23
|
+
}>>;
|
|
24
|
+
service: z.ZodOptional<z.ZodString>;
|
|
25
|
+
group: z.ZodOptional<z.ZodString>;
|
|
26
|
+
app: z.ZodOptional<z.ZodString>;
|
|
27
|
+
version: z.ZodOptional<z.ZodString>;
|
|
28
|
+
env: z.ZodOptional<z.ZodString>;
|
|
29
|
+
level: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
30
|
+
q: z.ZodOptional<z.ZodString>;
|
|
31
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
32
|
+
first: "first";
|
|
33
|
+
count: "count";
|
|
34
|
+
recent: "recent";
|
|
35
|
+
}>>;
|
|
36
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
37
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type ErrorsQuery = z.infer<typeof errorsQuerySchema>;
|
|
40
|
+
/** The drill-down route: same window/scope selectors plus the occurrences pager. */
|
|
41
|
+
export declare const errorDetailQuerySchema: z.ZodObject<{
|
|
42
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
43
|
+
"15m": "15m";
|
|
44
|
+
"1h": "1h";
|
|
45
|
+
"24h": "24h";
|
|
46
|
+
"7d": "7d";
|
|
47
|
+
"30d": "30d";
|
|
48
|
+
}>>;
|
|
49
|
+
service: z.ZodOptional<z.ZodString>;
|
|
50
|
+
group: z.ZodOptional<z.ZodString>;
|
|
51
|
+
bucketMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
52
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
53
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type ErrorDetailQuery = z.infer<typeof errorDetailQuerySchema>;
|
|
56
|
+
export interface ErrorGroup {
|
|
57
|
+
fingerprint: string;
|
|
58
|
+
count: number;
|
|
59
|
+
firstSeen: number;
|
|
60
|
+
lastSeen: number;
|
|
61
|
+
/** MIN(level): 0 = error is MOST severe, so a group's headline is its minimum level */
|
|
62
|
+
worstLevel: number;
|
|
63
|
+
/** COUNT(DISTINCT app) */
|
|
64
|
+
serviceCount: number;
|
|
65
|
+
/** distinct source apps, split from GROUP_CONCAT */
|
|
66
|
+
apps: string[];
|
|
67
|
+
/** distinct versions, split from GROUP_CONCAT */
|
|
68
|
+
versions: string[];
|
|
69
|
+
/** representative name/message from the latest occurrence (null when never set) */
|
|
70
|
+
name: string | null;
|
|
71
|
+
message: string | null;
|
|
72
|
+
/** query-time gap-heuristic flag (CP14 §6); never stored */
|
|
73
|
+
regressed: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ErrorGroupsResponse {
|
|
76
|
+
period: {
|
|
77
|
+
from: number;
|
|
78
|
+
to: number;
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
groups: ErrorGroup[];
|
|
82
|
+
total: number;
|
|
83
|
+
limit: number;
|
|
84
|
+
offset: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ErrorVersionBreakdown {
|
|
87
|
+
/** '(unversioned)' for NULL */
|
|
88
|
+
version: string;
|
|
89
|
+
count: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ErrorServiceBreakdown {
|
|
92
|
+
serviceId: string | null;
|
|
93
|
+
slug: string | null;
|
|
94
|
+
name: string | null;
|
|
95
|
+
count: number;
|
|
96
|
+
}
|
|
97
|
+
export interface ErrorGroupHeader extends ErrorGroup {
|
|
98
|
+
/** representative error code from the latest occurrence */
|
|
99
|
+
code: string | null;
|
|
100
|
+
}
|
|
101
|
+
export interface ErrorGroupDetailResponse {
|
|
102
|
+
period: {
|
|
103
|
+
from: number;
|
|
104
|
+
to: number;
|
|
105
|
+
label: string;
|
|
106
|
+
};
|
|
107
|
+
header: ErrorGroupHeader;
|
|
108
|
+
bucketMs: number;
|
|
109
|
+
/** zero-filled occurrences-over-time, StatsBucket-shaped so it feeds ObserveVolumeChart */
|
|
110
|
+
series: StatsBucket[];
|
|
111
|
+
versions: ErrorVersionBreakdown[];
|
|
112
|
+
services: ErrorServiceBreakdown[];
|
|
113
|
+
occurrences: LogListItem[];
|
|
114
|
+
occurrencesTotal: number;
|
|
115
|
+
limit: number;
|
|
116
|
+
offset: number;
|
|
117
|
+
}
|
|
118
|
+
export interface RegressionThresholds {
|
|
119
|
+
/** a group is "active now" when its lastSeen is within this of `now` (default 24h) */
|
|
120
|
+
activeWindowMs: number;
|
|
121
|
+
/** the silent gap before the active window that qualifies as a regression (default 72h) */
|
|
122
|
+
regressionGapMs: number;
|
|
123
|
+
}
|
|
124
|
+
export declare const DEFAULT_REGRESSION_THRESHOLDS: RegressionThresholds;
|
|
125
|
+
/**
|
|
126
|
+
* Query-time regression flag (CP14 §6), pure over the conditional aggregates the group
|
|
127
|
+
* query returns. A group is regressed when it is active now AND it returned after a
|
|
128
|
+
* silent gap. A brand-new error has no `prevBeforeActive` and so can never false-positive.
|
|
129
|
+
*/
|
|
130
|
+
export declare function isRegressed(row: {
|
|
131
|
+
lastSeen: number;
|
|
132
|
+
firstInActive: number | null;
|
|
133
|
+
prevBeforeActive: number | null;
|
|
134
|
+
}, thresholds: RegressionThresholds, now: number): boolean;
|
|
135
|
+
/** Split a SQLite GROUP_CONCAT(DISTINCT ...) result into a clean array (NULLs already dropped). */
|
|
136
|
+
export declare function splitConcat(value: string | null | undefined): string[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PERIODS } from "../utils/period.js";
|
|
3
|
+
export const NULL_VERSION = "(unversioned)";
|
|
4
|
+
export const ERROR_SORTS = ["recent", "count", "first"];
|
|
5
|
+
export const errorsQuerySchema = 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
|
+
/** exact source-app filter */
|
|
12
|
+
app: z.string().min(1).max(200).optional(),
|
|
13
|
+
/** exact version filter */
|
|
14
|
+
version: z.string().min(1).max(200).optional(),
|
|
15
|
+
/** exact env filter */
|
|
16
|
+
env: z.string().min(1).max(200).optional(),
|
|
17
|
+
/** exact level filter, 0..5 */
|
|
18
|
+
level: z.coerce.number().int().min(0).max(5).optional(),
|
|
19
|
+
/** free-text search over the representative error message; LIKE %q% ESCAPE '\' */
|
|
20
|
+
q: z.string().trim().min(1).max(200).optional(),
|
|
21
|
+
sort: z.enum(ERROR_SORTS).default("recent"),
|
|
22
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
23
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
24
|
+
});
|
|
25
|
+
export const errorDetailQuerySchema = z.object({
|
|
26
|
+
period: z.enum(PERIODS).default("24h"),
|
|
27
|
+
service: z.string().optional(),
|
|
28
|
+
group: z.string().optional(),
|
|
29
|
+
/** advanced bucket-size override in ms for the occurrences chart; > 500 buckets is a 400 */
|
|
30
|
+
bucketMs: z.coerce.number().int().positive().optional(),
|
|
31
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
32
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
33
|
+
});
|
|
34
|
+
export const DEFAULT_REGRESSION_THRESHOLDS = {
|
|
35
|
+
activeWindowMs: 864e5,
|
|
36
|
+
// 24h
|
|
37
|
+
regressionGapMs: 2592e5
|
|
38
|
+
// 72h
|
|
39
|
+
};
|
|
40
|
+
export function isRegressed(row, thresholds, now) {
|
|
41
|
+
const activeStart = now - thresholds.activeWindowMs;
|
|
42
|
+
return row.lastSeen >= activeStart && row.firstInActive != null && row.prevBeforeActive != null && row.firstInActive - row.prevBeforeActive >= thresholds.regressionGapMs;
|
|
43
|
+
}
|
|
44
|
+
export function splitConcat(value) {
|
|
45
|
+
if (!value) return [];
|
|
46
|
+
return value.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
47
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zErrorInfo: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
message: z.ZodString;
|
|
5
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
6
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const zTraceContext: z.ZodObject<{
|
|
9
|
+
traceId: z.ZodString;
|
|
10
|
+
spanId: z.ZodString;
|
|
11
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const zSource: z.ZodObject<{
|
|
14
|
+
app: z.ZodString;
|
|
15
|
+
version: z.ZodOptional<z.ZodString>;
|
|
16
|
+
env: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const zCanonicalEvent: z.ZodObject<{
|
|
19
|
+
time: z.ZodNumber;
|
|
20
|
+
level: z.ZodNumber;
|
|
21
|
+
message: z.ZodString;
|
|
22
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
26
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
traceId: z.ZodString;
|
|
30
|
+
spanId: z.ZodString;
|
|
31
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
app: z.ZodString;
|
|
35
|
+
version: z.ZodOptional<z.ZodString>;
|
|
36
|
+
env: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
session: z.ZodOptional<z.ZodString>;
|
|
39
|
+
user: z.ZodOptional<z.ZodString>;
|
|
40
|
+
route: z.ZodOptional<z.ZodString>;
|
|
41
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
42
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type ErrorInfo = z.infer<typeof zErrorInfo>;
|
|
46
|
+
export type TraceContextInfo = z.infer<typeof zTraceContext>;
|
|
47
|
+
export type EventSource = z.infer<typeof zSource>;
|
|
48
|
+
export type CanonicalEvent = z.infer<typeof zCanonicalEvent>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zLevel } from "./levels.js";
|
|
3
|
+
const TRACE_ID_RE = /^[0-9a-f]{32}$/;
|
|
4
|
+
const SPAN_ID_RE = /^[0-9a-f]{16}$/;
|
|
5
|
+
export const zErrorInfo = z.object({
|
|
6
|
+
name: z.string(),
|
|
7
|
+
message: z.string(),
|
|
8
|
+
stack: z.string().optional(),
|
|
9
|
+
code: z.union([z.string(), z.number()]).optional()
|
|
10
|
+
// frogger statusCode is number; app codes may be string
|
|
11
|
+
});
|
|
12
|
+
export const zTraceContext = z.object({
|
|
13
|
+
traceId: z.string().regex(TRACE_ID_RE),
|
|
14
|
+
spanId: z.string().regex(SPAN_ID_RE),
|
|
15
|
+
parentId: z.string().regex(SPAN_ID_RE).optional()
|
|
16
|
+
// frogger's trace.flags is intentionally dropped here; see frogger-map.ts.
|
|
17
|
+
});
|
|
18
|
+
export const zSource = z.object({
|
|
19
|
+
app: z.string().min(1),
|
|
20
|
+
// required WHEN source is present
|
|
21
|
+
version: z.string().optional(),
|
|
22
|
+
env: z.string().optional()
|
|
23
|
+
// frogger execution context (ssr/csr/client/server); see caveat in frogger-map.ts
|
|
24
|
+
});
|
|
25
|
+
export const zCanonicalEvent = z.object({
|
|
26
|
+
time: z.number().int().positive(),
|
|
27
|
+
// ms epoch
|
|
28
|
+
level: zLevel,
|
|
29
|
+
message: z.string().min(1),
|
|
30
|
+
error: zErrorInfo.optional(),
|
|
31
|
+
trace: zTraceContext.optional(),
|
|
32
|
+
source: zSource.optional(),
|
|
33
|
+
// optional so the minimal stream tier ({time,level,message}) parses
|
|
34
|
+
session: z.string().optional(),
|
|
35
|
+
user: z.string().optional(),
|
|
36
|
+
route: z.string().optional(),
|
|
37
|
+
feature: z.string().optional(),
|
|
38
|
+
tags: z.array(z.string()).optional(),
|
|
39
|
+
ctx: z.record(z.string(), z.unknown()).optional()
|
|
40
|
+
// zod v4: record REQUIRES (keyType, valueType)
|
|
41
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documented frogger -> canonical field map. Data + JSDoc ONLY. CP1 writes no
|
|
3
|
+
* transform. This is the reference the CP4 ingest adapter implements against.
|
|
4
|
+
* Grounded in frogger's log.ts, batch.ts, trace-headers.ts, normalize-log-args.ts,
|
|
5
|
+
* global-error.server.ts.
|
|
6
|
+
*
|
|
7
|
+
* ## Error derivation (adapter implements in CP4)
|
|
8
|
+
* frogger lifts errors into `ctx` in two shapes:
|
|
9
|
+
* - normalize-log-args serializeError() writes ctx.error = { name, message, stack }.
|
|
10
|
+
* - global-error.server writes fields flat onto ctx (message, name, stack, cause,
|
|
11
|
+
* and for H3Error: statusCode, statusMessage, data).
|
|
12
|
+
* Resolution order:
|
|
13
|
+
* - error.name <- ctx.error.name ?? ctx.name
|
|
14
|
+
* - error.message <- ctx.error.message ?? ctx.message
|
|
15
|
+
* - error.stack <- ctx.error.stack ?? ctx.stack
|
|
16
|
+
* - error.code <- ctx.error.code ?? ctx.code ?? ctx.statusCode
|
|
17
|
+
* Emit `error` only if at least name+message (or message) resolve.
|
|
18
|
+
*
|
|
19
|
+
* ## Gap fields: ctx-key convention (frozen for CP4 + CP15)
|
|
20
|
+
* frogger emits no native session/user/route/feature; they are read from
|
|
21
|
+
* ctx.session / ctx.user / ctx.route / ctx.feature.
|
|
22
|
+
*
|
|
23
|
+
* ## Caveats
|
|
24
|
+
* - source.env is frogger EXECUTION context (ssr/csr/client/server), NOT deploy
|
|
25
|
+
* env. Mapped verbatim; deploy env rides in tags/ctx until a dedicated field exists.
|
|
26
|
+
* - Dropped fields: `type` (redundant with numeric lvl) and `trace.flags`
|
|
27
|
+
* (canonical omits). Both optionally preservable via ctx (froggerType / traceFlags).
|
|
28
|
+
* - frogger client transport sends no API-key header (bare $fetch); CP4 ingest must
|
|
29
|
+
* accept ?key= on the query string. CP1 designs no ingest.
|
|
30
|
+
*/
|
|
31
|
+
/** Every frogger LoggerObject/LoggerObjectBatch key -> canonical destination (or documented drop). */
|
|
32
|
+
export declare const FROGGER_FIELD_MAP: {
|
|
33
|
+
readonly log: {
|
|
34
|
+
readonly time: "time";
|
|
35
|
+
readonly lvl: "level";
|
|
36
|
+
readonly type: "(dropped: redundant with lvl)";
|
|
37
|
+
readonly msg: "message";
|
|
38
|
+
readonly ctx: "ctx (+ derived: error/session/user/route/feature)";
|
|
39
|
+
readonly tags: "tags";
|
|
40
|
+
readonly env: "source.env";
|
|
41
|
+
readonly 'source.name': "source.app";
|
|
42
|
+
readonly 'source.version': "source.version";
|
|
43
|
+
readonly 'trace.traceId': "trace.traceId";
|
|
44
|
+
readonly 'trace.spanId': "trace.spanId";
|
|
45
|
+
readonly 'trace.parentId': "trace.parentId";
|
|
46
|
+
readonly 'trace.flags': "(dropped: canonical omits flags)";
|
|
47
|
+
};
|
|
48
|
+
readonly batch: {
|
|
49
|
+
readonly logs: "events";
|
|
50
|
+
readonly 'app.name': "source.app";
|
|
51
|
+
readonly 'app.version': "source.version";
|
|
52
|
+
readonly meta: "meta (passthrough)";
|
|
53
|
+
};
|
|
54
|
+
readonly ctxDerived: {
|
|
55
|
+
readonly 'ctx.error': "error";
|
|
56
|
+
readonly 'ctx.session': "session";
|
|
57
|
+
readonly 'ctx.user': "user";
|
|
58
|
+
readonly 'ctx.route': "route";
|
|
59
|
+
readonly 'ctx.feature': "feature";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type FroggerFieldMap = typeof FROGGER_FIELD_MAP;
|