Introducing a new way to review your PRs.

Read the announcement

hyperdxio / hyperdx

Resolve production issues, fast. An open source observability platform unifying session replays, logs, metrics, traces and errors powered by ClickHouse and OpenTelemetry.

View on GitHub

19 documents · Updated Oct 30, 2026

docs / search-and-log-exploration

Search and log exploration

Search and log exploration is the telemetry search experience for finding log records and trace spans in a time range. It turns a source definition, a text or SQL condition, selected fields, and side-panel filters into searchable results that can be inspected, compared, grouped, saved, and followed into related traces or sessions. See also Explorer and query experience, Trace investigation, Session replay and exploration, Metric exploration, and LLM observability.

Search experience

The search screen presents a source selector, field and sort controls, a search condition, a time range, and a results area. A source is either a log source or a trace source. The source gives the screen the table and the meaning of fields such as time, body, severity, service, trace ID, and span duration.

The screen supports three analysis modes:

ModePurpose
Results TableShow matching log records or trace spans for row-by-row inspection.
Event DeltasCompare trace activity over time and find changes in event volume or duration.
Event PatternsGroup similar event bodies to expose common and unusual patterns.

Results can run as a live tail. In this mode the time window advances and the screen refreshes at the selected rate. Scrolling the table, opening a row, expanding a row, or selecting a non-live analysis mode moves the screen to a fixed range so the reader can inspect stable data.

The time chart and result count describe the same selected range as the table. Selecting a chart series applies its group value as a real search filter, which keeps the chart and table aligned instead of changing only the chart display. A chart or table row can also open a fixed event search with its variables resolved and its group or value range represented as search filters.

The trace comparison view combines a heatmap with an event-delta view. The event-delta view is available before a heatmap rectangle is selected, so the distribution view can render as soon as the search is ready. The heatmap measures a selected value, such as span duration, against an event count and uses a linear or logarithmic scale. A selected rectangle becomes the bounds for the delta comparison. Adding a filter or changing the time range clears those bounds so the comparison does not use a selection from a different query or axis. The display settings control changes the measured value, count expression, and scale through the search URL. The heatmap also mirrors URL selection bounds after a chart redraw, so the visible rectangle stays aligned with the comparison query. Its color legend remains visible with the delta view so the measured scale stays clear.

The screen can show generated SQL and query timing. These views help an engineer understand the query that represents the current search without changing the search itself.

References: packages/…/DBSearchPage.tsx• L1005-1085 packages/…/DBSearchPage.tsx• L1576-1649 packages/…/DBSearchPage.tsx• L1811-1861 packages/…/DBSearchPage.tsx• L2388-2755 packages/…/DBSearchHeatmapChart.tsx• L32-235 packages/…/DBSearchHeatmapChart.test.tsx• L127-196 packages/…/ChartUtils.tsx• L1172-1289 packages/…/eventsSearchUrl.test.ts• L65-190

Search state

Search state is the set of choices that defines one query. The URL carries the source, selected fields, condition, condition language, structured filters, sort order, analysis mode, time range, live-tail settings, and heatmap display and selection state. The form mirrors this state so browser navigation and shared links can restore the same search.

Search expressions and JSON filter state use URL parsers that protect spaces, quotes, brackets, and other special characters when a link passes through a system that re-encodes URL values. The parsers also accept older URL forms. A JSON validator can discard malformed state so a stale or hand-edited link falls back to a safe default instead of reaching the page as an invalid object.

The condition accepts either Lucene syntax or SQL syntax. Facet actions add structured filters beside that condition. Ad hoc filter pills choose operators for the active language: SQL offers equality, regular-expression, and LIKE forms, while PromQL exposes only its supported subset. The page submits the form as one search configuration, while facet changes use a short debounce so several quick changes do not start several queries.

Filter condition editors support suggested keys and values without requiring the reader to use a suggestion. The key is trimmed and settled before value suggestions are requested. The editor keeps those suggestions tied to the current key, accepts free text, and uses Enter to move from the key to the value or to apply the complete condition.

Filter state has two forms with different jobs:

