Database query details p95 query scans the full trace window and times out
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- clickhouse, typescript
- Ambito
- databases, observability, performance
Direzione di ricerca
Leggi ServiceDashboardDbQuerySidePanel.tsx, serviceDashboard.ts e ServiceDashboardSlowestEventsTile.tsx per ricostruire come vengono creati il filtro degli statement e la query p95. Riproduci il timeout su una sorgente di trace ad alto volume di 24 ore e ispeziona la query generata con EXPLAIN indexes = 1. Il lavoro è completato quando il drawer dei dettagli del database rimane utilizzabile senza scansionare l'intera porzione di trace selezionata né richiedere un timeout più elevato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Opening a database statement in Services > Database loads the Slowest 5% of Queries tile by calculating p95 across the selected trace window. On a high-volume trace source with a 24-hour window, the generated query times out after 60 seconds.
This is reproducible with the default OpenTelemetry-style trace schema, where Duration is numeric and database statements are read from SpanAttributes.
Environment
- HyperDX 2.35.0
- Self-hosted ClickStack
- Trace source using the standard
Duration UInt64andSpanAttributes Map(...)fields
Steps to reproduce
- Open Services > Database.
- Select a 24-hour time range on a high-volume trace source.
- Open one of the database statement rows.
- Observe the Slowest 5% of Queries tile in the detail drawer.
Generated query
Sanitized version of the query shown by HyperDX:
SELECT
quantile(0.95)(
toFloat64OrDefault(toString(Duration))
) AS p95_duration_ns,
p95_duration_ns / 1e6 AS p95
FROM traces
WHERE
Timestamp >= fromUnixTimestamp64Milli(...)
AND Timestamp <= fromUnixTimestamp64Milli(...)
AND coalesce(
nullIf(SpanAttributes['db.query.text'], ''),
nullIf(SpanAttributes['db.statement'], '')
) IN ('GET /resource/:id')
The request fails with:
Timeout exceeded: elapsed 60099 ms, maximum: 60000 ms:
While executing MergeTreeSelect(pool: ReadPool, algorithm: Thread).
EXPLAIN indexes = 1 shows timestamp and primary-key pruning, but the generated database-statement predicate does not select the available map-value skipping index. The query therefore evaluates the coalesced map lookup across the selected trace slice.
Duration is already UInt64, so converting it through String and then Float64 also appears unnecessary.
Relevant code
The behavior appears to come from these paths:
- ServiceDashboardDbQuerySidePanel.tsx, which adds the selected database statement as a filter.
- serviceDashboard.ts, which builds the default coalesced statement expression.
- ServiceDashboardSlowestEventsTile.tsx, which calculates the p95 threshold.
Expected behavior
The database query detail drawer should remain usable for common 24-hour ranges without requiring a higher timeout or a full scan of the selected trace slice.
Possible directions include preserving the native numeric type for Duration, allowing the database statement expression to point to an indexed or materialized column, or using a projection/aggregate path for the repeated percentile calculation.
- Lingua principale
- TypeScript
- Stelle
- 9.9k
- Fork
- 487
- Merge medio
- 2g 15h
- PR unite (30g)
- 125
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperdxio/hyperdx
-
bug external Needs Feedback
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
external
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Replace `as any` mock fixtures in three app test files with shoehornForse già presa @k4its1t l’ha presa 47 giorni fa. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
hyperdxio/hyperdx#2852 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Trace source: document spanLinksValueExpression in the v2 sources external API (OpenAPI parity)Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperdxio/hyperdx
Issue simili
-
Mondriaan
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
knaw-huc/textannoviz#709 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: YRF Music NepalApertastreams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
walletbeat/walletbeat#1558 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hawk-digital-environments/HAWKI#438 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OktoLabsAI/okto-pulse#114 ·
I maintainer di solito rispondono entro 1 giorno