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 logs-settings-drop-rules flag (#82678)

Frank Hamandba7bc45a05a0
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index f63f967e39ae..e8eec149edbb 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -370,7 +370,6 @@ export const FEATURE_FLAGS = {
LOGS_SERVICES_VIEW: 'logs-services-view', // owner: #team-logs
LOGS_SERVICES_VIEW_V2: 'logs-services-view-v2', // owner: #team-logs
LOGS_SETTINGS: 'logs-settings', // owner: #team-logs
- LOGS_SETTINGS_DROP_RULES: 'logs-settings-drop-rules', // owner: #team-logs
LOGS_SETTINGS_JSON: 'logs-settings-json', // owner: #team-logs
LOGS_SETTINGS_PII_SCRUB: 'logs-settings-pii-scrub', // owner: #team-logs
LOGS_SETTINGS_RETENTION_RULES: 'logs-settings-retention-rules', // owner: #team-logs
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index b95bd6f1a93b..e565879e0d81 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -883,7 +883,6 @@ export const SETTINGS_MAP: SettingSection[] = [
description:
'Drop matching log lines before storage using ordered rules. Rules run in ingestion order (after optional scrub and JSON parse).',
component: <LogsSamplingSection />,
- flag: LogsFeatureFlagKeys.dropRules,
keywords: ['drop', 'exclude', 'filter', 'rules', 'path', 'attribute', 'volume', 'noise'],
},
{
diff --git a/products/logs/backend/presentation/views/sampling_api.py b/products/logs/backend/presentation/views/sampling_api.py
index 47ac915a8e94..8e8451b6562d 100644
--- a/products/logs/backend/presentation/views/sampling_api.py
+++ b/products/logs/backend/presentation/views/sampling_api.py
@@ -18,7 +18,6 @@ from posthog.schema import PropertyGroupFilter
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.event_usage import report_user_action
from posthog.models.user import User
-from posthog.permissions import PostHogFeatureFlagPermission
from products.logs.backend.models import LogsExclusionRule
from products.logs.backend.presentation.filter_group_validation import (
@@ -274,8 +273,6 @@ class LogsSamplingRuleViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
queryset = LogsExclusionRule.objects.all().order_by("priority", "created_at")
serializer_class = LogsSamplingRuleSerializer
lookup_field = "id"
- posthog_feature_flag = "logs-settings-drop-rules"
- permission_classes = [PostHogFeatureFlagPermission]
def safely_get_queryset(self, queryset: QuerySet) -> QuerySet:
return queryset.filter(team_id=self.team_id)
diff --git a/products/logs/frontend/components/LogsSampling/LogsSamplingSection.tsx b/products/logs/frontend/components/LogsSampling/LogsSamplingSection.tsx
index 0bdfa714fa3d..4a989e3186b2 100644
--- a/products/logs/frontend/components/LogsSampling/LogsSamplingSection.tsx
+++ b/products/logs/frontend/components/LogsSampling/LogsSamplingSection.tsx
@@ -1,17 +1,9 @@
import { BindLogic } from 'kea'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
-
-import { LogsFeatureFlagKeys } from 'products/logs/frontend/logsFeatureFlagKeys'
-
import { LogsSamplingRulesSortableTable } from './LogsSamplingRulesSortableTable'
import { logsSamplingSectionLogic } from './logsSamplingSectionLogic'
-export function LogsSamplingSection(): JSX.Element | null {
- const enabled = useFeatureFlag(LogsFeatureFlagKeys.dropRules)
- if (!enabled) {
- return null
- }
+export function LogsSamplingSection(): JSX.Element {
return (
<BindLogic logic={logsSamplingSectionLogic} props={{}}>
<div className="space-y-3">
diff --git a/products/logs/frontend/components/LogsServices/LogsServices.tsx b/products/logs/frontend/components/LogsServices/LogsServices.tsx
index ab8501a47645..05ba733e352c 100644
--- a/products/logs/frontend/components/LogsServices/LogsServices.tsx
+++ b/products/logs/frontend/components/LogsServices/LogsServices.tsx
@@ -6,12 +6,10 @@ import { LemonBanner, LemonButton, LemonInput, LemonSelect, LemonTable, LemonTag
import type { LemonTableColumns } from '@posthog/lemon-ui'
import { Sparkline } from 'lib/components/Sparkline'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { humanFriendlyNumber } from 'lib/utils/numbers'
import { urls } from 'scenes/urls'
import { logsViewerModalLogic } from 'products/logs/frontend/components/LogsViewer/LogsViewerModal/logsViewerModalLogic'
-import { LogsFeatureFlagKeys } from 'products/logs/frontend/logsFeatureFlagKeys'
import { logsServicesLogic, SERVICES_PAGE_SIZE, ServiceRow } from './logsServicesLogic'
import { copyServiceDeepLink } from './serviceViewerUrl'
@@ -154,7 +152,6 @@ export function LogsServices(): JSX.Element {
} = useValues(logsServicesLogic)
const { setDateFrom, setPage, setSearchTerm, setSorting } = useActions(logsServicesLogic)
const { openLogsViewerModal } = useActions(logsViewerModalLogic)
- const samplingRulesUi = useFeatureFlag(LogsFeatureFlagKeys.dropRules)
const [rulesExpandAll, setRulesExpandAll] = useState(false)
const [rulesExpandedByService, setRulesExpandedByService] = useState<Record<string, boolean>>({})
@@ -163,7 +160,7 @@ export function LogsServices(): JSX.Element {
() => services.filter((s) => (s.active_rules?.length ?? 0) > RULES_PREVIEW_COUNT),
[services]
)
- const showRulesBulkControls = samplingRulesUi && servicesWithManyRules.length > 0
+ const showRulesBulkControls = servicesWithManyRules.length > 0
useEffect(() => {
if (servicesWithManyRules.length === 0) {
@@ -232,43 +229,39 @@ export function LogsServices(): JSX.Element {
sorter: true,
align: 'right',
},
- ...(samplingRulesUi
- ? ([
- {
- title: showRulesBulkControls ? (
- <div className="flex items-center gap-2 min-w-0">
- <span className="shrink-0">Rules</span>
- <LemonButton
- size="xsmall"
- type="secondary"
- onClick={() => {
- if (rulesExpandAll) {
- setRulesExpandAll(false)
- setRulesExpandedByService({})
- } else {
- setRulesExpandAll(true)
- setRulesExpandedByService({})
- }
- }}
- >
- {rulesExpandAll ? 'Collapse all' : 'Expand all'}
- </LemonButton>
- </div>
- ) : (
- 'Rules'
- ),
- key: 'active_rules',
- render: (_: unknown, row: ServiceRow) => (
- <ServiceRulesCell
- row={row}
- rulesExpandAll={rulesExpandAll}
- rulesExpandedByService={rulesExpandedByService}
- onToggleRow={toggleServiceRulesExpanded}
- />
- ),
- },
- ] as LemonTableColumns<ServiceRow>)
- : []),
+ {
+ title: showRulesBulkControls ? (
+ <div className="flex items-center gap-2 min-w-0">
+ <span className="shrink-0">Rules</span>
+ <LemonButton
+ size="xsmall"
+ type="secondary"
+ onClick={() => {
+ if (rulesExpandAll) {
+ setRulesExpandAll(false)
+ setRulesExpandedByService({})
+ } else {
+ setRulesExpandAll(true)
+ setRulesExpandedByService({})
+ }
+ }}
+ >
+ {rulesExpandAll ? 'Collapse all' : 'Expand all'}
+ </LemonButton>
+ </div>
+ ) : (
+ 'Rules'
+ ),
+ key: 'active_rules',
+ render: (_, row) => (
+ <ServiceRulesCell
+ row={row}
+ rulesExpandAll={rulesExpandAll}
+ rulesExpandedByService={rulesExpandedByService}
+ onToggleRow={toggleServiceRulesExpanded}
+ />
+ ),
+ },
{
title: 'Volume trend',
key: 'sparkline',
diff --git a/products/logs/frontend/logsFeatureFlagKeys.ts b/products/logs/frontend/logsFeatureFlagKeys.ts
index b5fc44003052..b617b8a14c07 100644
--- a/products/logs/frontend/logsFeatureFlagKeys.ts
+++ b/products/logs/frontend/logsFeatureFlagKeys.ts
@@ -2,11 +2,9 @@ import type { FeatureFlagLookupKey } from 'lib/constants'
/** `keyof FEATURE_FLAGS` for `useFeatureFlag` and settings `flag` — not remote slug strings. */
export const LogsFeatureFlagKeys = {
- dropRules: 'LOGS_SETTINGS_DROP_RULES',
metricRules: 'LOGS_METRIC_RULES',
retentionRules: 'LOGS_SETTINGS_RETENTION_RULES',
} as const satisfies {
- dropRules: FeatureFlagLookupKey
metricRules: FeatureFlagLookupKey
retentionRules: FeatureFlagLookupKey
}