FormRole
In-memory filter stateUses clean logical field names and sets of included or excluded values. This is the form shown by the filter controls and restored from user-facing filter input.
SQL query expressionConverts a logical field into a safe raw SQL expression when a facet, distribution, or result-column query needs it. Map paths use bracket access, special column names use identifier quoting, and existing SQL function expressions stay unchanged.

The filter model supports value inclusion, value exclusion, numeric ranges, clear actions, and an “Only” action. Map fields can arrive in dot form or bracket form, so the panel treats both forms as one logical field. When the source changes, filters whose fields do not exist in the new source are removed. The screen reports that change so an old filter does not silently produce a different result set.

References: packages/…/DBSearchPage.tsx• L1012-1025 packages/…/DBSearchPage.tsx• L1175-1412 packages/…/searchFilters.tsx• L19-43 packages/…/searchFilters.tsx• L81-317 packages/…/queryParsers.ts• L8-37 packages/…/queryParsers.ts• L39-108 packages/…/FilterAutocomplete.tsx• L4-69 packages/…/FilterConditionEditor.tsx• L42-131 packages/…/filterOperators.ts• L8-48 packages/…/utils.ts• L217-326

Dashboard filter state

Dashboard filters are reusable controls that can shape queries across dashboard tiles. A filter can get its values from a telemetry source, from a list authored by the user, or from a Prometheus label source. A filter can also publish a named variable or broadcast its value to all sources or to a selected set of sources.

Dashboard filter definitions use a separate contract from the facet filters for one search. The editor keeps shared values while a user changes filter type, then saves only the fields that belong to the final type. This prevents stale query fields from remaining on a static filter and stale option values from remaining on a queried filter.

Selection rules are part of the filter contract. A required filter can block only the tiles that use it or the whole dashboard. A single-select filter limits the user to one value. The list shows the value source, broadcast reach, requirement state, and variable name so the effect of a filter is visible before it is edited.

References: packages/…/DashboardFiltersList.tsx• L50-102 packages/…/DashboardFiltersList.tsx• L104-207 packages/…/DashboardFiltersModal.test.tsx• L96-178 packages/…/DashboardFiltersModal.test.tsx• L192-309 packages/…/DashboardFiltersModal.test.tsx• L329-477 packages/…/filterFormState.test.ts• L85-193 packages/…/filterFormState.test.ts• L221-340

Filter panel

The filter panel turns source or table metadata into facet controls. A source is authoritative when it is available. The panel uses a supplied table connection only when there is no source or when a metric source does not name the table that contains its rows. It discovers usable fields and values for the current time range, then shows the fields that are most useful for the current source.

Large value lists provide a small search input. It narrows the values shown in the open field and sorts matches for quick scanning. Nested JSON or map fields provide a similar key search, then virtualize the child field list so a source with many properties remains usable. Child groups keep their open state and distribution setting when filtering or scrolling temporarily removes their rows from the page. Selected values stay visible even when they are outside the currently loaded facet page.

Facet discovery starts with useful low-cardinality and nested fields, can reveal more fields on request, and shows fields in request order while their values are still arriving. The panel keeps a loading placeholder for fields that have not returned yet. The all mode discovers values across the wider source scope, while exact mode uses the active filter scope. Loading more values for one field adds to the current values instead of replacing them. Extra values are cleared when the source, table, time range, filter scope, search condition, condition language, or discovery mode changes.

Map and JSON facets are grouped by their base field. Dot-form and bracket-form names for the same property collapse into one child while the query keeps a canonical SQL key. The panel keeps clean display and filter keys separate from quoted SQL expressions, so nested paths, columns with special characters, and SQL function expressions remain valid when used for value discovery, distributions, or added result columns.

The panel has separate shared and personal behavior. Team-pinned fields and values appear in a shared section. Personal pins remain local to the user and browser. Both sets are merged for display, while shared items remain identifiable and can be managed separately.

Value distributions are optional. When enabled, they show the approximate share of rows for a field value under that field's own filter. A single allowed value can show an exact 100% share, while other values do not show a misleading percentage. The panel keeps selected and pinned values visible even when they are not in the first returned page.

The panel also controls result presentation. It can hide or show the panel, switch analysis mode, show filter counts, show more fields, and add or remove result columns. Trace sources can expose a root-spans-only choice. Log results can expose denoising, which hides common patterns from the table without changing the underlying search condition.

