Commit graph

23 commits

Author SHA1 Message Date
Dale McDiarmid
b7581db806
more units for charts (#2004)
Co-authored-by: Drew Davis <drew.davis@clickhouse.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2026-04-02 11:16:57 -04:00
Drew Davis
275dc94161
feat: Add conditions to Dashboard filters; Support filter multi-select (#1969)
## Summary

This PR improves dashboard filters

1. Dashboard filters can now have an associated WHERE condition which filters the rows from which filter values will be queried.
2. Multiple values can now be selected for a single dashboard filter

### Screenshots or video

Multiple values can now be selected for a single filters:

<img width="544" height="77" alt="Screenshot 2026-03-23 at 12 31 02 PM" src="https://github.com/user-attachments/assets/2390a2d7-8514-4eb8-ac3c-db102a5df99b" />

Filters now have an optional condition, which filters the values which show up in the dropdown:

<img width="451" height="476" alt="Screenshot 2026-03-23 at 12 30 44 PM" src="https://github.com/user-attachments/assets/eed7f69e-466e-42fd-93f1-c27bfbc06204" />

<img width="265" height="94" alt="Screenshot 2026-03-23 at 12 30 54 PM" src="https://github.com/user-attachments/assets/2ba46e33-a44a-45ea-a6bf-fb71f5373e46" />

This also applies to Preset Dashboard Filters

<img width="726" height="908" alt="Screenshot 2026-03-23 at 12 33 34 PM" src="https://github.com/user-attachments/assets/df648feb-32e2-4f5e-80e5-409e0443b38e" />

### How to test locally or on Vercel

This can be partially tested in the preview environment, but testing the following requires running locally

1. Preset dashboard filters
2. External API support

### References



- Linear Issue: Closes HDX-3631 Closes HDX-2987
- Related PRs:
2026-03-24 18:05:41 +00:00
Drew Davis
f5ce232976
ci: Add linting for openapi specs (#1945)
## Summary

This PR adds the Spectral linter for linting our OpenAPI spec, with rules preventing fields with missing examples or descriptions, which are often enforced in the Control Plane repo.

This PR also resolves lint errors that were already present.

### Screenshots or video

### How to test locally or on Vercel

Run `make ci-lint` to lint the openapi specs 

### References



- Linear Issue: Closes HDX-3768
- Related PRs:
2026-03-20 15:13:19 +00:00
Drew Davis
1d83bebb54
feat: Add support for dashboard filters on Raw SQL Charts (#1924)
## Summary

This PR updates Raw SQL charts with support for dashboard filters, using the $__filters macro.

Lucene global filters require a Source to be included in the ChartConfig, for schema introspection and the `implicitColumnExpression` value. To support Lucene filters, this PR also updates the RawSqlChartConfig type to include optional `source`, `implicitColumnExpression`, and `from` properties. Only `source` is saved in the database. The external API has been updated to accept the `source` field for raw SQL charts as well.

Dashboard import/export has also been updated to support source mapping for raw sql charts with sources.

### Screenshots or video

Both the global filter and the drop-down filters are applied:

<img width="683" height="574" alt="Screenshot 2026-03-17 at 10 57 36 AM" src="https://github.com/user-attachments/assets/280ba0b5-55f7-4107-a55c-eeb1497ac7de" />

To render Lucene conditions, we require Source information (the `from` and `implicitColumnExpression` fields). When a source is not set, filters are therefore not applied:

<img width="782" height="618" alt="Screenshot 2026-03-17 at 10 54 41 AM" src="https://github.com/user-attachments/assets/3ad19ea7-12ee-4334-abe2-8985a0be952c" />

Similarly, if the `$__filters` macro is not used, then the filters are not applied

<img width="704" height="292" alt="Screenshot 2026-03-17 at 10 56 33 AM" src="https://github.com/user-attachments/assets/e1169e4a-2f64-4cd2-bc05-f699fecef8c1" />

Import:

<img width="993" height="669" alt="Screenshot 2026-03-17 at 3 35 16 PM" src="https://github.com/user-attachments/assets/6ebe20c0-19e2-4e90-95d0-8b02c2af0612" />

### How to test locally or on Vercel

This can be tested in the preview environment.
1. Create a saved dashboard and add some filters.
2. Create a raw sql tile, with or without the $__filters macro
3. Try selecting filters, deselecting filters, and applying global SQL and Lucene filters
4. Inspect the generated queries in the console.

### References



- Linear Issue: Closes HDX-3694
- Related PRs:
2026-03-18 12:03:27 +00:00
Drew Davis
f9ff10357a
chore: Backport openapi spec descriptions to OSS (#1894)
## Summary

Backports some additional external API spec descriptions to OSS

### References



- Linear Issue:
- Related PRs: https://github.com/DeploySentinel/hyperdx-ee/pull/1594
2026-03-13 11:42:11 +00:00
Drew Davis
e2a82c6bba
feat: Add Raw SQL Chart support to external dashboard APIs (#1877)
## Summary

This PR adds support for Raw SQL Charts to the external dashboards APIs.

### Screenshots or video

<img width="2294" height="1180" alt="Screenshot 2026-03-10 at 1 25 16 PM" src="https://github.com/user-attachments/assets/1f35bbe9-2558-43fa-8cc4-148af75042c5" />

### How to test locally or on Vercel

- `yarn dev` locally
- Grab your Personal API Key from Team Settings
- Make a request to the dashboard endpoints

```
curl http://localhost:8000/api/v2/dashboards -H "Authorization: Bearer <Key>"  -H "Content-Type: application/json" 
```

Schema is available at [`http://localhost:8000/api/v2/docs/#/`](http://localhost:8000/api/v2/docs/#/)

### References



- Linear Issue: HDX-3582 HDX-3585
- Related PRs: #1866, #1875
2026-03-11 13:32:51 +00:00
mlsalcedo
902b8ebdd3
feat(alerts): add scheduleStartAt + scheduleOffsetMinutes (#1745)
Closes #1715

## Summary
- Add scheduleStartAt and scheduleOffsetMinutes to alert schemas and API validation.
- Update alert evaluation scheduling to anchor windows by scheduleStartAt when set.
- Skip evaluations before scheduleStartAt.
- Keep current behavior unchanged when scheduling fields are unset.
- Add UI fields and API/OpenAPI/external API support for the new schedule options.
- Add alert scheduler tests for anchored windows and pre-start skip behavior.

## Notes
- This enables Splunk-style scheduled monitor migration where checks must run on isolated, periodic windows anchored to specific times.
- scheduleStartAt is the primary anchor; scheduleOffsetMinutes remains optional for backward-compatible alignment.

Co-authored-by: melsalcedo <128840984+melsalcedo@users.noreply.github.com>
Co-authored-by: Tom Alexander <3245235+teeohhem@users.noreply.github.com>
2026-03-06 01:47:38 +00:00
Himanshu Kapoor
daab2cace1
feat: support saved query/filter values in external api (#1814)
In https://github.com/hyperdxio/hyperdx/pull/1584 we added saved default query/filter values support to dashboards. This PR extends that support to the external API.

Fixes HDX-3519
2026-03-04 16:45:18 +00:00
Drew Davis
fedd586bba
feat: Remove potentially-sensitive fields from external webhooks API (#1816) 2026-02-27 13:55:45 +01:00
Drew Davis
34c9afebe2
feat: Add list Webhooks API (#1802)
Closes HDX-3450

# Summary

This PR adds a list webhooks endpoint to the external API, to better support alert creation via the API (which requires a webhook ID).

<img width="2275" height="1048" alt="Screenshot 2026-02-25 at 11 54 54 AM" src="https://github.com/user-attachments/assets/a9a4f1cb-d3e9-4d18-bb9c-6647b784adf9" />

<img width="1463" height="1057" alt="Screenshot 2026-02-25 at 11 55 45 AM" src="https://github.com/user-attachments/assets/b7864e67-b8d0-4f71-aedf-04d2d13e27f1" />
2026-02-26 12:20:45 +00:00
Drew Davis
b5bb69e37c
feat: Improve pie chart implementation (#1773)
Closes HDX-3479

# Summary

This PR makes a number of improvements to new pie chart implementation (#1704)

1. Pie charts are now limited to 1 series. Previously, the pie chart summed the values of each series by group, and used the sum as the slice value. This is non-obvious and probably not what users expect. With a one-series limit, this problem is eliminated. Further, the logic for formatting the pie chart data from the clickhouse response is dramatically simpler.
2. Slices are now ordered by value decreasing, to avoid randomly changing slice order on refresh
3. Instead of being randomly generated, slice colors are now consistent with the theme colors and auto-detect log and trace severity levels, matching line/bar chart behavior
4. The external dashboards API now supports reading and writing pie charts. The transformation code has been updated so that there will be a type error if any new chart types are added in the future without updating the external API code.
5. The pie chart's tooltip now matches the style of the line chart tooltip, and is updated appropriately based on the app theme and light/dark mode.
6. The chart's number format is now applied to values in the pie chart tooltip
7. Slice labels are now correctly populated when a map is accessed in the Group By (eg. when grouping by `ResourceAttributes['app']`, the slice labels include the `app` value instead of being empty).
8. Also, added some unit tests for the pie chart data transformation, and moved it to ChartUtils with the other similar chart data transformation code.
2026-02-23 16:04:26 +00:00
Drew Davis
b676f268d9
feat: Add config property to external dashboard APIs. Deprecate series. (#1763) 2026-02-20 08:48:25 -05:00
Himanshu Kapoor
18e9690461
fix: update required fields in our spec (#1758)
1. `source` isn't actually required on an alert. It is non-nullable, but has a default value of `saved_search` if omitted.
2. `whereLanguage` is actually a required input.
2026-02-19 18:10:51 +00:00
Himanshu Kapoor
9ab68432af
Minor fixes in the external API (#1744) 2026-02-16 22:41:33 +01:00
Himanshu Kapoor
d759d046fd
feat: support filters in dashboards external api (#1724)
Fixes HDX-3387

In the external api, I renamed `filters[...].source` to `sourceId` to match tiles which also need a `sourceId`.
2026-02-12 18:57:43 +00:00
Drew Davis
27f478a699
feat: Add external GET /sources API (#1725)
HDX-3318

# Summary

This PR adds a `GET /sources` endpoint to the external API. This is intended to be a way for users to retrieve the list of available sources, so that they can use a correct source ID when creating or updating dashboards through the external API. Previously, the user had no easy way to view source IDs.

Create/Update/Delete source endpoints may be added in subsequent iterations.

There will be a related PR in control-plane to add this to the OpenAPI.

<img width="2126" height="1345" alt="Screenshot 2026-02-11 at 10 37 54 AM" src="https://github.com/user-attachments/assets/bd5ba25f-75df-495a-a25f-95b3a6a5cae2" />

```
curl --request GET \
  --url http://localhost:8000/api/v2/sources \
  --header 'authorization: Bearer <API Key>'
```
2026-02-11 16:18:01 +00:00
Himanshu Kapoor
a7e4912341
chore: minor cleanup of some schema definitions (#1723) 2026-02-11 13:57:17 +01:00
Himanshu Kapoor
5da3f3a21e
chore: improve external OpenAPI specs (#1687)
Fixes HDX-3325

* Use enums where possible
* Add descriptions where missing
* Simplify Alert request and types
* Fix a disceprency with alert request and response fields: `team` vs `teamId`, `dashboard` vs `dashboardId`, `savedSearch` vs `savedSearchId`
2026-02-02 16:10:47 +00:00
Drew Davis
4c287b163c
fix: Fix External Dashboard APIs (#1681)
Closes HDX-3303

# Summary

This PR reworks the external dashboard APIs in the following ways

1. Previously, there was no way to create a renderable dashboard using the create or update routes, because the APIs saved dashboard data in a format incompatible with v2 of HyperDX. This PR introduces a transformation layer to transform external API request and response formats into the v2 dashboard format prior to saving.
2. This PR also corrects and improves the openapi documentation associated with the dashboard endpoints.

This PR introduces a number of **breaking changes** in the dashboard API, which is acceptable because the APIs are already (a) effectively non-functional for writing dashboard data and (b) not aligned at all with the previously published spec when reading dashboard data.

1. The `dataSource` field has been removed from each series and replaced with a `sourceId` field, which specifies the sourceId of the source which should be queried. The `dataSource` argument was inflexible and could only specify `events`, `rrweb`, or `metrics` - these are leftover from V1, and are not very compatible with the design of HyperDX V2.
2. Dashboard responses previously would have contained `config` fields, in the format of a V2 dashboard config. Results are now transformed and align with the spec, which contains config data in a `series` array.
3. Additional validation has been added to prevent creation of some invalid dashboards
2026-01-30 18:15:55 +00:00
Drew Davis
941bc23ef4
fix: Fix inaccurate openapi docs for external alerts API (#1676)
# Summary

This PR updates the external Alerts API specs so that the specs match the actual behavior of the API.

I've also added a validator to an API which was missing any validation.
2026-01-29 16:20:50 +00:00
Drew Davis
ac1a2f7768
chore: Format OpenAPI Docs (#1555)
This PR commits automated formatting updates to the OpenAPI Docs.
2026-01-05 17:41:15 +00:00
Tom Alexander
e9033b463c
chore: update swagger server urls (#1405) 2025-11-24 18:10:46 +00:00
Tom Alexander
e3643ccfc0
chore: Add automatic api doc generation (#1397)
Fixes: HDX-2888
2025-11-21 21:14:02 +00:00