andoncloud-prometheus-widget 1.3.18 → 1.3.19
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/README.md +36 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +274 -97
- package/dist/index.js.map +1 -1
- package/package.json +31 -29
- package/dist/index.cjs +0 -628
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -42
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# andoncloud-prometheus-widget
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/prometheus-widget) [](https://standardjs.com)
|
|
3
|
+
PromQL chart widget for the AndonCloud Dashboard.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
@@ -15,3 +13,38 @@ npm install --save andoncloud-prometheus-widget
|
|
|
15
13
|
```tsx
|
|
16
14
|
import { Widget, permissions } from 'andoncloud-prometheus-widget';
|
|
17
15
|
```
|
|
16
|
+
|
|
17
|
+
## Settings
|
|
18
|
+
|
|
19
|
+
| Field | Required | Notes |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Endpoint URL | yes | Prometheus HTTP API base (e.g. `https://prometheus.example.com`) |
|
|
22
|
+
| Username | no | Optional — fill only if your Prometheus requires HTTP Basic Auth |
|
|
23
|
+
| Password | no | Optional — paired with Username; left empty for anonymous Prometheus |
|
|
24
|
+
| Period | yes | Current shift / Previous shift |
|
|
25
|
+
| Queries | ≥1 | PromQL expressions with display names |
|
|
26
|
+
| Displayed query parameters | optional | Labels to include in dataset names |
|
|
27
|
+
| X-axis unit, Y-axis unit | yes | Axis titles |
|
|
28
|
+
|
|
29
|
+
When **both** Username and Password are filled, the widget sends `Authorization: Basic <base64(user:pass)>` on every Prometheus request. When either is empty, the request is anonymous.
|
|
30
|
+
|
|
31
|
+
If the Endpoint URL uses `http://` (not `https://`) and credentials are filled, the settings dialog shows a non-blocking warning that credentials will be sent over an unencrypted channel.
|
|
32
|
+
|
|
33
|
+
## Error states
|
|
34
|
+
|
|
35
|
+
The widget body distinguishes three failure modes:
|
|
36
|
+
|
|
37
|
+
- **401** — `Could not authenticate to Prometheus. Check the username and password in widget settings.`
|
|
38
|
+
- **403** — `Authenticated, but the Prometheus user has no permission to read these metrics.`
|
|
39
|
+
- network / DNS / TLS / 5xx — `Could not reach Prometheus at the configured URL.`
|
|
40
|
+
|
|
41
|
+
## Development
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm start # build:watch + preview
|
|
45
|
+
npm run build # production build
|
|
46
|
+
./scripts/cypress_run_prod.sh # component tests (Docker)
|
|
47
|
+
./scripts/cypress_run_prod.sh --e2e # E2E tests (Docker)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
See `specs/projects/dashboard/widgets/prometheus-widget/spec.md` for the full project specification.
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ interface PrometheusQuery {
|
|
|
12
12
|
interface WidgetSettings extends BaseWidgetSettings {
|
|
13
13
|
customTitle: string;
|
|
14
14
|
endpointUrl: string;
|
|
15
|
+
username?: string;
|
|
16
|
+
password?: string;
|
|
15
17
|
queriesPeriod: QueriesPeriod;
|
|
16
18
|
prometheusQueries: PrometheusQuery[];
|
|
17
19
|
displayedQueryParams: string[];
|
|
@@ -31,7 +33,7 @@ declare const getDisplayName: (lang: string) => string;
|
|
|
31
33
|
declare const getTitle: (_data: WidgetData | undefined, settings: WidgetSettings | undefined, _filters: FilterValues | undefined, lang: string) => string;
|
|
32
34
|
//#endregion
|
|
33
35
|
//#region src/version.d.ts
|
|
34
|
-
declare const LIBRARY_VERSION = "1.3.
|
|
36
|
+
declare const LIBRARY_VERSION = "1.3.19";
|
|
35
37
|
//#endregion
|
|
36
38
|
//#region src/index.d.ts
|
|
37
39
|
declare const requiredFeatures: string[];
|