References: packages/…/DBSearchPageFilters.tsx• L1182-1415 packages/…/DBSearchPageFilters.tsx• L1490-1648 packages/…/DBSearchPageFilters.tsx• L1698-1930 packages/…/hooks.ts• L41-213 packages/…/hooks.ts• L215-302 packages/…/hooks.ts• L305-437 packages/…/utils.ts• L28-65 packages/…/utils.ts• L91-326

Result side panel

Selecting a result opens a detail panel for the selected row. The panel keeps the result list usable while the reader moves between rows, and it closes when the reader clicks outside the result area. The selected row is represented in the URL, so a shared link can open the same detail view.

The panel starts with the view that fits the source. Log rows can show an overview and column values. Trace rows can show the trace view. Other available tabs add service maps, surrounding context, session replay, and infrastructure context when the row provides the needed links or attributes.

The overview turns source-defined body, severity, time, service, resource attributes, and event attributes into readable sections. It can also expose HTTP data, exceptions, span events, and span links. Attribute values can become new search filters or links to another search when the selected row belongs to the current source.

The panel supports two navigation relationships:

  1. Same-source navigation moves from one row to a nearby row, such as a row chosen from surrounding context.
  2. Cross-source navigation moves from a log row to a related trace or from a span link to another source.

Breadcrumbs and Back return through these levels. The panel remembers the reader’s useful reading tab, but it chooses a valid tab when the destination source does not support that view.

References: packages/…/DBSqlRowTableWithSidebar.tsx• L29-151 packages/…/DBRowSidePanel.tsx• L274-415 packages/…/DBRowSidePanel.tsx• L762-842 packages/…/DBRowSidePanel.tsx• L973-1185 packages/…/useSidePanelStack.ts• L27-90

The following diagram shows how a row selection becomes a detail view and can lead to related telemetry.

flowchart LR
    A[Search results row] --> B[Row detail lookup]
    B --> C[Overview or column values]
    B --> D[Surrounding context]
    B --> E[Related trace, session, or infrastructure]
    D --> F[Same-source row]
    E --> G[Cross-source row]
    F --> H[Breadcrumb trail]
    G --> H

References: packages/…/DBRowDataPanel.tsx• L43-88 packages/…/DBRowOverviewPanel.tsx• L205-389 packages/…/DBRowSidePanel.types.ts• L4-47

Saved searches

A saved search gives a search configuration a name and an optional set of tags. It stores the source, selected fields, condition and language, filters, and sort order. The time range and temporary heatmap selection are not part of the saved configuration, so a saved search can be opened against the reader’s current time range without carrying over an old comparison rectangle.

Creating a saved search records the current search and opens its saved-search route. Updating changes the stored definition. The saved-search list supports search by name, tag filtering, favorites, and deletion. Saved searches can also feed alert setup in cloud mode.

Cloud mode reads and writes saved searches through the server. Local mode uses browser storage instead. This keeps local exploration usable without cloud-only alert data, while the search screen keeps the same user-facing model in both modes.

References: packages/…/DBSearchPage.tsx• L442-707 packages/…/DBSearchPage.tsx• L1133-1157 packages/…/DBSearchPage.tsx• L1193-1221 packages/…/DBSearchPage.tsx• L1513-1574 packages/…/DBSearchHeatmapChart.tsx• L49-58 packages/…/DBSearchHeatmapChart.tsx• L188-208 packages/…/savedSearch.ts• L16-99 packages/…/localStore.ts• L111-114

Source metadata

Source metadata tells the search experience how to interpret telemetry. It connects a source to a database table and connection, names the time and body expressions, sets default result fields, and identifies log or trace attributes. These rules let the same search screen work with different table layouts.

The source’s default select expression supplies the first result columns. A reader can replace it for one search. The timestamp expression gives the query its time boundary and normal ordering. An optional displayed timestamp controls what the reader sees when the source needs a different display value.

Source metadata also links related systems. Log sources can point to trace and metric sources. Trace sources can point to log, session, and metric sources. Trace metadata can define duration, parent span, status, span events, and span links. These links are what allow the result panel to move from one kind of telemetry to another.

