@juice-js/observability 0.0.0-stage → 1.0.0-alpha.11

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.
Files changed (34) hide show
  1. package/README.md +63 -2
  2. package/fesm2022/juice-js-observability-alert.page-TKwqJT2d.mjs +404 -0
  3. package/fesm2022/juice-js-observability-alert.page-TKwqJT2d.mjs.map +1 -0
  4. package/fesm2022/juice-js-observability-alerts.page-B-2uS9wr.mjs +211 -0
  5. package/fesm2022/juice-js-observability-alerts.page-B-2uS9wr.mjs.map +1 -0
  6. package/fesm2022/juice-js-observability-logs.page-CZNbTl2Q.mjs +413 -0
  7. package/fesm2022/juice-js-observability-logs.page-CZNbTl2Q.mjs.map +1 -0
  8. package/fesm2022/juice-js-observability-metrics.page-DoVED9MT.mjs +267 -0
  9. package/fesm2022/juice-js-observability-metrics.page-DoVED9MT.mjs.map +1 -0
  10. package/fesm2022/juice-js-observability-overview.page-Cod7-cIy.mjs +249 -0
  11. package/fesm2022/juice-js-observability-overview.page-Cod7-cIy.mjs.map +1 -0
  12. package/fesm2022/juice-js-observability-resource.page-C8RhUipF.mjs +274 -0
  13. package/fesm2022/juice-js-observability-resource.page-C8RhUipF.mjs.map +1 -0
  14. package/fesm2022/juice-js-observability-resources.page-KadGxEAh.mjs +209 -0
  15. package/fesm2022/juice-js-observability-resources.page-KadGxEAh.mjs.map +1 -0
  16. package/fesm2022/juice-js-observability-rules.page-DKWvNpu9.mjs +175 -0
  17. package/fesm2022/juice-js-observability-rules.page-DKWvNpu9.mjs.map +1 -0
  18. package/fesm2022/juice-js-observability-service.page-_yK0kVYS.mjs +726 -0
  19. package/fesm2022/juice-js-observability-service.page-_yK0kVYS.mjs.map +1 -0
  20. package/fesm2022/juice-js-observability-services.page-BtG8zyiI.mjs +251 -0
  21. package/fesm2022/juice-js-observability-services.page-BtG8zyiI.mjs.map +1 -0
  22. package/fesm2022/juice-js-observability-telemetry-B5jMJYfn.mjs +1801 -0
  23. package/fesm2022/juice-js-observability-telemetry-B5jMJYfn.mjs.map +1 -0
  24. package/fesm2022/juice-js-observability-topology.page-B7aXWOYV.mjs +486 -0
  25. package/fesm2022/juice-js-observability-topology.page-B7aXWOYV.mjs.map +1 -0
  26. package/fesm2022/juice-js-observability-trace.page-CkLNNnKf.mjs +528 -0
  27. package/fesm2022/juice-js-observability-trace.page-CkLNNnKf.mjs.map +1 -0
  28. package/fesm2022/juice-js-observability-traces.page-DgvNixIc.mjs +520 -0
  29. package/fesm2022/juice-js-observability-traces.page-DgvNixIc.mjs.map +1 -0
  30. package/fesm2022/juice-js-observability.mjs +405 -0
  31. package/fesm2022/juice-js-observability.mjs.map +1 -0
  32. package/package.json +48 -4
  33. package/styles/_observability.scss +220 -0
  34. package/types/juice-js-observability.d.ts +400 -0
