@juice-js/observability 0.0.0-stage → 1.0.0-alpha.1
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 +31 -2
- package/fesm2022/juice-js-observability-alert.page-D2OL0zTT.mjs +405 -0
- package/fesm2022/juice-js-observability-alert.page-D2OL0zTT.mjs.map +1 -0
- package/fesm2022/juice-js-observability-alerts.page-BLJvD_op.mjs +208 -0
- package/fesm2022/juice-js-observability-alerts.page-BLJvD_op.mjs.map +1 -0
- package/fesm2022/juice-js-observability-logs.page-BWFLleyX.mjs +414 -0
- package/fesm2022/juice-js-observability-logs.page-BWFLleyX.mjs.map +1 -0
- package/fesm2022/juice-js-observability-metrics.page-D1caPbQq.mjs +268 -0
- package/fesm2022/juice-js-observability-metrics.page-D1caPbQq.mjs.map +1 -0
- package/fesm2022/juice-js-observability-overview.page-UBwHjlyq.mjs +213 -0
- package/fesm2022/juice-js-observability-overview.page-UBwHjlyq.mjs.map +1 -0
- package/fesm2022/juice-js-observability-resource.page-BZwLK_vU.mjs +275 -0
- package/fesm2022/juice-js-observability-resource.page-BZwLK_vU.mjs.map +1 -0
- package/fesm2022/juice-js-observability-resources.page-C0xWOb5I.mjs +210 -0
- package/fesm2022/juice-js-observability-resources.page-C0xWOb5I.mjs.map +1 -0
- package/fesm2022/juice-js-observability-rules.page-Db_U5rRu.mjs +176 -0
- package/fesm2022/juice-js-observability-rules.page-Db_U5rRu.mjs.map +1 -0
- package/fesm2022/juice-js-observability-service.page-B-SWJ9I5.mjs +727 -0
- package/fesm2022/juice-js-observability-service.page-B-SWJ9I5.mjs.map +1 -0
- package/fesm2022/juice-js-observability-services.page-BmWgFnC8.mjs +252 -0
- package/fesm2022/juice-js-observability-services.page-BmWgFnC8.mjs.map +1 -0
- package/fesm2022/juice-js-observability-telemetry-VA4_3nzr.mjs +1748 -0
- package/fesm2022/juice-js-observability-telemetry-VA4_3nzr.mjs.map +1 -0
- package/fesm2022/juice-js-observability-topology.page-DEUNp10U.mjs +458 -0
- package/fesm2022/juice-js-observability-topology.page-DEUNp10U.mjs.map +1 -0
- package/fesm2022/juice-js-observability-trace.page-gBhMG2eQ.mjs +530 -0
- package/fesm2022/juice-js-observability-trace.page-gBhMG2eQ.mjs.map +1 -0
- package/fesm2022/juice-js-observability-traces.page-BCQg4V4o.mjs +521 -0
- package/fesm2022/juice-js-observability-traces.page-BCQg4V4o.mjs.map +1 -0
- package/fesm2022/juice-js-observability.mjs +396 -0
- package/fesm2022/juice-js-observability.mjs.map +1 -0
- package/package.json +48 -4
- package/styles/_observability.scss +133 -0
- package/types/juice-js-observability.d.ts +387 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
+
import { a as problemText, f as AgoPipe, l as ContextBar } from "./juice-js-observability-telemetry-VA4_3nzr.mjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, computed, inject } from "@angular/core";
|
|
5
|
+
import { forkJoin, map } from "rxjs";
|
|
6
|
+
import { rxResource } from "@angular/core/rxjs-interop";
|
|
7
|
+
import { RouterLink } from "@angular/router";
|
|
8
|
+
import * as i1 from "@angular/material/progress-bar";
|
|
9
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
10
|
+
var RulesPage = class RulesPage {
|
|
11
|
+
ctx = inject(ContextService);
|
|
12
|
+
api = inject(ApiService);
|
|
13
|
+
data = rxResource({ stream: () => forkJoin({
|
|
14
|
+
rules: this.api.rules().pipe(map((p) => p.items)),
|
|
15
|
+
firing: this.api.allAlerts({ state: "firing" }).pipe(map((p) => p.items)),
|
|
16
|
+
pending: this.api.allAlerts({ state: "pending" }).pipe(map((p) => p.items))
|
|
17
|
+
}) });
|
|
18
|
+
error = computed(() => problemText(this.data.error()), ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
|
|
19
|
+
rows = computed(() => {
|
|
20
|
+
const d = this.data.value();
|
|
21
|
+
if (!d) return [];
|
|
22
|
+
const open = [...d.firing, ...d.pending];
|
|
23
|
+
return d.rules.map((r) => {
|
|
24
|
+
const mine = open.filter((a) => a.rule === r.key);
|
|
25
|
+
const last = mine.map((a) => a.lastEvaluatedAt).sort().at(-1) ?? null;
|
|
26
|
+
return {
|
|
27
|
+
...r,
|
|
28
|
+
open: mine,
|
|
29
|
+
lastEvaluatedAt: last
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
34
|
+
minVersion: "12.0.0",
|
|
35
|
+
version: "22.2.4",
|
|
36
|
+
ngImport: i0,
|
|
37
|
+
type: RulesPage,
|
|
38
|
+
deps: [],
|
|
39
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
40
|
+
});
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
42
|
+
minVersion: "17.0.0",
|
|
43
|
+
version: "22.2.4",
|
|
44
|
+
type: RulesPage,
|
|
45
|
+
isStandalone: true,
|
|
46
|
+
selector: "ng-component",
|
|
47
|
+
ngImport: i0,
|
|
48
|
+
template: `
|
|
49
|
+
<jc-context-bar><h1>Rules</h1><span class="jc-muted">From deployment configuration (rules.json); read-only.</span></jc-context-bar>
|
|
50
|
+
@if (data.isLoading()) { <mat-progress-bar mode="indeterminate" /> }
|
|
51
|
+
@if (data.error()) { <p class="jc-error">{{ error() }}</p> }
|
|
52
|
+
<table class="jc-table">
|
|
53
|
+
<thead><tr><th>Rule</th><th>Template</th><th>Severity</th><th>Threshold</th><th>Recovery</th><th>Wait</th><th>Open alerts</th><th>Last evaluation</th></tr></thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
@for (r of rows(); track r.key) {
|
|
56
|
+
<tr [class.jc-muted]="!r.enabled">
|
|
57
|
+
<td><strong>{{ r.name }}</strong><div class="jc-muted jc-small">{{ r.key }}@if (!r.enabled) { · disabled }</div></td>
|
|
58
|
+
<td>{{ r.template }}</td>
|
|
59
|
+
<td>{{ r.severity }}</td>
|
|
60
|
+
<td>{{ r.definition['threshold'] ?? '—' }}</td>
|
|
61
|
+
<td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>
|
|
62
|
+
<td>{{ r.definition['forDuration'] ?? '—' }}</td>
|
|
63
|
+
<td>
|
|
64
|
+
@for (a of r.open; track a.id) {
|
|
65
|
+
<div><a [routerLink]="['alerts', a.id] | jcLink" [queryParams]="ctx.keep()">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>
|
|
66
|
+
} @empty { <span class="jc-muted">none</span> }
|
|
67
|
+
</td>
|
|
68
|
+
<td>{{ r.lastEvaluatedAt | ago }}</td>
|
|
69
|
+
</tr>
|
|
70
|
+
}
|
|
71
|
+
</tbody>
|
|
72
|
+
</table>`,
|
|
73
|
+
isInline: true,
|
|
74
|
+
dependencies: [
|
|
75
|
+
{
|
|
76
|
+
kind: "directive",
|
|
77
|
+
type: RouterLink,
|
|
78
|
+
selector: "[routerLink]",
|
|
79
|
+
inputs: [
|
|
80
|
+
"target",
|
|
81
|
+
"queryParams",
|
|
82
|
+
"fragment",
|
|
83
|
+
"queryParamsHandling",
|
|
84
|
+
"state",
|
|
85
|
+
"info",
|
|
86
|
+
"relativeTo",
|
|
87
|
+
"preserveFragment",
|
|
88
|
+
"skipLocationChange",
|
|
89
|
+
"replaceUrl",
|
|
90
|
+
"browserUrl",
|
|
91
|
+
"routerLink"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
kind: "ngmodule",
|
|
96
|
+
type: MatProgressBarModule
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
kind: "component",
|
|
100
|
+
type: i1.MatProgressBar,
|
|
101
|
+
selector: "mat-progress-bar",
|
|
102
|
+
inputs: [
|
|
103
|
+
"color",
|
|
104
|
+
"value",
|
|
105
|
+
"bufferValue",
|
|
106
|
+
"mode"
|
|
107
|
+
],
|
|
108
|
+
outputs: ["animationEnd"],
|
|
109
|
+
exportAs: ["matProgressBar"]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
kind: "component",
|
|
113
|
+
type: ContextBar,
|
|
114
|
+
selector: "jc-context-bar"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
kind: "pipe",
|
|
118
|
+
type: LinkPipe,
|
|
119
|
+
name: "jcLink"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
kind: "pipe",
|
|
123
|
+
type: AgoPipe,
|
|
124
|
+
name: "ago"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
131
|
+
minVersion: "12.0.0",
|
|
132
|
+
version: "22.2.4",
|
|
133
|
+
ngImport: i0,
|
|
134
|
+
type: RulesPage,
|
|
135
|
+
decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{
|
|
138
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
|
+
imports: [
|
|
140
|
+
LinkPipe,
|
|
141
|
+
RouterLink,
|
|
142
|
+
MatProgressBarModule,
|
|
143
|
+
ContextBar,
|
|
144
|
+
AgoPipe
|
|
145
|
+
],
|
|
146
|
+
template: `
|
|
147
|
+
<jc-context-bar><h1>Rules</h1><span class="jc-muted">From deployment configuration (rules.json); read-only.</span></jc-context-bar>
|
|
148
|
+
@if (data.isLoading()) { <mat-progress-bar mode="indeterminate" /> }
|
|
149
|
+
@if (data.error()) { <p class="jc-error">{{ error() }}</p> }
|
|
150
|
+
<table class="jc-table">
|
|
151
|
+
<thead><tr><th>Rule</th><th>Template</th><th>Severity</th><th>Threshold</th><th>Recovery</th><th>Wait</th><th>Open alerts</th><th>Last evaluation</th></tr></thead>
|
|
152
|
+
<tbody>
|
|
153
|
+
@for (r of rows(); track r.key) {
|
|
154
|
+
<tr [class.jc-muted]="!r.enabled">
|
|
155
|
+
<td><strong>{{ r.name }}</strong><div class="jc-muted jc-small">{{ r.key }}@if (!r.enabled) { · disabled }</div></td>
|
|
156
|
+
<td>{{ r.template }}</td>
|
|
157
|
+
<td>{{ r.severity }}</td>
|
|
158
|
+
<td>{{ r.definition['threshold'] ?? '—' }}</td>
|
|
159
|
+
<td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>
|
|
160
|
+
<td>{{ r.definition['forDuration'] ?? '—' }}</td>
|
|
161
|
+
<td>
|
|
162
|
+
@for (a of r.open; track a.id) {
|
|
163
|
+
<div><a [routerLink]="['alerts', a.id] | jcLink" [queryParams]="ctx.keep()">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>
|
|
164
|
+
} @empty { <span class="jc-muted">none</span> }
|
|
165
|
+
</td>
|
|
166
|
+
<td>{{ r.lastEvaluatedAt | ago }}</td>
|
|
167
|
+
</tr>
|
|
168
|
+
}
|
|
169
|
+
</tbody>
|
|
170
|
+
</table>`
|
|
171
|
+
}]
|
|
172
|
+
}]
|
|
173
|
+
});
|
|
174
|
+
export { RulesPage };
|
|
175
|
+
|
|
176
|
+
//# sourceMappingURL=juice-js-observability-rules.page-Db_U5rRu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"juice-js-observability-rules.page-Db_U5rRu.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/rules.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\n/**\n * Rules and their current state (Console requirements §14). Rules are typed templates in deployment configuration\n * (D5), so this page reads them; it never edits them and never takes a query.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Rules</h1><span class=\"jc-muted\">From deployment configuration (rules.json); read-only.</span></jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Rule</th><th>Template</th><th>Severity</th><th>Threshold</th><th>Recovery</th><th>Wait</th><th>Open alerts</th><th>Last evaluation</th></tr></thead>\n <tbody>\n @for (r of rows(); track r.key) {\n <tr [class.jc-muted]=\"!r.enabled\">\n <td><strong>{{ r.name }}</strong><div class=\"jc-muted jc-small\">{{ r.key }}@if (!r.enabled) { · disabled }</div></td>\n <td>{{ r.template }}</td>\n <td>{{ r.severity }}</td>\n <td>{{ r.definition['threshold'] ?? '—' }}</td>\n <td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>\n <td>{{ r.definition['forDuration'] ?? '—' }}</td>\n <td>\n @for (a of r.open; track a.id) {\n <div><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>\n } @empty { <span class=\"jc-muted\">none</span> }\n </td>\n <td>{{ r.lastEvaluatedAt | ago }}</td>\n </tr>\n }\n </tbody>\n </table>`,\n})\nexport class RulesPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly data = rxResource({\n stream: () => forkJoin({\n rules: this.api.rules().pipe(map(p => p.items)),\n firing: this.api.allAlerts({ state: 'firing' }).pipe(map(p => p.items)),\n pending: this.api.allAlerts({ state: 'pending' }).pipe(map(p => p.items)),\n }),\n });\n protected readonly error = computed(() => problemText(this.data.error()));\n protected readonly rows = computed(() => {\n const d = this.data.value();\n if (!d) return [];\n const open = [...d.firing, ...d.pending];\n return d.rules.map(r => {\n const mine = open.filter(a => a.rule === r.key);\n const last = mine.map(a => a.lastEvaluatedAt).sort().at(-1) ?? null;\n return { ...r, open: mine, lastEvaluatedAt: last };\n });\n });\n}\n"],"mappings":";;;;;;;;;AA6CA,IAAa,YAAb,MAAa,UAAS;CACD,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,OAAO,WAAW,EACnC,cAAc,SAAS;EACrB,OAAO,KAAK,IAAI,MAAK,CAAE,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;EAC9C,QAAQ,KAAK,IAAI,UAAU,EAAE,OAAO,SAAQ,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;EACtE,SAAS,KAAK,IAAI,UAAU,EAAE,OAAO,UAAS,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;CACzE,CAAA,EACF,CAAA;CACkB,QAAQ,eAAe,YAAY,KAAK,KAAK,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACtD,OAAO,eAAc;EACtC,MAAM,IAAI,KAAK,KAAK,MAAK;EACzB,IAAI,CAAC,GAAG,OAAO,CAAA;EACf,MAAM,OAAO,CAAC,GAAG,EAAE,QAAQ,GAAG,EAAE,OAAO;EACvC,OAAO,EAAE,MAAM,KAAI,MAAI;GACrB,MAAM,OAAO,KAAK,QAAO,MAAK,EAAE,SAAS,EAAE,GAAG;GAC9C,MAAM,OAAO,KAAK,KAAI,MAAK,EAAE,eAAe,CAAC,CAAC,KAAI,CAAE,CAAC,GAAG,EAAE,KAAK;GAC/D,OAAO;IAAE,GAAG;IAAG,MAAM;IAAM,iBAAiB;GAAI;EAClD,CAAC;CACH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