The screen reads table columns and table metadata before it builds filters or queries. This supplies field types, date fields, primary-key hints, JSON and Map paths, and sort information. The query result can refine date types for aliases and computed fields, so filter controls use the type of the value the reader actually sees.

References: packages/…/source.ts• L69-94 packages/…/LogTableModelForm.tsx• L48-79 packages/…/LogTableModelForm.tsx• L112-187 packages/…/TraceTableModelForm.tsx• L44-76 packages/…/useMetadata.tsx• L90-170 packages/…/useMetadata.tsx• L309-449

Query and API flow

The browser builds one searchable chart configuration from the current source and search state. A shared ClickHouse query path renders that configuration with source metadata, reads the result stream, and returns rows with column metadata. The result table can request more pages, while time charts and facet controls run related metadata queries against the same source and range. Facet field metadata and facet values are separate requests, so the panel can list fields before every value list is ready.

Chart and table drill-downs use the same search URL contract. Before a destination search opens, chart variables become final SQL or Lucene values. Grouped rows add equality filters, while an attributable numeric value can add a small range filter. A single series condition can become the destination condition; unsupported combinations are not replayed as if they were exact.

The browser search flow follows this sequence:

  1. Load sources and resolve the selected log or trace source.
  2. Load table columns and metadata so expressions and filters match the source schema.
  3. Build a search configuration from the source, time range, condition, filters, selected fields, and order.
  4. Render and run the query against the source connection.
  5. Stream or page result rows into the table and use returned column metadata to format them.
  6. Run separate count, time-chart, facet, distribution, heatmap, delta, or row-detail queries when the screen needs them.

Facet discovery follows a related path. It selects the source table when possible, uses a fallback table connection only for source-less or metric searches, maps readable field names to safe SQL expressions, and merges extra values into the active facet result. Values that arrive out of order remain in the requested field order, and fields with pending values remain visible while the request is active. A change to the source, table, range, filters, condition, condition language, or discovery mode clears values loaded for the old scope.

The result query uses smaller time windows when the source and sort order allow it. This supports incremental display and deeper scrolling without requiring one large result read. Live searches keep a short cache and limit retained pages because new data can grow without bound. Trace comparison queries also use the heatmap selection bounds to constrain the delta view. Those bounds reset when the time range or heatmap settings change.

The external search API exposes the same product capability to programmatic callers through POST /api/v2/search. The caller supplies a source ID and may supply a time range, Lucene or SQL condition, selected expressions, sort order, row limit, and offset. The service resolves the source and connection, applies the source’s query settings, runs the query, and returns { data, rows }, where rows is the number of rows in that response rather than the total match count.

The API reports missing sources and connections as not-found errors. Query errors caused by user input return a client error. Other query or server failures return a server error and are recorded for service monitoring.

