Skip to content

feat(config): default STORE_MIN_SEVERITY=WARN for all drivers (don't persist INFO/DEBUG, keep analytics)#119

Merged
aksOps merged 1 commit into
mainfrom
feat/default-store-warn
Jun 18, 2026
Merged

feat(config): default STORE_MIN_SEVERITY=WARN for all drivers (don't persist INFO/DEBUG, keep analytics)#119
aksOps merged 1 commit into
mainfrom
feat/default-store-warn

Conversation

@aksOps

@aksOps aksOps commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Make STORE_MIN_SEVERITY=WARN the global default (was "" globally, WARN only on SQLite). On every driver, INFO/DEBUG logs now reach in-memory consumers but are not persisted to the relational DB — only WARN/ERROR/FATAL grow the store.

  • config.go: StoreMinSeverity default """WARN"; removed the now-redundant SQLite-only override from applyDriverDefaults (WARN is global; SQLite no longer differs).
  • driver_defaults_test.go + CLAUDE.md updated to match.

Why it doesn't lose state/analytics

The store gate is existence-preserving for analytics, verified two ways:

  • pipeline.process skips the DB row-write for sub-WARN logs but still fires LogCallback over the full batch — proven by TestPipeline_StoreMinSeverity_DropsBelowThresholdFromPersist (INFO not persisted, yet its LogCallback fires).
  • The 60s GraphRAG refresh rebuilds topology from the spans table, not logs (refresh.go) — so in-memory state/clustering doesn't depend on what logs are persisted.

So GraphRAG, Drain clustering, anomaly detection, and span/trace correlation keep seeing INFO; the DB just doesn't store it.

Stats impact

  • Unaffected (trace/span-derived): error rate, avg/p99 latency, active services, top-failing-services, service health.
  • Reflects WARN+ only (by design): the DB-derived TotalLogs dashboard count and log search (/api/logs, search_logs).
  • Store-skips are observable via Pipeline.Stats().StoreFiltered.

⚠️ Cross-driver behavior change

This changes Postgres/MySQL/MSSQL too — they previously stored INFO by default and now won't. If you want INFO persisted on a given deployment, set STORE_MIN_SEVERITY=INFO (or ""). Easy to scope back to SQLite-only if preferred — say the word.

INGEST_MIN_SEVERITY stays INFO, so DEBUG is still dropped at the receiver (not analysed either). To also feed DEBUG into in-memory analytics, set INGEST_MIN_SEVERITY=DEBUG (raises in-memory event volume).

Verification

go build/vet, gofmt clean, config tests (55), full suite 678 pass / 28 pkgs.

🤖 Generated with Claude Code

Make WARN the global default for the store-severity gate (was "" globally,
WARN only on SQLite). INFO/DEBUG logs now reach in-memory consumers
(GraphRAG, Drain clustering, span/trace correlation) but are NOT persisted to
the relational DB on any driver — only WARN/ERROR/FATAL grow the store.

Analytics are preserved by construction: pipeline.process skips the DB row
write for sub-WARN logs but still fires LogCallback over the FULL batch
(TestPipeline_StoreMinSeverity_DropsBelowThresholdFromPersist), and the 60s
GraphRAG refresh rebuilds topology from the spans table, not logs — so
in-memory state/analytics don't depend on what's persisted.

- config.go: StoreMinSeverity default "" -> "WARN"; remove the now-redundant
  SQLite-only override from applyDriverDefaults (WARN is global; SQLite no
  longer differs).
- driver_defaults_test.go + CLAUDE.md updated to match.

INGEST_MIN_SEVERITY stays INFO, so DEBUG is still dropped at the receiver
(not analysed either). Set INGEST_MIN_SEVERITY=DEBUG to also feed DEBUG into
in-memory analytics (raises in-memory event volume).

Stats impact: error-rate/latency/p99/health/top-failing-services are
trace/span-derived and unaffected; only the DB-derived TotalLogs count and
log search reflect the WARN+ stored set (by design). Store-skips are metered
via Pipeline.Stats().StoreFiltered.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG
@sonarqubecloud

Copy link
Copy Markdown

@aksOps aksOps merged commit b45ddbe into main Jun 18, 2026
17 checks passed
@aksOps aksOps deleted the feat/default-store-warn branch June 18, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant