Skip to content

Commit f223b45

Browse files
Unified Logs (Part 1) (supabase#36298)
* init new unified page * moar logs * init * add infinite and live logs example * Update useLogsPreview.tsx * add more sources * wrapped auth logs with edge logs * add role and user id * move unified logs * init * move demo pages. create a new directory to work in * extracted beta unified logs into own components * add example base page and components * add new files to use actual logging query * more organization * change import * adds new logs page. adds new query * add data table to UI pacakges * revert * table styles * text size * add timestamp, table, icons for log types, status code styling * add host * add log count to edge functions * starts to add dynamic filtering * spiking trace UI * Update status-code.ts * add new linik * now using POST * fix chart data for default 1 hour view * update API to accept POST requests * new filters * Update level.ts * fixed up chart to work on level filter. split up the logic into new files * prep for log type * prepped query for WHERE * fix: issue with white space in url param column parsing * level param now being removed correctly. * fix issue with chart showing wrong buckets for different time ranges * remove old query * refactor the queries into function for each source * total count fixed * lots of layout * start fixing log counts * comment out min and max for a while * added trace logging prototype in * random trace logs added for demo * added logs and ui to view logs if any * add Auth user * fix the live logs issue * some left over code * Midway * First pass refactor + clean up + reorganize files * Fix TS issues * Remove unused files * Clean up * Final clean up * more clean up * More clean up * Remove unused packages * Fix * Lint * Add feature flag for unified logs * Refactor * Remove trace UI * Snake case log types * more clean up * More clean up * Fix ts * more clean up * fixes * add flag check and redirect if flag is false * Update middleware.ts * Nit lint * Fix * Last refactors --------- Co-authored-by: Jonathan Summers-Muir <[email protected]>
1 parent 7cc64d3 commit f223b45

File tree

74 files changed

+7438
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7438
-98
lines changed

apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { get, isEqual } from 'lodash'
44
import uniqBy from 'lodash/uniqBy'
55
import { useEffect } from 'react'
66

7+
import { IS_PLATFORM } from 'common'
78
import BackwardIterator from 'components/ui/CodeEditor/Providers/BackwardIterator'
89
import type { PlanId } from 'data/subscriptions/types'
910
import logConstants from 'shared-data/logConstants'
1011
import { LogsTableName, SQL_FILTER_TEMPLATES } from './Logs.constants'
1112
import type { Filters, LogData, LogsEndpointParams } from './Logs.types'
12-
import { IS_PLATFORM } from 'common'
1313

1414
/**
1515
* Convert a micro timestamp from number/string to iso timestamp

apps/studio/components/interfaces/Sidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ const ProjectLinks = () => {
223223
const { securityLints, errorLints } = useLints()
224224

225225
const showWarehouse = useFlag('warehouse')
226+
const showUnifiedLogs = useFlag('unifiedLogs')
226227
const isSqlEditorTabsEnabled = useIsSQLEditorTabsEnabled()
227228

228229
const activeRoute = router.pathname.split('/')[3]
@@ -248,7 +249,7 @@ const ProjectLinks = () => {
248249
storage: storageEnabled,
249250
realtime: realtimeEnabled,
250251
})
251-
const otherRoutes = generateOtherRoutes(ref, project)
252+
const otherRoutes = generateOtherRoutes(ref, project, { unifiedLogs: showUnifiedLogs })
252253
const settingsRoutes = generateSettingsRoutes(ref, project)
253254

254255
return (

0 commit comments

Comments
 (0)