References: packages/…/useOffsetPaginatedQuery.tsx• L112-163 packages/…/useOffsetPaginatedQuery.tsx• L165-262 packages/…/useOffsetPaginatedQuery.tsx• L443-541 packages/…/useChartConfig.tsx• L292-465 packages/…/DBSearchHeatmapChart.tsx• L141-235 packages/…/ChartUtils.tsx• L1193-1289 packages/…/ChartUtils.tsx• L1350-1424 packages/…/eventsSearchUrl.test.ts• L193-227 packages/…/search.ts• L165-241 packages/…/search.ts• L364-451 packages/…/search.ts• L81-170 packages/…/hooks.ts• L41-302 packages/…/hooks.ts• L305-437 packages/…/utils.ts• L28-65

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the URL query-state map, saved-search fields, and the chart-config builder aligned. A field that is accepted by one path but not another can disappear on reload or after opening a saved search.
  • Keep clean filter keys and SQL-safe persisted keys as separate contracts. Changes to quoting or path merging must cover URL filters, saved searches, facet reads, and row-to-filter actions.
  • Keep URL encoding backward compatible for search expressions, JSON filters, side-panel state, and heatmap bounds. Links that pass through a second URL encoder must still restore spaces and special characters.
  • Keep chart variable expansion aligned with destination search parsing. Group filters, value-range filters, per-series conditions, and custom columns must survive chart and table drill-downs.
  • Keep source expressions aligned with row-detail aliases. A changed body, timestamp, attribute, trace-link, or span-link expression can affect both the results table and the side panel.
  • Keep source schema discovery and query-result metadata aligned for aliases and computed date fields. Otherwise the filter UI can apply the wrong type to a displayed value.
  • Keep facet discovery's source fallback, escaped SQL keys, and UI key mapping aligned. A change can make a field disappear, make a nested key query fail, or attach loaded values to the wrong filter.
  • Keep facet request order and pending-key handling aligned. A value response that arrives late must not reorder the panel or hide a field that is still loading.
  • Keep facet load-more results scoped to the source, table, time range, filter mode, active filter state, search condition, and condition language. Otherwise values from an older query can remain in the current panel.
  • Keep filter search and virtualized nested groups tied to the same clean field keys used by selection, pinning, column selection, and distribution queries.
  • Keep map facet grouping tolerant of dot and bracket forms. They must remain one logical child while raw SQL callers receive a valid canonical expression.
  • Keep filter-condition operator lists aligned with the language used by the query. PromQL must not offer an operator that its broadcast path cannot apply, and negated operators must keep their exclusion display.
  • Keep filter-condition suggestions tied to the debounced key. A stale value list must not appear as if it belongs to the key currently being edited, and Enter must still distinguish selection from free-text submission.
  • Keep heatmap selection bounds mirrored in the visible chart and aligned with the active time range, measured value, count, and scale. A change in any of these can make a delta comparison describe a different query than the visible heatmap.
  • Keep external API limits and response semantics aligned with the documented search contract. In particular, rows is page size and offset paging is not a stable deep cursor when timestamps tie.
  • Keep side-panel URL ownership and row identity together. A stale navigation stack must not render a row from a different source or root selection.
  • Keep dashboard filter type conversion aligned with the saved schema. A form may hold fields for several types during editing, but the saved filter must contain only the fields used by its final type.
  • Keep required and single-select dashboard settings aligned with their persisted selection limits. Requirement scope has no effect when the filter is optional, and variable names must remain stable when tiles refer to them.

Important failure modes

TriggerConsequenceGuard
A shared link re-encodes + characters used for spacesLucene or SQL search text can load with literal plus signsUse the encoded string parser and keep compatibility with old form-encoded URLs.
A saved search route loads before its saved configuration is resolvedThe form can briefly use a default source or stale URL statePopulate the URL only after the saved-search ID and saved record match.
The event-delta chart is rendered only after a heatmap rectangle is selectedThe trace distribution view is missing until the reader makes a selectionKeep the delta view available with empty selection bounds and show the heatmap color legend with it.
The selected source changes and old facet keys are keptThe next query can fail or silently filter on fields that do not existReconcile filters against the new source columns and notify when keys are dropped.
A heatmap selection remains after its time range or measured value changesThe delta chart can compare a range that does not match the visible heatmapClear selection bounds when the time range or heatmap settings change, and restore the visible selection from the URL after chart redraws.
A filter key with special characters is sent without SQL-safe quotingFacet or result queries can fail with an identifier errorConvert clean UI keys to canonical quoted expressions before persistence or raw SQL use.
A dot-form Map key is treated as a nested column or an array indexValue discovery can target the wrong field or ClickHouse can reject numeric accessConvert logical Map paths to bracket-form access and use known columns to quote only the real root.
A parsed-JSON filter key is treated as a Map pathThe generated expression can corrupt a valid JSONExtract* callPass existing SQL function-call expressions through without path rewriting.
A nested facet is rendered with its display path as its raw SQL keyDistribution or add-column queries can target the wrong field expressionKeep the clean UI key and canonical quoted SQL key as separate values.
Facet values arrive after a newer request has startedOld values can appear under the wrong field or a loading field can disappearKeep requested order and pending placeholders, then clear extra values when the query scope changes.
A facet page from an older scope is merged into the current facet listA filter can offer values that do not belong to the active source or queryClear extra facets when the discovery scope changes and append only deduplicated values to current results.
A value list is still settling after the key changesThe editor can show suggestions for the previous keyDebounce the trimmed key and show value loading state until the new key is ready.
Enter is pressed while a suggestion is highlightedThe typed value can be submitted instead of the selected suggestionCheck the input's own listbox before treating Enter as free-text submission.
A live-tail result is scrolled or opened for inspectionNew refreshes can reorder or replace the rows being readLeave live mode when the reader scrolls, expands rows, or opens the side panel.
A cross-source side-panel frame points to a deleted or inaccessible sourceThe detail panel cannot resolve the destination rowKeep the breadcrumb trail and show a missing-source state with Back and Close actions.
A search API request names a missing source or connectionNo telemetry rows can be returnedResolve both resources before query execution and return a not-found response.
User-supplied select or where expressions are invalidClickHouse rejects the queryValidate the request and map known input query errors to a client error.
A user changes a dashboard filter type and stale fields are savedA later dashboard query can use fields that do not match the selected filter typeNormalize the saved value by final type and discard fields from the other editors.
A required dashboard filter stores only its wider scope without a minimum selectionThe dashboard does not enforce the intended blockPersist the minimum selection first and persist the dashboard-wide scope only with it.

