@gravitee/gamma-lib-observability 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INTEGRATION.md +12 -14
- package/QUERYING.md +192 -0
- package/USAGE_GUIDE.md +8 -6
- package/dist/dashboards/adapters/time-series-adapter.d.ts +1 -1
- package/dist/dashboards/adapters/time-series-adapter.d.ts.map +1 -1
- package/dist/dashboards/renderers/BarWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/CartesianWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/DoughnutWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/MetricGroupWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/templates/dashboard-template.d.ts +0 -2
- package/dist/dashboards/templates/dashboard-template.d.ts.map +1 -1
- package/dist/dashboards/widget-data.d.ts +1 -1
- package/dist/data-sources/http-data-source.d.ts.map +1 -1
- package/dist/hooks/query-keys.d.ts +13 -5
- package/dist/hooks/query-keys.d.ts.map +1 -1
- package/dist/hooks/use-facets-query.d.ts +14 -2
- package/dist/hooks/use-facets-query.d.ts.map +1 -1
- package/dist/hooks/use-time-series-query.d.ts +2 -1
- package/dist/hooks/use-time-series-query.d.ts.map +1 -1
- package/dist/index.js +699 -642
- package/dist/routing/DashboardListPage.d.ts.map +1 -1
- package/dist/testing/graphene-core-icons-mock.d.ts +1 -0
- package/dist/testing/graphene-core-icons-mock.d.ts.map +1 -1
- package/dist/testing/mock-metrics-data-source.d.ts.map +1 -1
- package/dist/types/domain.d.ts +70 -7
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/requests.d.ts +11 -10
- package/dist/types/requests.d.ts.map +1 -1
- package/dist/types-entry.d.ts +1 -1
- package/dist/types-entry.d.ts.map +1 -1
- package/package.json +2 -1
package/INTEGRATION.md
CHANGED
|
@@ -227,12 +227,10 @@ Each module defines its own preset dashboards using `defineDashboardTemplate`:
|
|
|
227
227
|
|
|
228
228
|
```ts
|
|
229
229
|
import { defineDashboardTemplate } from '@gravitee/gamma-lib-observability';
|
|
230
|
-
import { LayoutDashboardIcon } from '@gravitee/graphene-core/icons';
|
|
231
230
|
|
|
232
231
|
export const apiOverviewTemplate = defineDashboardTemplate({
|
|
233
232
|
id: 'api-overview',
|
|
234
233
|
label: 'API Overview',
|
|
235
|
-
icon: LayoutDashboardIcon,
|
|
236
234
|
description: 'High-level view of all API traffic and key metrics.',
|
|
237
235
|
requiredCapabilities: ['observability.dashboards.read'],
|
|
238
236
|
dashboard: {
|
|
@@ -262,20 +260,22 @@ export const apiOverviewTemplate = defineDashboardTemplate({
|
|
|
262
260
|
| ---------------------- | --------------------------------- | ----------------------------------------------------------- |
|
|
263
261
|
| `id` | `string` | Unique identifier (used in URL path) |
|
|
264
262
|
| `label` | `string` | Display name in list and detail pages |
|
|
265
|
-
| `icon` | `ElementType` | Icon from `@gravitee/graphene-core/icons` |
|
|
266
263
|
| `description` | `string` | Shown in the dashboard list table |
|
|
267
264
|
| `requiredCapabilities` | `CapabilityKey[]` | Template hidden when user lacks any listed capability |
|
|
268
265
|
| `dashboard` | `Dashboard \| (ctx) => Dashboard` | Static definition or factory receiving capabilities context |
|
|
269
266
|
|
|
270
267
|
### Widget types
|
|
271
268
|
|
|
272
|
-
| Type | Description | Key properties
|
|
273
|
-
| -------------- | ------------------------- |
|
|
274
|
-
| `cartesian` | Line, area, bar charts | `series[].metric`, `series[].representation`, `series[].measure
|
|
275
|
-
| `doughnut` | Pie / doughnut chart | `
|
|
276
|
-
| `bar` | Horizontal / vertical bar | `
|
|
277
|
-
| `metric` | Single KPI value | `metric`, `measure?`, `showTrend?` / `showSparkline?` (both default to `false` — opt in)
|
|
278
|
-
| `metric-group` | Multiple KPI values | `items[].metric`, `items[].measure?`, `items[].showTrend?`
|
|
269
|
+
| Type | Description | Key properties |
|
|
270
|
+
| -------------- | ------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
271
|
+
| `cartesian` | Line, area, bar charts | `series[].metric`, `series[].representation`, `series[].measure?`, `series[].by?`, `sorts?`, `ranges?` |
|
|
272
|
+
| `doughnut` | Pie / doughnut chart | `by`, `metric?`, `measure?`, `sorts?`, `ranges?`, `limit?` |
|
|
273
|
+
| `bar` | Horizontal / vertical bar | `by`, `metric?`, `measure?`, `sorts?`, `ranges?`, `limit?`, `barLayout?` |
|
|
274
|
+
| `metric` | Single KPI value | `metric`, `measure?`, `showTrend?` / `showSparkline?` (both default to `false` — opt in) |
|
|
275
|
+
| `metric-group` | Multiple KPI values | `items[].metric`, `items[].measure?`, `items[].filters?`, `items[].showTrend?` |
|
|
276
|
+
|
|
277
|
+
> The full request-capability reference (every field accepted by the `measures` / `facets` / `time-series`
|
|
278
|
+
> endpoints, defaults, and widget → request mapping) lives in [`QUERYING.md`](./QUERYING.md).
|
|
279
279
|
|
|
280
280
|
### Widget layout
|
|
281
281
|
|
|
@@ -603,7 +603,7 @@ The capability key `observability.traces.read` is already wired. When a traces e
|
|
|
603
603
|
const { navGroup } = observability;
|
|
604
604
|
// navGroup.label → 'Observability'
|
|
605
605
|
// navGroup.items → [
|
|
606
|
-
// { key: 'observe/dashboards', title: 'Dashboards', icon:
|
|
606
|
+
// { key: 'observe/dashboards', title: 'Dashboards', icon: ChartLineIcon },
|
|
607
607
|
// { key: 'observe/logs', title: 'Logs', icon: FileTextIcon },
|
|
608
608
|
// ]
|
|
609
609
|
```
|
|
@@ -994,12 +994,10 @@ Here is a full example showing a module that enables both dashboards and logs:
|
|
|
994
994
|
```ts
|
|
995
995
|
// src/config/observability.ts
|
|
996
996
|
import { defineObservabilityFeatures, defineDashboardTemplate } from '@gravitee/gamma-lib-observability';
|
|
997
|
-
import { LayoutDashboardIcon, ActivityIcon } from '@gravitee/graphene-core/icons';
|
|
998
997
|
|
|
999
998
|
const trafficTemplate = defineDashboardTemplate({
|
|
1000
999
|
id: 'traffic-overview',
|
|
1001
1000
|
label: 'Traffic Overview',
|
|
1002
|
-
icon: ActivityIcon,
|
|
1003
1001
|
description: 'Request volume, latency, and error rates.',
|
|
1004
1002
|
dashboard: {
|
|
1005
1003
|
id: 'traffic-overview',
|
|
@@ -1031,7 +1029,7 @@ const trafficTemplate = defineDashboardTemplate({
|
|
|
1031
1029
|
title: 'Status Codes',
|
|
1032
1030
|
type: 'doughnut',
|
|
1033
1031
|
metric: 'request_count',
|
|
1034
|
-
|
|
1032
|
+
by: ['status_code'],
|
|
1035
1033
|
layout: { x: 8, y: 2, cols: 4, rows: 2 },
|
|
1036
1034
|
},
|
|
1037
1035
|
],
|
package/QUERYING.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Querying & Widgets — @gravitee/gamma-lib-observability
|
|
2
|
+
|
|
3
|
+
How dashboard widgets map to the Gravitee Management **v2 analytics** compute endpoints, every
|
|
4
|
+
request field they expose, the defaults the library injects, and copy-pasteable examples.
|
|
5
|
+
|
|
6
|
+
> Source of truth: `openapi-analytics.yaml` (`MeasuresRequest` / `FacetsRequest` / `TimeSeriesRequest`
|
|
7
|
+
> / `MetricRequest` / `FacetMetricRequest` / `Sort` / `NumberRange`). Keep this doc in sync with the
|
|
8
|
+
> spec and the analytics definition (allowed metrics / measures / facets per API type).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Endpoints
|
|
13
|
+
|
|
14
|
+
| Endpoint | Used by widgets | Returns |
|
|
15
|
+
| ----------------------------- | ------------------------ | ------------------------------------------- |
|
|
16
|
+
| `POST /analytics/measures` | `metric`, `metric-group` | aggregated metric values (`MetricResult[]`) |
|
|
17
|
+
| `POST /analytics/facets` | `doughnut`, `bar` | grouped buckets (`FacetBucket[]`) |
|
|
18
|
+
| `POST /analytics/time-series` | `cartesian` | data points over time (`TimeSeriesGroup[]`) |
|
|
19
|
+
|
|
20
|
+
### Capability matrix
|
|
21
|
+
|
|
22
|
+
Which request fields each endpoint accepts (✅ supported, — not applicable):
|
|
23
|
+
|
|
24
|
+
| Field | measures | facets | time-series | Notes |
|
|
25
|
+
| -------------------------- | :------: | :------: | :----------: | ----------------------------------------- |
|
|
26
|
+
| `timeRange` | ✅ | ✅ | ✅ | ISO 8601 string or epoch |
|
|
27
|
+
| `interval` | — | — | ✅ | ms (number) or `1s` / `1m` / `5h` / `2d` |
|
|
28
|
+
| top-level `filters[]` | ✅ | ✅ | ✅ | `Filter` (string / number / array) |
|
|
29
|
+
| `by[]` (dimensions) | — | ✅ (1–3) | ✅ (up to 2) | multi-dimensional grouping |
|
|
30
|
+
| `limit` | — | ✅ | ✅ | bucket cap |
|
|
31
|
+
| `ranges` (`NumberRange[]`) | — | ✅ | ✅ | numeric bucketing (e.g. status `100–399`) |
|
|
32
|
+
| `metrics[]` | ✅ | ✅ | ✅ | one or more metrics per request |
|
|
33
|
+
| metric `measures[]` | ✅ | ✅ | ✅ | e.g. `[COUNT, AVG]` |
|
|
34
|
+
| metric `filters[]` | ✅ | ✅ | ✅ | per-metric filters |
|
|
35
|
+
| metric `sorts` | — | ✅ | ✅ | `Sort { measure, order: ASC \| DESC }` |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 2. Field reference
|
|
40
|
+
|
|
41
|
+
| Field | Type | Allowed values / constraints |
|
|
42
|
+
| -------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `timeRange` | `TimeRange` | Relative (`{ type:'relative', period }`) or absolute (`{ type:'absolute', from, to }`); resolved to ISO 8601 on the wire. |
|
|
44
|
+
| `interval` | `number` | Bucket width in ms. The bundled renderers compute it from the range targeting ~48 buckets (1-minute floor). |
|
|
45
|
+
| `by` | `string[]` | Facet names. **facets:** up to 3 dimensions. **time-series:** up to 2. e.g. `API`, `HTTP_STATUS_CODE_GROUP`, `LLM_PROXY_MODEL`. |
|
|
46
|
+
| `limit` | `number` | Max buckets returned (`>= 1`). |
|
|
47
|
+
| `ranges` | `NumericRange[]` | `{ from: number; to: number }[]` — inclusive `from`, exclusive `to`. |
|
|
48
|
+
| `metrics[].name` | `string` | Metric name, e.g. `HTTP_REQUESTS`, `HTTP_GATEWAY_RESPONSE_TIME`, `LLM_PROMPT_TOTAL_TOKEN`. |
|
|
49
|
+
| `metrics[].measures` | `string[]` | `AVG`, `MIN`, `MAX`, `P50`, `P90`, `P95`, `P99`, `COUNT`, `PERCENTAGE`. |
|
|
50
|
+
| `metrics[].filters` | `FilterCondition[]` | Per-metric filters (same shape as top-level filters). |
|
|
51
|
+
| `metrics[].sorts` | `MeasureSort[]` | `{ measure, order: 'ASC' \| 'DESC' }[]` (facets & grouped time-series only). |
|
|
52
|
+
| filter `operator` | `eq` / `in` / `gte` / `lte` | Mapped to wire `EQ` / `IN` / `GTE` / `LTE`. Other lib operators throw at serialization time. |
|
|
53
|
+
|
|
54
|
+
Allowed metric / measure / facet names depend on the API type and are defined by the analytics
|
|
55
|
+
definition; the lists above mirror the v2 OpenAPI enums.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 3. Defaults injected by the library
|
|
60
|
+
|
|
61
|
+
| Concern | Default | Where |
|
|
62
|
+
| ------------------------ | ------------------------------------------------ | ------------------------------------------------------------ |
|
|
63
|
+
| Facet metric (when none) | `{ name: 'HTTP_REQUESTS', measures: ['COUNT'] }` | `createHttpDataSource({ defaultFacetMetric })` — overridable |
|
|
64
|
+
| Measure (when omitted) | `COUNT` | `resolveMeasure()` / `DEFAULT_MEASURE` |
|
|
65
|
+
| Time-series interval | ~48 buckets across the range (1-minute floor) | `computeBucketInterval` / `DASHBOARD_BUCKET_TARGET` |
|
|
66
|
+
| Query `staleTime` | `30_000` ms | `DEFAULT_STALE_TIME` |
|
|
67
|
+
| Sort | none (backend default order) | — |
|
|
68
|
+
|
|
69
|
+
Keeping the public `metrics[].measures` populated (rather than relying on the wire-level fallback)
|
|
70
|
+
preserves the React Query cache-key contract, so overlapping widgets (e.g. a chart and a sparkline on
|
|
71
|
+
the same metric/range) dedupe.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 4. Widget → request mapping
|
|
76
|
+
|
|
77
|
+
| Widget | Endpoint | Mapping |
|
|
78
|
+
| -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| `metric` | measures | `{ metric, measure }` → one `MetricRequest`. Widget `filters` → top-level filters. |
|
|
80
|
+
| `metric-group` | measures | each `items[]` → one `MetricRequest` (`metric`, `measure`, per-item `filters`). Identical (metric+filters) items are deduped. |
|
|
81
|
+
| `cartesian` | time-series | each `series[]` → one query. `metric`/`measure` → `metrics[0]`; `by` → `by[]`; `filters`/`sorts`/`ranges`/`limit` forwarded. |
|
|
82
|
+
| `doughnut` | facets | `by` → `by[]`; `metric`/`measure`/`sorts` → `metrics[0]`; `ranges`/`limit` forwarded. |
|
|
83
|
+
| `bar` | facets | same as `doughnut`, plus `barLayout`. |
|
|
84
|
+
|
|
85
|
+
**Color & total**: `cartesian` resolves series color from `color` / `colorByGroup` / the status
|
|
86
|
+
palette (when the first `by` dimension is a known status field); `showTotal` / `totalLabel` drive the
|
|
87
|
+
chart total.
|
|
88
|
+
|
|
89
|
+
**Rendering limits (request stays fully reachable):**
|
|
90
|
+
|
|
91
|
+
- `doughnut` / `bar` are single-dimension charts. With a multi-dimension `by`, the bundled renderer
|
|
92
|
+
flattens leaf buckets into composite categories (`API 1 › 2xx`). Prefer a single dimension for these.
|
|
93
|
+
- `cartesian` renders the first `by` dimension as the grouped/stacked series; deeper dimensions are
|
|
94
|
+
sent to the backend but flattened onto the first level.
|
|
95
|
+
- Distinct visual series for several measures of one metric are best expressed as one `series[]` entry
|
|
96
|
+
per measure (e.g. P90/P95/P99), which the renderer keys apart by measure.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 5. Examples
|
|
101
|
+
|
|
102
|
+
Each example shows the widget config and the resulting request payload.
|
|
103
|
+
|
|
104
|
+
### 5.1 Percentile band (multi-measure, one series per measure)
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
{
|
|
108
|
+
id: 'latency-band', type: 'cartesian', title: 'Gateway latency',
|
|
109
|
+
layout: { x: 0, y: 0, cols: 12, rows: 2 },
|
|
110
|
+
series: [
|
|
111
|
+
{ metric: 'HTTP_GATEWAY_RESPONSE_TIME', measure: 'P90', representation: 'line' },
|
|
112
|
+
{ metric: 'HTTP_GATEWAY_RESPONSE_TIME', measure: 'P95', representation: 'line' },
|
|
113
|
+
{ metric: 'HTTP_GATEWAY_RESPONSE_TIME', measure: 'P99', representation: 'line' },
|
|
114
|
+
],
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
→ three `time-series` calls, e.g. `{ metrics: [{ name: 'HTTP_GATEWAY_RESPONSE_TIME', measures: ['P95'] }], interval, timeRange }`.
|
|
119
|
+
|
|
120
|
+
### 5.2 Stacked-by-facet time series
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
{
|
|
124
|
+
id: 'traffic-by-status', type: 'cartesian', title: 'Traffic by status',
|
|
125
|
+
layout: { x: 0, y: 0, cols: 12, rows: 2 },
|
|
126
|
+
series: [
|
|
127
|
+
{ metric: 'HTTP_REQUESTS', representation: 'bar', by: ['HTTP_STATUS_CODE_GROUP'], stackId: 'status' },
|
|
128
|
+
],
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
→ `{ metrics: [{ name: 'HTTP_REQUESTS', measures: ['COUNT'] }], by: ['HTTP_STATUS_CODE_GROUP'], interval, timeRange }`
|
|
133
|
+
|
|
134
|
+
### 5.3 Top-N sorted facet (doughnut/bar)
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
{
|
|
138
|
+
id: 'slowest-apis', type: 'bar', title: 'Slowest APIs', barLayout: 'horizontal',
|
|
139
|
+
layout: { x: 0, y: 0, cols: 6, rows: 2 },
|
|
140
|
+
by: ['API'], metric: 'HTTP_GATEWAY_RESPONSE_TIME', measure: 'AVG',
|
|
141
|
+
sorts: [{ measure: 'AVG', order: 'DESC' }], limit: 5,
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
→ `{ by: ['API'], metrics: [{ name: 'HTTP_GATEWAY_RESPONSE_TIME', measures: ['AVG'], sorts: [{ measure: 'AVG', order: 'DESC' }] }], limit: 5, timeRange }`
|
|
146
|
+
|
|
147
|
+
### 5.4 Numeric ranges
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
{
|
|
151
|
+
id: 'latency-ranges', type: 'doughnut', title: 'Latency buckets',
|
|
152
|
+
layout: { x: 0, y: 0, cols: 4, rows: 2 },
|
|
153
|
+
by: ['API'], metric: 'HTTP_GATEWAY_RESPONSE_TIME', measure: 'AVG',
|
|
154
|
+
ranges: [{ from: 0, to: 100 }, { from: 100, to: 500 }, { from: 500, to: 5000 }],
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
→ `{ by: ['API'], metrics: [...], ranges: [{ from: 0, to: 100 }, ...], timeRange }`
|
|
159
|
+
|
|
160
|
+
### 5.5 Multi-metric KPI tiles with per-item filters
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
{
|
|
164
|
+
id: 'kpis', type: 'metric-group', title: 'Key metrics',
|
|
165
|
+
layout: { x: 0, y: 0, cols: 12, rows: 1 },
|
|
166
|
+
items: [
|
|
167
|
+
{ metric: 'HTTP_REQUESTS', measure: 'COUNT', label: 'Requests' },
|
|
168
|
+
{ metric: 'HTTP_ERRORS', measure: 'COUNT', label: '5xx errors',
|
|
169
|
+
filters: [{ field: 'HTTP_STATUS_CODE_GROUP', label: 'Status', operator: 'eq', value: ['5xx'] }] },
|
|
170
|
+
],
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
→ `{ metrics: [ { name: 'HTTP_REQUESTS', measures: ['COUNT'] }, { name: 'HTTP_ERRORS', measures: ['COUNT'], filters: [{ name: 'HTTP_STATUS_CODE_GROUP', operator: 'EQ', value: '5xx' }] } ], timeRange }`
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 6. Filter semantics
|
|
179
|
+
|
|
180
|
+
Filters merge in this order, later layers win on a field conflict:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
context (dashboard scope) → view (active dashboard filters) → widget (widget.filters) → series/item (series[].filters / items[].filters)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
- The merged top-level filters are sent as the request `filters[]`; series/item filters are sent as
|
|
187
|
+
per-metric `filters[]`.
|
|
188
|
+
- Operators are mapped to the v2 wire format: `eq → EQ`, `in → IN`, `gte → GTE`, `lte → LTE`.
|
|
189
|
+
`eq`/`gte`/`lte` take a single value; `in` takes an array. Unsupported operators throw with a clear
|
|
190
|
+
error rather than silently dropping the filter.
|
|
191
|
+
- HTTP auth (headers, credentials) is configured once on the data source via
|
|
192
|
+
`createHttpDataSource(baseUrl, options)` — see [`INTEGRATION.md`](./INTEGRATION.md).
|
package/USAGE_GUIDE.md
CHANGED
|
@@ -152,9 +152,10 @@ import { useTimeSeriesQuery, useMeasuresQuery } from '@gravitee/gamma-lib-observ
|
|
|
152
152
|
|
|
153
153
|
function RequestRateChart() {
|
|
154
154
|
const { data, isLoading, error } = useTimeSeriesQuery({
|
|
155
|
-
|
|
155
|
+
metrics: [{ name: 'HTTP_REQUESTS', measures: ['COUNT'] }],
|
|
156
156
|
timeRange: { type: 'relative', period: '1h' },
|
|
157
|
-
|
|
157
|
+
interval: 60_000,
|
|
158
|
+
by: ['HTTP_STATUS_CODE_GROUP'],
|
|
158
159
|
});
|
|
159
160
|
|
|
160
161
|
if (isLoading) return <Spinner />;
|
|
@@ -173,6 +174,10 @@ Hooks available:
|
|
|
173
174
|
| `useLogsQuery<TRow>` | `LogsDataSource<TRow>` | `LogsQueryResult<TRow>` |
|
|
174
175
|
| `useLogsPagedQuery<TRow>` | `LogsDataSource<TRow>` | `UseLogsPagedQueryResult<TRow>` |
|
|
175
176
|
|
|
177
|
+
> For the full analytics request capability (measures / facets / time-series fields, `by`, `sorts`,
|
|
178
|
+
> `ranges`, per-metric filters, defaults, and the widget → request mapping), see
|
|
179
|
+
> [`QUERYING.md`](./QUERYING.md).
|
|
180
|
+
|
|
176
181
|
All hooks:
|
|
177
182
|
|
|
178
183
|
- Use `observabilityQueryKeys` for cache key derivation
|
|
@@ -563,12 +568,10 @@ Modules define their own preset dashboards using `defineDashboardTemplate`:
|
|
|
563
568
|
|
|
564
569
|
```tsx
|
|
565
570
|
import { defineDashboardTemplate } from '@gravitee/gamma-lib-observability';
|
|
566
|
-
import { LayoutDashboardIcon } from '@gravitee/graphene-core/icons';
|
|
567
571
|
|
|
568
572
|
export const apiOverviewTemplate = defineDashboardTemplate({
|
|
569
573
|
id: 'api-overview',
|
|
570
574
|
label: 'API Overview',
|
|
571
|
-
icon: LayoutDashboardIcon,
|
|
572
575
|
description: 'High-level view of all API traffic and key metrics.',
|
|
573
576
|
requiredCapabilities: ['observability.dashboards.read'],
|
|
574
577
|
dashboard: {
|
|
@@ -593,7 +596,6 @@ Template properties:
|
|
|
593
596
|
| ---------------------- | --------------------------------- | ----------------------------------------------------- |
|
|
594
597
|
| `id` | `string` | Unique identifier (used in URL path) |
|
|
595
598
|
| `label` | `string` | Display name in list and detail pages |
|
|
596
|
-
| `icon` | `ElementType` (optional) | Icon component from graphene-core/icons |
|
|
597
599
|
| `description` | `string` (optional) | Shown in the dashboard list table |
|
|
598
600
|
| `requiredCapabilities` | `CapabilityKey[]` (opt.) | Template hidden when user lacks any listed capability |
|
|
599
601
|
| `dashboard` | `Dashboard \| (ctx) => Dashboard` | Static dashboard or factory receiving capabilities |
|
|
@@ -731,7 +733,7 @@ Use `observability.navGroup` to register items in your module's sidenav:
|
|
|
731
733
|
```tsx
|
|
732
734
|
const { navGroup } = observability;
|
|
733
735
|
// navGroup.label → 'Observability'
|
|
734
|
-
// navGroup.items → [{ key: 'observe/dashboards', title: 'Dashboards', icon:
|
|
736
|
+
// navGroup.items → [{ key: 'observe/dashboards', title: 'Dashboards', icon: ChartLineIcon }]
|
|
735
737
|
```
|
|
736
738
|
|
|
737
739
|
Breadcrumbs are rendered by the calling module — the library does not own the layout shell — but the lib supplies the breadcrumb **data** (group + feature) via `observability.breadcrumbSegments(activeNavKey)`. See the [`ObservabilityFeatures` API reference](#observabilityfeatures-api-reference) above.
|
|
@@ -4,7 +4,7 @@ import { TimeSeriesGroup } from '../../types/responses';
|
|
|
4
4
|
/**
|
|
5
5
|
* A single renderable cartesian element resolved from a series definition and
|
|
6
6
|
* its fetched data. One `SeriesDefinition` produces one element when ungrouped,
|
|
7
|
-
* or one element per returned group when it defines `
|
|
7
|
+
* or one element per returned group when it defines `by`.
|
|
8
8
|
*/
|
|
9
9
|
export interface CartesianElement {
|
|
10
10
|
/** Unique key used as the data property, config key and chart element key. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-series-adapter.d.ts","sourceRoot":"","sources":["../../../src/dashboards/adapters/time-series-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AA6BD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,aAAa,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,GAAG,SAAS,CAAC,EAAE,GACjE;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"time-series-adapter.d.ts","sourceRoot":"","sources":["../../../src/dashboards/adapters/time-series-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AA6BD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,aAAa,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,GAAG,SAAS,CAAC,EAAE,GACjE;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAA;CAAE,CAmCtF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,GAC5D,kBAAkB,EAAE,CAmDtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/BarWidgetRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"BarWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/BarWidgetRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,SAAS,CAAC,2CAmC/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/CartesianWidgetRenderer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"CartesianWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/CartesianWidgetRenderer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAO5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,wBAAgB,uBAAuB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,eAAe,CAAC,2CAqF3G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoughnutWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/DoughnutWidgetRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"DoughnutWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/DoughnutWidgetRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,cAAc,CAAC,2CAsCzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricGroupWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/MetricGroupWidgetRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"MetricGroupWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/dashboards/renderers/MetricGroupWidgetRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA6CvE,wBAAgB,yBAAyB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,2CA4E/G"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ElementType } from 'react';
|
|
2
1
|
import { Dashboard, DashboardCapabilities } from '../../types/domain';
|
|
3
2
|
type CapabilityKey = keyof DashboardCapabilities;
|
|
4
3
|
export interface DashboardTemplateContext {
|
|
@@ -7,7 +6,6 @@ export interface DashboardTemplateContext {
|
|
|
7
6
|
export interface DashboardTemplate {
|
|
8
7
|
readonly id: string;
|
|
9
8
|
readonly label: string;
|
|
10
|
-
readonly icon?: ElementType;
|
|
11
9
|
readonly description?: string;
|
|
12
10
|
readonly requiredCapabilities?: readonly CapabilityKey[];
|
|
13
11
|
readonly dashboard: Dashboard | ((ctx: DashboardTemplateContext) => Dashboard);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-template.d.ts","sourceRoot":"","sources":["../../../src/dashboards/templates/dashboard-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard-template.d.ts","sourceRoot":"","sources":["../../../src/dashboards/templates/dashboard-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,KAAK,aAAa,GAAG,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,wBAAwB,KAAK,SAAS,CAAC,CAAC;CAChF;AAED,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAExD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB,CAsB1F;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,EAAE,wBAAwB,GAAG,SAAS,CAKlH;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,YAAY,EAAE,qBAAqB,GAClC,iBAAiB,EAAE,CAKrB"}
|
|
@@ -40,7 +40,7 @@ export interface CartesianWidgetData {
|
|
|
40
40
|
* Maps each chart data key to the series definition it renders from. The
|
|
41
41
|
* connected renderer provides this so the presentation can resolve a series
|
|
42
42
|
* for composite keys (multi-measure of one metric) and grouped keys (one
|
|
43
|
-
* element per `
|
|
43
|
+
* element per `by` group value). When omitted (manual mode), the presentation
|
|
44
44
|
* falls back to matching keys against `series[].metric`.
|
|
45
45
|
*/
|
|
46
46
|
readonly seriesByKey?: Readonly<Record<string, SeriesDefinition>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-data-source.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-data-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAY9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAuB/D,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACrE;
|
|
1
|
+
{"version":3,"file":"http-data-source.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-data-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAY9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAuB/D,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACrE;AAoJD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CA+CxG"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { FilterCondition, TimeRange } from '../types/domain';
|
|
1
|
+
import { FilterCondition, NumericRange, TimeRange } from '../types/domain';
|
|
2
2
|
import { FacetMetricRequest, MetricRequest } from '../types/requests';
|
|
3
3
|
export declare const observabilityQueryKeys: {
|
|
4
4
|
readonly all: readonly ["observability"];
|
|
5
|
-
readonly timeSeries: (metrics: readonly FacetMetricRequest[], timeRange: TimeRange, interval: number, filters?: FilterCondition[], by?: string[], limit?: number) => readonly ["observability", "timeSeries", {
|
|
5
|
+
readonly timeSeries: (metrics: readonly FacetMetricRequest[], timeRange: TimeRange, interval: number, filters?: FilterCondition[], by?: readonly string[], limit?: number, ranges?: readonly NumericRange[]) => readonly ["observability", "timeSeries", {
|
|
6
6
|
readonly metrics: Record<string, unknown>[];
|
|
7
7
|
readonly timeRange: TimeRange;
|
|
8
8
|
readonly interval: number;
|
|
9
9
|
readonly filters: FilterCondition[] | undefined;
|
|
10
|
-
readonly by: string[] | undefined;
|
|
10
|
+
readonly by: readonly string[] | undefined;
|
|
11
11
|
readonly limit: number | undefined;
|
|
12
|
+
readonly ranges: readonly NumericRange[] | undefined;
|
|
12
13
|
}];
|
|
13
|
-
readonly facets: (
|
|
14
|
-
readonly
|
|
14
|
+
readonly facets: (by: readonly string[], timeRange: TimeRange, filters?: FilterCondition[], options?: {
|
|
15
|
+
metrics?: readonly FacetMetricRequest[];
|
|
16
|
+
ranges?: readonly NumericRange[];
|
|
17
|
+
limit?: number;
|
|
18
|
+
search?: string;
|
|
19
|
+
}) => readonly ["observability", "facets", {
|
|
20
|
+
readonly by: readonly string[];
|
|
15
21
|
readonly timeRange: TimeRange;
|
|
16
22
|
readonly filters: FilterCondition[] | undefined;
|
|
23
|
+
readonly metrics: Record<string, unknown>[] | undefined;
|
|
24
|
+
readonly ranges: readonly NumericRange[] | undefined;
|
|
17
25
|
readonly limit: number | undefined;
|
|
18
26
|
readonly search: string | undefined;
|
|
19
27
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/hooks/query-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/hooks/query-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAmB3E,eAAO,MAAM,sBAAsB;;mCAItB,SAAS,kBAAkB,EAAE,aAC3B,SAAS,YACV,MAAM,YACN,eAAe,EAAE,OACtB,SAAS,MAAM,EAAE,UACd,MAAM,WACL,SAAS,YAAY,EAAE;;;;;;;;;0BAS5B,SAAS,MAAM,EAAE,aACV,SAAS,YACV,eAAe,EAAE,YACjB;QACR,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;QACxC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;;;;;;;;;iCAgBiB,SAAS,aAAa,EAAE,aAAa,SAAS,YAAY,eAAe,EAAE;;;;;+BAO7E,SAAS,YAAY,eAAe,EAAE,WAAW,MAAM;;;;;6BAGzD,MAAM;iCAEF,SAAS,YAAY,eAAe,EAAE,gBAAgB,MAAM;;;;;6BAGhE,MAAM;iCAEF,MAAM;CAClB,CAAC"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { FilterCondition, TimeRange } from '../types/domain';
|
|
2
|
+
import { FilterCondition, MeasureSort, NumericRange, TimeRange } from '../types/domain';
|
|
3
3
|
import { FacetBucket } from '../types/responses';
|
|
4
4
|
export interface UseFacetsQueryParams {
|
|
5
|
-
|
|
5
|
+
/** Facet dimensions to group by (v2 `facets` allows up to 3). */
|
|
6
|
+
by: string[];
|
|
6
7
|
timeRange: TimeRange;
|
|
8
|
+
/**
|
|
9
|
+
* Facet metric to count per bucket. When omitted, the data source injects
|
|
10
|
+
* its default facet metric. `measure` and `sorts` require `metric` to be set.
|
|
11
|
+
*/
|
|
12
|
+
metric?: string;
|
|
13
|
+
/** Measure read from `metric` to size each bucket. Defaults to `COUNT`. */
|
|
14
|
+
measure?: string;
|
|
15
|
+
/** Orders buckets by a measure (requires `metric`). */
|
|
16
|
+
sorts?: MeasureSort[];
|
|
17
|
+
/** Numeric ranges used to bucket values. */
|
|
18
|
+
ranges?: NumericRange[];
|
|
7
19
|
filters?: FilterCondition[];
|
|
8
20
|
limit?: number;
|
|
9
21
|
search?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-facets-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-facets-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIvE,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-facets-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-facets-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIvE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKtD,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAYD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,iFA6B9E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { FilterCondition, TimeRange } from '../types/domain';
|
|
2
|
+
import { FilterCondition, NumericRange, TimeRange } from '../types/domain';
|
|
3
3
|
import { FacetMetricRequest } from '../types/requests';
|
|
4
4
|
import { TimeSeriesGroup } from '../types/responses';
|
|
5
5
|
export interface UseTimeSeriesQueryParams {
|
|
@@ -8,6 +8,7 @@ export interface UseTimeSeriesQueryParams {
|
|
|
8
8
|
interval: number;
|
|
9
9
|
filters?: FilterCondition[];
|
|
10
10
|
by?: string[];
|
|
11
|
+
ranges?: NumericRange[];
|
|
11
12
|
limit?: number;
|
|
12
13
|
enabled?: boolean;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-time-series-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-time-series-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIzF,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-time-series-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-time-series-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIzF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,qFAgClF"}
|