Commit graph

33 commits

Author SHA1 Message Date
Mike Shi
33fc071dfa
feat: Allow users to define custom column aliases for charts (#996)
<img width="1337" height="988" alt="image" src="https://github.com/user-attachments/assets/80d83541-3fa9-4ebb-b54c-3caccbd86e90" />

Resolves HDX-1719
2025-07-15 14:08:29 +00:00
Mike Shi
973b9e8d0a
feat: Add any aggFn support, fix select field input not showing up (#991)
Closes HDX-2011

Co-authored-by: Tom Alexander <3245235+teeohhem@users.noreply.github.com>
2025-07-11 14:20:09 +00:00
Dan Hable
2f4bc07d38
fix: remove noisy log message (#921)
Now that the app has some complex queries that leverage CTEs, metrics for example, it's common for the logic in this optimization to throw an exception. When that happens, the query rendering logic continues without a problem but generates a noisy line in the console log. We can just remove this log message to clean up the debugging experience.

Ref: HDX-1763
2025-06-10 21:15:42 +00:00
Tom Alexander
cb4045bddb
feat: Add charts API (#811)
* Utilizes renderChartConfig and CH client to query for chart data
* Implements API input schema
* Adds lots of tests

Testing Notes:
* To use swagger, go to localhost:8000/api/v2/docs
* Authorize using your access key found in localhost:8000/me
* Under the charts route, click "Try it out"
* Use example payload:
*
```
{
  "startTime": <insert valid timestamp ms>,
  "endTime": <insert valid timestamp ms>,
  "granularity": "1h",
  "series": [
    {
      "sourceId": "<insert valid sourceid>",
      "aggFn": "count",
      "where": "SeverityText:error",
      "groupBy": []
    }
  ]
}
```


It was easiest for me to go to the UI, create a new chart and grab the sourceid and start/end timestamps from the URL, plug it in and profit.

Note: It was apparent to me that we will need to provide at least GET support for sources, otherwise that ID is not easily obtained.

Ref: HDX-1651
2025-06-09 19:50:38 +00:00
Dan Hable
96b8c50898
fix(metrics): fix histogram metric query (#823)
Fix the query to address issues with the value calculation as well as allow for grouping.

Ref: HDX-1726
2025-05-19 14:47:24 +00:00
Warren
321e24f968
fix: alerting time range filtering bug (#814)
Ref: HDX-1701

1. fix alerting time range filtering
2. add time range info to the alert body

<img width="620" alt="image" src="https://github.com/user-attachments/assets/205d6537-e177-4be9-888f-a9328c8a2b8a" />
2025-05-16 17:40:32 +00:00
Mike Shi
931d7387d9
fix: bugs with showing non otel spans (ex. clickhouse opentelemetry span logs) (#789)
<img width="1645" alt="image" src="https://github.com/user-attachments/assets/2f7eb93f-9648-4c98-8bfd-a2d0f65be9d5" />

fixing a few bugs that prevented us from properly rendering trace view for `system.opentelemetry_span_log`

fix HDX-1676

Co-authored-by: Warren <5959690+wrn14897@users.noreply.github.com>
2025-05-07 16:08:21 +00:00
Dan Hable
79fe30f503
fix: aggFn use default instead of null (#782)
Switched to the `-OrDefault` version of the float conversion when combined with the aggregate functions to prevent emitting null.

Ref: HDX-1379
2025-04-29 18:29:37 +00:00
Mike Huang
4acb8bcd9d
fix incorrect split for select query (#754)
- add new split function for brackets and quotes selection 
- should only affect SELECT section in search component
- add test

<img width="1236" alt="image" src="https://github.com/user-attachments/assets/569d569c-c52e-4f17-84be-0ec52175df0e" />


Ref: hdx-1587
2025-04-22 02:33:12 +00:00
Warren
7f0b397969
feat: queryChartConfig method + events chart ratio (#759)
Ref: HDX-1631

1. use temp centralized `queryChartConfig` to handle multi-series chart (metrics specifically)
2. move ratio computation logics (events chart) to the renderChartConfig
3. fix missing `seriesReturnType` prop in chartConfig in the checkAlert file
2025-04-21 22:52:55 +00:00
Dan Hable
4865ce7a62
fix: fix histogram metric query (#737)
Fix for the histogram query based on the late night session at KubeCon.

Ref: HDX-1572
2025-04-14 22:04:13 +00:00
Dan Hable
e002c2f9c6
feat: query sum metric without rate logic (#717)
Add the ability to query a sum metric and obtain the underlying values instead of the rate of change between those points.

Ref: HDX-1543
2025-03-27 19:09:58 +00:00
Warren
e884d85354
fix: metrics > logs correlation flow (#711)
Ref: HDX-1537

<img width="907" alt="Screenshot 2025-03-25 at 1 52 45 PM" src="https://github.com/user-attachments/assets/f2cc7f1c-0516-4c04-a339-ec80e4cc188d" />

If no log source is associated with metric source, the app notifies users

<img width="753" alt="image" src="https://github.com/user-attachments/assets/453ea3f7-f721-4189-b035-623602483c6a" />
2025-03-25 21:28:43 +00:00
Dan Hable
50ce38f1a9
test: histogram metric query integration tests (#692)
Pulls a set of test cases from the v1 code base that checks histogram metric queries against different quantile and queries for edge bounds as well.

Ref: HDX-1425
2025-03-25 18:59:15 +00:00
Warren
e5a210a1bd
feat: support search on multi implicit fields (#696)
Currently,  users (or hyperdx) will still need to create the index (ex: tokenbf)  on multi-fields to speed up query if perf is a concern.
ref: HDX-1522


<img width="715" alt="image" src="https://github.com/user-attachments/assets/d8ddbe3e-eb75-4780-b2cf-03dcf2f309ec" />

<img width="1056" alt="image" src="https://github.com/user-attachments/assets/e2071c55-9958-4772-a156-e1e1b568d67e" />
2025-03-20 22:41:26 +00:00
Dan Hable
8d5c120490
fix: update delta chart with clause (#694)
Prior refactoring broke out the `sql` and `chartConfig` field names to allow each to be more strict in their types. The delta chart config call was missed in that refactoring.

After refactoring the schema:
<img width="1302" alt="Screenshot 2025-03-19 at 10 13 47 AM" src="https://github.com/user-attachments/assets/d4c5433c-751e-4561-9f52-72ccca64d301" />

After fixing the delta chart component:
<img width="896" alt="Screenshot 2025-03-19 at 10 14 23 AM" src="https://github.com/user-attachments/assets/3a183e1a-af68-4453-b4fc-8515a8e6734e" />

In the UI:
<img width="1417" alt="Screenshot 2025-03-18 at 5 22 25 PM" src="https://github.com/user-attachments/assets/4b720af6-ed11-444d-8602-c019f38facad" />

Ref: HDX-1517
2025-03-19 20:37:19 +00:00
Dan Hable
b9f7d32efa
refactor: clean up the chart config CTE render logic (#686)
Some additional refactoring and testing around the more complex CTE rendering.

Ref: HDX-1511
2025-03-17 14:45:26 +00:00
Dan Hable
a9dfa14930
fix: use CTE instead of listing all index parts in query (#666)
## feat: allow CTE definitions to be nested chart configs

In order to easily use a CTE for fixing large index issues with delta
trace events, this commit updates the type and `renderWith` function to
render a nested chart config.

Ref: HDX-1343

---

## fix: use CTE instead of listing all index parts in query

Instead of sending 2 queries to the DB and enumerating all of parts
and offsets in the query, this change uses a CTE to select the parts.
This reduces the size of the HTTP request, which fixes the URI too
long response.

Ref: HDX-1343
2025-03-14 13:34:47 +00:00
Mike Shi
521facae92
use quote for aliases for sql compatibility (#680) 2025-03-13 06:19:26 +00:00
Tom Alexander
c6916f08a0
fix: Remove fill from chart configs as it breaks heatmap and more (#674)
WITH FILL messes with the heatmap bucketing logic, confusing the charting library. This change removes WITH FILL from query generation.

Ref: HDX-1456
2025-03-13 01:30:50 +00:00
Mike Shi
8f4e01035b
add support for aliases in search, add WITH clause to chartconfig (#659)
<img width="1645" alt="image" src="https://github.com/user-attachments/assets/430df67f-c415-4191-b796-ea078b8a1232" />

still not super smooth, but gets us most of the way there
2025-03-13 01:20:52 +00:00
Dan Hable
8acc7257d2
fix: few of histogram query fixes/tweaks (#669)
1. Eliminates a subquery select by pulling the handful of subquery fields up a level.

2. Removed `intDivOrZero` usage as this rounded fractional amounts to the nearest whole number, over/under stating the value.

3. Formatting of query now matches other queries.

Ref: HDX-1467
2025-03-12 14:12:21 +00:00
Warren
4492daa5b9
fix: gauge metric attribute conflicts issue (#670)
Ref: HDX-1468
2025-03-12 02:16:15 +00:00
Warren
9c5c2396fa
fix: handle 'filters' config (metrics) (#663)
Ref: HDX-1466
2025-03-11 07:25:00 +00:00
Warren
29e8f37d00
fix: aggCondition issue in sum/gauge/histogram metrics (#662)
Ref: HDX-1455
2025-03-10 23:38:55 +00:00
Dan Hable
99b60d50b2
fix: update sum metric query based on v1 integration test (#650)
Fix the sum query to produce the correct results from the min/max test case from v1.

Ref: HDX-1421
2025-03-07 07:03:03 +00:00
Warren
cd0e4fd71c
fix: correct handling of gauge metrics in renderChartConfig (#654) 2025-03-06 00:06:57 +00:00
Dan Hable
e80630c107
feat: supporting quantile histogram metrics (#635)
Additional `renderChartConfig` support to transform a histogram select into the correct SQL syntax to generate a chart. For parity with v1, this query only handles quantile queries.

<img width="1939" alt="Screenshot 2025-02-26 at 12 58 55 PM" src="https://github.com/user-attachments/assets/1126ac6c-c431-4d89-92d7-9df1e49e25cf" />

<img width="1960" alt="Screenshot 2025-02-26 at 3 11 07 PM" src="https://github.com/user-attachments/assets/e4fa09bf-1e27-4a90-ad25-6c6cb2890877" />

Ref: HDX-1339
2025-02-27 16:55:36 +00:00
Tom Alexander
521793df2d
fix: Ensure group-by works with sum metrics (#636)
Adds all available columns into the query so that we can properly apply the group by clause.

Ref: HDX-1419
2025-02-27 15:51:23 +00:00
Warren
57a6bc399f
feat: BETA metrics support (sum + gauge) (#629)
<img width="1310" alt="Screenshot 2025-02-25 at 3 43 11 PM" src="https://github.com/user-attachments/assets/38c98bc2-2ff2-412c-b26d-4ed9952439f2" />


Co-authored-by: Mike Shi <2781687+MikeShi42@users.noreply.github.com>
Co-authored-by: Dan Hable <418679+dhable@users.noreply.github.com>
Co-authored-by: Tom Alexander <3245235+teeohhem@users.noreply.github.com>
2025-02-26 00:00:48 +00:00
Warren
a483780ef6
style: move types from renderChartConfig + add exceptions types (#568) 2025-01-24 01:52:54 +00:00
Warren
a70080e533
style: use common utils package (api and app) (#555) 2025-01-21 18:44:14 +00:00
Warren
6ee29abe02
feat: introduce common-utils package (#554)
- copy and paste the utils to a separate dir
- setup building + CD
2025-01-16 18:15:22 +00:00