Key files

FileWhy to read it
packages/…/DBSearchPage.tsxMain search lifecycle. It connects URL state, forms, time range, analysis modes, saved searches, charts, filters, and results.
packages/…/DBSearchHeatmapChart.tsxTrace comparison chart. It keeps display settings, selection bounds, the always-available delta view, and the heatmap legend aligned.
packages/…/DBSearchHeatmapChart.test.tsxExecutable contract for the initial delta view, URL selection forwarding, and heatmap color legend.
packages/…/ChartUtils.tsxSearch URLs created from chart series and table rows. It shows how variables and chart selections become destination filters.
packages/…/queryParsers.tsURL contracts for search text, JSON filter state, and side-panel state. It shows how shared links stay readable across URL re-encoding.
packages/…/eventsSearchUrl.test.tsExecutable contract for variable expansion and chart or table drill-down filters.
packages/…/searchFilters.tsxFilter state contract and the conversion between UI state and persisted SQL-safe filters.
packages/…/filterFormState.tsDashboard filter form contract. It maps filter types and selection rules to the stored dashboard definition.
packages/…/DashboardFiltersList.tsxDashboard filter summary. It shows value origin, broadcast reach, requirement state, and variable names.
packages/…/DashboardFiltersModal.test.tsxExecutable contract for dashboard filter type changes, variable names, value sources, and requirement controls.
packages/…/filterFormState.test.tsExecutable contract for type-specific field cleanup and persisted selection limits.
packages/…/DBSearchPageFilters.tsxFilter panel behavior, facet display, shared and personal pins, analysis controls, and value selection.
packages/…/NestedFilterGroup.tsxNested property search, virtualized child groups, and state that survives row unmounts.
packages/…/hooks.tsFacet field discovery, source fallback, pending field order, SQL-key mapping, and scoped load-more behavior.
packages/…/utils.tsLogical facet grouping, pending facet listing, and conversion between UI field names and safe ClickHouse expressions.
packages/…/hooks.test.tsxExecutable contract for facet query modes, source fallback, pending fields, load-more merging, and scope resets.
packages/…/utils.test.tsExecutable contract for Map-key normalization, duplicate facet merging, and identifier quoting.
packages/…/filterOperators.tsOperator contract for SQL and PromQL filter conditions and their exclusion display.
packages/…/FilterAutocomplete.tsxFree-text filter suggestions and keyboard behavior for selecting or submitting values.
packages/…/FilterConditionEditor.tsxFilter condition editing contract for keys, operators, values, and debounced suggestions.
packages/…/DBSqlRowTableWithSidebar.tsxBoundary between the result table and the selected-row side panel.
packages/…/DBRowSidePanel.tsxDetail views, tabs, breadcrumbs, and movement between related telemetry rows.
packages/…/useOffsetPaginatedQuery.tsxSearch result paging, time windows, streaming, and ClickHouse result handling.
packages/…/useChartConfig.tsxShared chart-query flow used by results, charts, and detail reads.
packages/…/source.tsSource loading and the rules that map source metadata to event fields.
packages/…/useMetadata.tsxTable schema, field, facet, and value-distribution queries.
packages/…/savedSearch.tsSaved-search read and write behavior in cloud and local modes.
packages/…/search.tsPublic search request contract, validation, response shape, and error mapping.
packages/…/search.tsServer-side source resolution and execution of a programmatic search.