Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(logs): remove fully rolled-out new-logs-date-range-picker flag (#67079)

Jon McCallume9af6d0322c3
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 40f2ac2a035f..6eba1e7283ee 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -379,7 +379,6 @@ export const FEATURE_FLAGS = {
MCP_SERVERS: 'mcp-servers', // owner: #team-posthog-ai
MESSAGING_SES: 'messaging-ses', // owner #team-workflows
METRICS: 'metrics', // owner: #team-apm (@jonmcwest, @frankh)
- NEW_LOGS_DATE_RANGE_PICKER: 'new-logs-date-range-picker', // owner: #team-logs
NEW_TAB_PROJECT_EXPLORER: 'new-tab-project-explorer', // owner: #team-platform-ux
NEW_TEAM_CORE_EVENTS: 'new-team-core-events', // owner: @jabahamondes #team-web-analytics
NOTEBOOK_PYTHON: 'notebook-python', // owner: #team-data-tools
diff --git a/products/logs/frontend/components/LogsViewer/Filters/DateRangeFilter.tsx b/products/logs/frontend/components/LogsViewer/Filters/DateRangeFilter.tsx
deleted file mode 100644
index 625338724ad2..000000000000
--- a/products/logs/frontend/components/LogsViewer/Filters/DateRangeFilter.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import { useActions, useValues } from 'kea'
-
-import { DateFilter } from 'lib/components/DateFilter/DateFilter'
-import { CUSTOM_OPTION_KEY } from 'lib/components/DateFilter/types'
-import { dayjs } from 'lib/dayjs'
-import { DATE_TIME_FORMAT, formatDateRange } from 'lib/utils/datetime'
-
-import { DateMappingOption } from '~/types'
-
-import { logsViewerFiltersLogic } from 'products/logs/frontend/components/LogsViewer/Filters/logsViewerFiltersLogic'
-
-const dateMapping: DateMappingOption[] = [
- { key: CUSTOM_OPTION_KEY, values: [] },
- {
- key: 'Last 5 minutes',
- values: ['-5M'],
- getFormattedDate: (date: dayjs.Dayjs): string => {
- return date.subtract(5, 'minute').format(DATE_TIME_FORMAT)
- },
- defaultInterval: 'minute',
- },
- {
- key: 'Last 30 minutes',
- values: ['-30M'],
- getFormattedDate: (date: dayjs.Dayjs): string => {
- return date.subtract(30, 'minute').format(DATE_TIME_FORMAT)
- },
- defaultInterval: 'minute',
- },
- {
- key: 'Last 1 hour',
- values: ['-1h'],
- getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.subtract(1, 'h'), date.endOf('d')),
- defaultInterval: 'hour',
- },
- {
- key: 'Last 4 hours',
- values: ['-4h'],
- getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.subtract(4, 'h'), date.endOf('d')),
- defaultInterval: 'hour',
- },
- {
- key: 'Last 24 hours',
- values: ['-24h'],
- getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.subtract(24, 'h'), date.endOf('d')),
- defaultInterval: 'hour',
- },
- {
- key: 'Last 7 days',
- values: ['-7d'],
- getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.subtract(7, 'd'), date.endOf('d')),
- defaultInterval: 'day',
- },
-]
-
-export const DateRangeFilter = (): JSX.Element => {
- const { filters } = useValues(logsViewerFiltersLogic)
- const { dateRange } = filters
- const { setDateRange } = useActions(logsViewerFiltersLogic)
-
- return (
- <DateFilter
- size="small"
- dateFrom={dateRange.date_from}
- dateTo={dateRange.date_to}
- dateOptions={dateMapping}
- onChange={(changedDateFrom, changedDateTo) => {
- setDateRange({ date_from: changedDateFrom, date_to: changedDateTo })
- }}
- allowTimePrecision
- allowFixedRangeWithTime
- allowedRollingDateOptions={['minutes', 'hours', 'days', 'weeks', 'months']}
- use24HourFormat
- />
- )
-}
diff --git a/products/logs/frontend/components/LogsViewer/Filters/LogsFilterBar/LogsFilterBar.tsx b/products/logs/frontend/components/LogsViewer/Filters/LogsFilterBar/LogsFilterBar.tsx
index a1fbf522ce99..127bea72f5f6 100644
--- a/products/logs/frontend/components/LogsViewer/Filters/LogsFilterBar/LogsFilterBar.tsx
+++ b/products/logs/frontend/components/LogsViewer/Filters/LogsFilterBar/LogsFilterBar.tsx
@@ -1,7 +1,7 @@
import { BindLogic, useActions, useValues } from 'kea'
import { useRef, useState } from 'react'
-import { IconMinusSquare, IconPlusSquare, IconRefresh } from '@posthog/icons'
+import { IconRefresh } from '@posthog/icons'
import { LemonButton, LemonDropdown } from '@posthog/lemon-ui'
import { InfiniteSelectResults } from 'lib/components/TaxonomicFilter/InfiniteSelectResults'
@@ -28,7 +28,6 @@ import { logsViewerFiltersLogic } from 'products/logs/frontend/components/LogsVi
import { LogsFullScreenButton } from 'products/logs/frontend/components/LogsViewer/LogsFullScreenButton'
import { SavedViewsButton } from 'products/logs/frontend/components/LogsViews/SavedViewsButton'
-import { DateRangeFilter } from '../DateRangeFilter'
import { FilterHistoryDropdown } from '../FilterHistoryDropdown'
import { LogsDateRangePicker } from '../LogsDateRangePicker/LogsDateRangePicker'
import { ServiceFilter } from '../ServiceFilter'
@@ -93,36 +92,15 @@ export const LogsFilterBar = ({
* rather than collapsing in this top bar and shifting its layout.
*/
export const LogsQueryControls = (): JSX.Element => {
- const newLogsDateRangePicker = useFeatureFlag('NEW_LOGS_DATE_RANGE_PICKER')
const { logsLoading, liveTailRunning } = useValues(logsViewerDataLogic)
const { runQuery } = useActions(logsViewerDataLogic)
- const { zoomDateRange, setDateRange } = useActions(logsViewerFiltersLogic)
+ const { setDateRange } = useActions(logsViewerFiltersLogic)
const { filters } = useValues(logsViewerFiltersLogic)
const { dateRange } = filters
return (
<div className="flex shrink-0 gap-1.5">
- {newLogsDateRangePicker ? (
- <LogsDateRangePicker dateRange={dateRange} setDateRange={setDateRange} />
- ) : (
- <div className="flex">
- <LemonButton
- size="small"
- icon={<IconMinusSquare />}
- type="secondary"
- tooltip="Zoom out"
- onClick={() => zoomDateRange(2)}
- />
- <DateRangeFilter />
- <LemonButton
- size="small"
- icon={<IconPlusSquare />}
- type="secondary"
- tooltip="Zoom in"
- onClick={() => zoomDateRange(0.5)}
- />
- </div>
- )}
+ <LogsDateRangePicker dateRange={dateRange} setDateRange={setDateRange} />
<LemonButton
size="small"