@@ -0,0 +1,175 @@
1
+ import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
2
+ import { a as problemText, l as ContextBar, m as AgoPipe, x as apiResource } from "./juice-js-observability-telemetry-B5jMJYfn.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 { RouterLink } from "@angular/router";
7
+ import * as i1 from "@angular/material/progress-bar";
8
+ import { MatProgressBarModule } from "@angular/material/progress-bar";
9
+ var RulesPage = class RulesPage {
10
+ ctx = inject(ContextService);
11
+ api = inject(ApiService);
12
+ data = apiResource({ stream: () => forkJoin({
13
+ rules: this.api.rules().pipe(map((p) => p.items)),
14
+ firing: this.api.allAlerts({ state: "firing" }).pipe(map((p) => p.items)),
15
+ pending: this.api.allAlerts({ state: "pending" }).pipe(map((p) => p.items))
16
+ }) });
17
+ error = computed(() => problemText(this.data.error()), ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
18
+ rows = computed(() => {
19
+ const d = this.data.value();
20
+ if (!d) return [];
21
+ const open = [...d.firing, ...d.pending];
22
+ return d.rules.map((r) => {
23
+ const mine = open.filter((a) => a.rule === r.key);
24
+ const last = mine.map((a) => a.lastEvaluatedAt).sort().at(-1) ?? null;
25
+ return {
26
+ ...r,
27
+ open: mine,
28
+ lastEvaluatedAt: last
29
+ };
30
+ });
31
+ }, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
32
+ static ɵfac = i0.ɵɵngDeclareFactory({
33
+ minVersion: "12.0.0",
34
+ version: "22.2.4",
35
+ ngImport: i0,
36
+ type: RulesPage,
37
+ deps: [],
38
+ target: i0.ɵɵFactoryTarget.Component
39
+ });
40
+ static ɵcmp = i0.ɵɵngDeclareComponent({
41
+ minVersion: "17.0.0",
42
+ version: "22.2.4",
43
+ type: RulesPage,
44
+ isStandalone: true,
45
+ selector: "ng-component",
46
+ ngImport: i0,
47
+ template: `
48
+ <jc-context-bar><h1>Rules</h1><span class="jc-muted">From deployment configuration (rules.json); read-only.</span></jc-context-bar>
49
+ @if (data.isLoading()) { <mat-progress-bar mode="indeterminate" /> }
50
+ @if (data.error()) { <p class="jc-error">{{ error() }}</p> }
51
+ <table class="jc-table">
52
+ <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>
53
+ <tbody>
54
+ @for (r of rows(); track r.key) {
55
+ <tr [class.jc-muted]="!r.enabled">
56
+ <td><strong>{{ r.name }}</strong><div class="jc-muted jc-small">{{ r.key }}@if (!r.enabled) { · disabled }</div></td>
57
+ <td>{{ r.template }}</td>
58
+ <td>{{ r.severity }}</td>
59
+ <td>{{ r.definition['threshold'] ?? '—' }}</td>
60
+ <td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>
61
+ <td>{{ r.definition['forDuration'] ?? '—' }}</td>
62
+ <td>
63
+ @for (a of r.open; track a.id) {
64
+ <div><a [routerLink]="['alerts', a.id] | jcLink" [queryParams]="ctx.keep()">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>
65
+ } @empty { <span class="jc-muted">none</span> }
66
+ </td>
67
+ <td>{{ r.lastEvaluatedAt | ago }}</td>
68
+ </tr>
69
+ }
70
+ </tbody>
71
+ </table>`,
72
+ isInline: true,
73
+ dependencies: [
74
+ {
75
+ kind: "directive",
76
+ type: RouterLink,
77
+ selector: "[routerLink]",
78
+ inputs: [
79
+ "target",
80
+ "queryParams",
81
+ "fragment",
82
+ "queryParamsHandling",
83
+ "state",
84
+ "info",
85
+ "relativeTo",
86
+ "preserveFragment",
87
+ "skipLocationChange",
88
+ "replaceUrl",
89
+ "browserUrl",
90
+ "routerLink"
91
+ ]
92
+ },
93
+ {
94
+ kind: "ngmodule",
95
+ type: MatProgressBarModule
96
+ },
97
+ {
98
+ kind: "component",
99
+ type: i1.MatProgressBar,
100
+ selector: "mat-progress-bar",
101
+ inputs: [
102
+ "color",
103
+ "value",
104
+ "bufferValue",
105
+ "mode"
106
+ ],
107
+ outputs: ["animationEnd"],
108
+ exportAs: ["matProgressBar"]
109
+ },
110
+ {
111
+ kind: "component",
112
+ type: ContextBar,
113
+ selector: "jc-context-bar"
114
+ },
115
+ {
116
+ kind: "pipe",
117
+ type: LinkPipe,
118
+ name: "jcLink"
119
+ },
120
+ {
121
+ kind: "pipe",
122
+ type: AgoPipe,
123
+ name: "ago"
124
+ }
125
+ ],
126
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
127
+ });
128
+ };
129
+ i0.ɵɵngDeclareClassMetadata({
130
+ minVersion: "12.0.0",
131
+ version: "22.2.4",
132
+ ngImport: i0,
133
+ type: RulesPage,
134
+ decorators: [{
135
+ type: Component,
136
+ args: [{
137
+ changeDetection: ChangeDetectionStrategy.OnPush,
138
+ imports: [
139
+ LinkPipe,
140
+ RouterLink,
141
+ MatProgressBarModule,
142
+ ContextBar,
143
+ AgoPipe
144
+ ],
145
+ template: `
146
+ <jc-context-bar><h1>Rules</h1><span class="jc-muted">From deployment configuration (rules.json); read-only.</span></jc-context-bar>
147
+ @if (data.isLoading()) { <mat-progress-bar mode="indeterminate" /> }
148
+ @if (data.error()) { <p class="jc-error">{{ error() }}</p> }
149
+ <table class="jc-table">
150
+ <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>
151
+ <tbody>
152
+ @for (r of rows(); track r.key) {
153
+ <tr [class.jc-muted]="!r.enabled">
154
+ <td><strong>{{ r.name }}</strong><div class="jc-muted jc-small">{{ r.key }}@if (!r.enabled) { · disabled }</div></td>
155
+ <td>{{ r.template }}</td>
156
+ <td>{{ r.severity }}</td>
157
+ <td>{{ r.definition['threshold'] ?? '—' }}</td>
158
+ <td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>
159
+ <td>{{ r.definition['forDuration'] ?? '—' }}</td>
160
+ <td>
161
+ @for (a of r.open; track a.id) {
162
+ <div><a [routerLink]="['alerts', a.id] | jcLink" [queryParams]="ctx.keep()">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>
163
+ } @empty { <span class="jc-muted">none</span> }
164
+ </td>
165
+ <td>{{ r.lastEvaluatedAt | ago }}</td>
166
+ </tr>
167
+ }
168
+ </tbody>
169
+ </table>`
170
+ }]
171
+ }]
172
+ });
173
+ export { RulesPage };
174
+
175
+ //# sourceMappingURL=juice-js-observability-rules.page-DKWvNpu9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juice-js-observability-rules.page-DKWvNpu9.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 { apiResource } from '../shared/resource';\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 = apiResource({\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,YAAY,EACpC,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,CAA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