facets: restore top-level + severity facets, empty-state row, more tests#401
Merged
Conversation
The previous PR dropped facets whose paths weren't in
flattenedOtelAttributes — that excluded both top-level columns
(level/name/kind/status_code/severity_*) and OTel paths the catalog
walker didn't observe.
This change:
- Adds FCTopLevel field category; ProcessMessage.extractObservation
now also walks the row's top-level columns (name/kind/level/
status_code/status_message/severity.*) into the catalog. toFacetSummary
emits these bare (no attributes./resource. prefix).
- Adds severity.severity_text and severity.severity_number to
flattenedOtelAttributes so KQL compiles them to flat-column
scans on severity___severity_*.
- Adds topLevelOtelColumns Set in Pkg.Parser.Expr — bare columns
that are fast-filter targets. prop_facetsAreFast accepts membership
in either set.
- Restores the dropped facetDefs entries (level, name, kind,
status_code, plus a Severity group with severity_text/_number/
status_message). FacetGroup gains FGSeverity.
- renderFacets now shows a "no values in window" row for facets with
no observed values (instead of dropping them silently). The
round-13 section-level filter is reverted since groups now always
have at least one row.
- Three new high-level tests in FacetsSpec:
* Layer A: GET /api/v1/facets returns dotted keys only, no ___.
* Layer A: renderFacets HTML contains data-field markers keyed by
the canonical dotted path; empty-state row is present.
* Doctest-style: every facet path is in the fast-filter sets.
Plus an extension to the ingestion round-trip test that asserts
name/level/severity.severity_text show up post-flush.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #399. Restores facets that got dropped in the consolidation, adds an empty-state row for facets with no observed values, and lays down three high-level tests that pin the renderer↔producer contract.
FCTopLevelfield category;ProcessMessage.extractObservationnow walks the span's flat columns (name,kind,level,status_code,status_message,severity.*) into the catalog.toFacetSummaryemits these bare.level,name,kind,status_codeare back in the Common Filters group; a new Severity group hostsseverity.severity_text,severity.severity_number,status_message.severity.severity_textandseverity.severity_numberjoinflattenedOtelAttributes. A newtopLevelOtelColumnsset inPkg.Parser.Exprcarries the bare columns.prop_facetsAreFastaccepts membership in either set.apiFacetshandler —GET /api/v1/facetsreturns dotted keys only; no___keys leak.FacetSummaryintorenderFacets, assert the HTML carriesdata-field="<dotted>"markers, group headers render, and the empty-state row appears for unpopulated facets.name,level,severity.severity_textshow up post-flush via the new FCTopLevel path.facetDefsentry sits inflattenedOtelAttributes∪topLevelOtelColumns.Test plan
cabal test doctests --test-option="--match=Pages.LogExplorer.Log"— passes (whitelist invariant intact)USE_EXTERNAL_DB=true cabal test integration-tests --test-option="--match=/Facets/"— 9 / 9 examples passhlintclean on the touched files/p/<pid>/log_explorer, confirm Severity + Common Filter sections render, and empty facets show the muted "no values in window" row instead of disappearing.🤖 Generated with Claude Code