@gravitee/gamma-lib-observability 5.2.0 → 6.0.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 +11 -0
- package/QUERYING.md +46 -20
- package/USAGE_GUIDE.md +14 -1
- package/dist/dashboard-access-provider.js +68 -54
- package/dist/dashboards/editor/DashboardEditorPage.d.ts.map +1 -1
- package/dist/dashboards/editor/WidgetConfigForm.d.ts +7 -2
- package/dist/dashboards/editor/WidgetConfigForm.d.ts.map +1 -1
- package/dist/dashboards/editor/WidgetPreview.d.ts +1 -1
- package/dist/dashboards/editor/dashboard-json.d.ts.map +1 -1
- package/dist/dashboards/editor/locked-filter-conflicts.d.ts +29 -12
- package/dist/dashboards/editor/locked-filter-conflicts.d.ts.map +1 -1
- package/dist/dashboards/editor/widget-auto-scope.d.ts +7 -2
- package/dist/dashboards/editor/widget-auto-scope.d.ts.map +1 -1
- package/dist/dashboards/merge-filters.d.ts +8 -5
- package/dist/dashboards/merge-filters.d.ts.map +1 -1
- package/dist/dashboards/metric-group-requests.d.ts +35 -0
- package/dist/dashboards/metric-group-requests.d.ts.map +1 -0
- package/dist/dashboards/renderers/CartesianWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/MetricGroupWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/use-merged-widget-filters.d.ts +8 -6
- package/dist/dashboards/use-merged-widget-filters.d.ts.map +1 -1
- package/dist/data-sources/http-data-source.d.ts.map +1 -1
- package/dist/filters/index.d.ts +1 -1
- package/dist/filters/index.d.ts.map +1 -1
- package/dist/filters/scope-ceiling.d.ts +27 -1
- package/dist/filters/scope-ceiling.d.ts.map +1 -1
- package/dist/hooks/query-keys.d.ts.map +1 -1
- package/dist/index.js +2860 -2752
- package/dist/providers/clamped-data-sources.d.ts +8 -5
- package/dist/providers/clamped-data-sources.d.ts.map +1 -1
- package/dist/testing/mock-metrics-data-source.d.ts.map +1 -1
- package/dist/testing.js +7 -7
- package/dist/types/domain.d.ts +9 -5
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/requests.d.ts +8 -0
- package/dist/types/requests.d.ts.map +1 -1
- package/dist/types/responses.d.ts +6 -0
- package/dist/types/responses.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,15 +2,17 @@ import { FilterCondition } from '../types/domain';
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolves the effective filters for a widget renderer.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* The view filters (the dashboard layer, one condition per field as
|
|
6
|
+
* `mergeFilters` resolves them), then the widget's own filters **appended**,
|
|
7
|
+
* all of it under the host's context scope. A widget filter on a field the
|
|
8
|
+
* dashboard also sets no longer replaces the dashboard's: both are sent and the
|
|
9
|
+
* analytics API ANDs them, so a "5xx" widget under a "status 200" dashboard
|
|
10
|
+
* answers 0 rather than ignoring the dashboard. See `clampAnalyticsToScope`.
|
|
10
11
|
*
|
|
11
12
|
* All widget renderers must use this hook so the contract is explicit and
|
|
12
13
|
* consistent, regardless of whether the downstream query hook also applies the
|
|
13
|
-
* scope itself.
|
|
14
|
+
* scope itself. A renderer with filters of its own below the widget (a chart
|
|
15
|
+
* series) appends them to this list the same way.
|
|
14
16
|
*/
|
|
15
17
|
export declare function useMergedWidgetFilters(widgetFilters?: readonly FilterCondition[], viewFilters?: readonly FilterCondition[]): FilterCondition[];
|
|
16
18
|
//# sourceMappingURL=use-merged-widget-filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-merged-widget-filters.d.ts","sourceRoot":"","sources":["../../src/dashboards/use-merged-widget-filters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD
|
|
1
|
+
{"version":3,"file":"use-merged-widget-filters.d.ts","sourceRoot":"","sources":["../../src/dashboards/use-merged-widget-filters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,CAAC,EAAE,SAAS,eAAe,EAAE,EAC1C,WAAW,CAAC,EAAE,SAAS,eAAe,EAAE,GACvC,eAAe,EAAE,CAGnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-data-source.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-data-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAY9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"http-data-source.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-data-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAY9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAkD/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;AAmLD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CAuDxG"}
|
package/dist/filters/index.d.ts
CHANGED
|
@@ -31,5 +31,5 @@ export type { ObservabilitySignal, PartitionedFilters, SignalPartitionResult, }
|
|
|
31
31
|
export { buildChipLabel, buildChipLabelParts, buildChipTooltip } from './utils/filter-display';
|
|
32
32
|
export type { ChipLabelParts } from './utils/filter-display';
|
|
33
33
|
export { isMultiSelectForFilter, normalizeMembershipOperatorForValues, operatorLabel, operatorNeedsValue, } from './utils/filter-operators';
|
|
34
|
-
export { clampToScope } from './scope-ceiling';
|
|
34
|
+
export { clampAnalyticsToScope, clampToScope } from './scope-ceiling';
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxH,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAClG,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5G,YAAY,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE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O,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,aAAa,EACb,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FilterCondition } from '../types/domain';
|
|
2
2
|
/**
|
|
3
|
-
* Applies the host's context filters as a **ceiling** rather than a default
|
|
3
|
+
* Applies the host's context filters as a **ceiling** rather than a default,
|
|
4
|
+
* one condition per field. Used for **logs** requests, whose search refuses a
|
|
5
|
+
* repeated field; analytics requests use `clampAnalyticsToScope`.
|
|
4
6
|
*
|
|
5
7
|
* A module mounts this library scoped to what it owns, for instance API
|
|
6
8
|
* management showing only LLM and MCP APIs. Until now that scope was merely the
|
|
@@ -30,4 +32,28 @@ import { FilterCondition } from '../types/domain';
|
|
|
30
32
|
* covered, but a host passing its own `contextFilters` should know the limit.
|
|
31
33
|
*/
|
|
32
34
|
export declare function clampToScope(ceilings: readonly FilterCondition[], filters: readonly FilterCondition[] | undefined): FilterCondition[];
|
|
35
|
+
/**
|
|
36
|
+
* Applies the host's context filters as a ceiling on an **analytics** request:
|
|
37
|
+
* every ceiling, then every downstream condition as it is.
|
|
38
|
+
*
|
|
39
|
+
* The analytics API ANDs every top-level condition, the same field included
|
|
40
|
+
* (OBS-132), so nothing has to be intersected or replaced on this side: the
|
|
41
|
+
* ceiling always reaches the wire and the request can never leave the host's
|
|
42
|
+
* scope. Two `clampToScope` rules go away with that, on purpose:
|
|
43
|
+
*
|
|
44
|
+
* - a condition entirely outside the scope no longer falls back to the
|
|
45
|
+
* ceiling, so a widget pinned to another module's API type answers 0 instead
|
|
46
|
+
* of the host's own numbers;
|
|
47
|
+
* - a `contains`, `gte` or `lte` on a scoped field now narrows the scope
|
|
48
|
+
* instead of losing to it.
|
|
49
|
+
*
|
|
50
|
+
* It runs up to three times on one request (`useMergedWidgetFilters`, the query
|
|
51
|
+
* hook, the data source boundary), so it has to be idempotent: a condition
|
|
52
|
+
* identical to one already listed is dropped, which an AND makes harmless.
|
|
53
|
+
* Without that, each layer would append the ceiling once more and the cache
|
|
54
|
+
* key would drift from what is sent.
|
|
55
|
+
*
|
|
56
|
+
* Logs keep `clampToScope`: the logs search still refuses a repeated field.
|
|
57
|
+
*/
|
|
58
|
+
export declare function clampAnalyticsToScope(ceilings: readonly FilterCondition[], filters: readonly FilterCondition[] | undefined): FilterCondition[];
|
|
33
59
|
//# sourceMappingURL=scope-ceiling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-ceiling.d.ts","sourceRoot":"","sources":["../../src/filters/scope-ceiling.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AASvE
|
|
1
|
+
{"version":3,"file":"scope-ceiling.d.ts","sourceRoot":"","sources":["../../src/filters/scope-ceiling.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AASvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,GAC9C,eAAe,EAAE,CAoBnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,GAC9C,eAAe,EAAE,CAQnB"}
|
|
@@ -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,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,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;AAyB3E,eAAO,MAAM,sBAAsB;;mCAItB,SAAS,kBAAkB,EAAE,aAC3B,SAAS,YACV,MAAM,YACN,eAAe,EAAE,OACtB,SAAS,MAAM,EAAE,UACd,MAAM,WACL,SA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