feat(logs): expose severity_text on the log_attributes HogQL table - #70635
Conversation
🤖 CI report✅ ClickHouse migration SQL — noneNo ClickHouse migrations in the latest push. |
09d654b to
d24f2c6
Compare
f0a924e to
152e6c0
Compare
Make severity_text queryable on the log_attributes table. The column is backed by log_attributes3, which log_attributes_distributed points at in the cloud logs cluster once the cutover migration lands. Generated-By: PostHog Code Task-Id: 67487c28-0690-457e-81e7-6069460f2124
152e6c0 to
8542ed4
Compare
|
Reviews (1): Last reviewed commit: "feat(logs): expose severity_text on the ..." | Re-trigger Greptile |
|
Note 🤖 stamphog reviewed Greptile raised an unresolved, substantive concern: if this merges/deploys before the stacked migration PR that repoints log_attributes_distributed to log_attributes3, selecting severity_text will fail at query time against the still-log_attributes2-backed table. That's a real production-breakage risk tied to merge/deploy ordering, not addressed in the diff or thread.
Gate mechanics and policy version
|
There was a problem hiding this comment.
Small schema addition with the raised deploy-ordering concern addressed by the author and resolved, plus a current-head human approval from @jonmcwest.
- Author wrote 0% of the modified lines and has 13 merged PRs in these paths (familiarity MODERATE).
- greptile-apps[bot], jonmcwest reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 5L, 1F substantive — within ceiling |
| tier | ✓ | T1-agent / T1a-trivial (5L, 1F, single-area, feat) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ c10f860 · reviewed head 8542ed4 |
Problem
The logs facet-filtering work needs
severity_textto be queryable on thelog_attributesHogQL table. The physical column lives onlog_attributes3, whichlog_attributes_distributedpoints at after the cutover migration. This PR adds the field to the HogQL schema so it can be selected and faceted.Changes
severity_texttoLogAttributesTable.fieldsinposthog/hogql/database/schema/logs.py.Important
Stacked on #70496 (the migration that repoints
log_attributes_distributedatlog_attributes3). This PR must merge after that one - until the distributed table is backed bylog_attributes3,severity_textdoes not exist on the underlying table and a query selecting it would error. GitHub will retarget this PR tomasterautomatically once the base merges.How did you test this code?
Automated only (I'm an agent - no manual query against a live cluster):
severity_textresolves onLogAttributesTableandto_printed_clickhouse()still printslog_attributes_distributed.ruff check/ruff format --checkclean.Automatic notifications
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Frank asked me (Claude, via PostHog Code) to split the HogQL
severity_textfield out of the migration PR into its own PR, so the migration PR stays migration-only per the ClickHouse migration-only-PR convention. I rewrote the migration branch to drop the field and stacked this PR on top of it.Created with PostHog Code