@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.
Files changed (34) hide show
  1. package/README.md +31 -2
  2. package/fesm2022/juice-js-observability-alert.page-D2OL0zTT.mjs +405 -0
  3. package/fesm2022/juice-js-observability-alert.page-D2OL0zTT.mjs.map +1 -0
  4. package/fesm2022/juice-js-observability-alerts.page-BLJvD_op.mjs +208 -0
  5. package/fesm2022/juice-js-observability-alerts.page-BLJvD_op.mjs.map +1 -0
  6. package/fesm2022/juice-js-observability-logs.page-BWFLleyX.mjs +414 -0
  7. package/fesm2022/juice-js-observability-logs.page-BWFLleyX.mjs.map +1 -0
  8. package/fesm2022/juice-js-observability-metrics.page-D1caPbQq.mjs +268 -0
  9. package/fesm2022/juice-js-observability-metrics.page-D1caPbQq.mjs.map +1 -0
  10. package/fesm2022/juice-js-observability-overview.page-UBwHjlyq.mjs +213 -0
  11. package/fesm2022/juice-js-observability-overview.page-UBwHjlyq.mjs.map +1 -0
  12. package/fesm2022/juice-js-observability-resource.page-BZwLK_vU.mjs +275 -0
  13. package/fesm2022/juice-js-observability-resource.page-BZwLK_vU.mjs.map +1 -0
  14. package/fesm2022/juice-js-observability-resources.page-C0xWOb5I.mjs +210 -0
  15. package/fesm2022/juice-js-observability-resources.page-C0xWOb5I.mjs.map +1 -0
  16. package/fesm2022/juice-js-observability-rules.page-Db_U5rRu.mjs +176 -0
  17. package/fesm2022/juice-js-observability-rules.page-Db_U5rRu.mjs.map +1 -0
  18. package/fesm2022/juice-js-observability-service.page-B-SWJ9I5.mjs +727 -0
  19. package/fesm2022/juice-js-observability-service.page-B-SWJ9I5.mjs.map +1 -0
  20. package/fesm2022/juice-js-observability-services.page-BmWgFnC8.mjs +252 -0
  21. package/fesm2022/juice-js-observability-services.page-BmWgFnC8.mjs.map +1 -0
  22. package/fesm2022/juice-js-observability-telemetry-VA4_3nzr.mjs +1748 -0
  23. package/fesm2022/juice-js-observability-telemetry-VA4_3nzr.mjs.map +1 -0
  24. package/fesm2022/juice-js-observability-topology.page-DEUNp10U.mjs +458 -0
  25. package/fesm2022/juice-js-observability-topology.page-DEUNp10U.mjs.map +1 -0
  26. package/fesm2022/juice-js-observability-trace.page-gBhMG2eQ.mjs +530 -0
  27. package/fesm2022/juice-js-observability-trace.page-gBhMG2eQ.mjs.map +1 -0
  28. package/fesm2022/juice-js-observability-traces.page-BCQg4V4o.mjs +521 -0
  29. package/fesm2022/juice-js-observability-traces.page-BCQg4V4o.mjs.map +1 -0
  30. package/fesm2022/juice-js-observability.mjs +396 -0
  31. package/fesm2022/juice-js-observability.mjs.map +1 -0
  32. package/package.json +48 -4
  33. package/styles/_observability.scss +133 -0
  34. package/types/juice-js-observability.d.ts +387 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juice-js-observability-alerts.page-BLJvD_op.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/alerts.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { cursorList } from '../shared/paging';\nimport { problemText } from '../shared/telemetry';\n\n/** Alerts, newest first (Console requirements §14), filtered by state; 100 at a time, with the next on request. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatButtonModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Alerts</h1>\n @for (s of states; track s) {\n <a class=\"jc-chip\" [class.jc-selected]=\"s === (state() ?? 'firing')\" [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ s }}</a>\n }\n </jc-context-bar>\n @if (alerts.first.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (alerts.first.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Severity</th><th>Rule</th><th>Subject</th><th>State</th><th>Value</th><th>Fired</th><th>Acknowledged</th></tr></thead>\n <tbody>\n @for (a of alerts.items(); track a.id) {\n <tr>\n <td><span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity === 'Warning'\">{{ a.severity }}</span></td>\n <td><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a></td>\n <td>{{ a.subjectKey }}</td>\n <td>{{ a.state }}@if (a.noData) { <span class=\"jc-muted\" title=\"The last evaluation had too few samples; the state is kept\"> · no data</span> }</td>\n <td>{{ a.lastValue ?? '—' }}</td>\n <td>{{ a.firedAt | ago }}</td>\n <td>{{ a.acknowledgedBy ?? '—' }}</td>\n </tr>\n } @empty { @if (alerts.first.hasValue()) { <tr><td colspan=\"7\" class=\"jc-muted\">No {{ state() ?? 'firing' }} alerts.</td></tr> } }\n </tbody>\n </table>\n @if (alerts.items().length > 0) {\n <div class=\"jc-more\">\n <span class=\"jc-muted\">{{ alerts.items().length }} {{ state() ?? 'firing' }} alert{{ alerts.items().length === 1 ? '' : 's' }}{{ alerts.hasMore() ? ', newest first' : '' }}</span>\n @if (alerts.hasMore()) {\n <button mat-button (click)=\"alerts.more()\" [disabled]=\"alerts.loadingMore()\">{{ alerts.loadingMore() ? 'Loading…' : 'Load more' }}</button>\n }\n @if (alerts.moreError()) { <span class=\"jc-error\">{{ moreError() }}</span> }\n </div>\n }`,\n})\nexport class AlertsPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly states = ['firing', 'pending', 'resolved'];\n readonly state = input<string>();\n protected readonly alerts = cursorList(() => this.state() ?? 'firing', state => ({ state }), q => this.api.alerts(q));\n protected readonly error = computed(() => problemText(this.alerts.first.error()));\n protected readonly moreError = computed(() => problemText(this.alerts.moreError()));\n}\n"],"mappings":";;;;;;;;;AAkDA,IAAa,aAAb,MAAa,WAAU;CACF,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,SAAS;EAAC;EAAU;EAAW;CAAU;CACnD,QAAQ,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACb,SAAS,iBAAiB,KAAK,MAAK,KAAM,WAAU,WAAU,EAAE,MAAK,KAAK,MAAK,KAAK,IAAI,OAAO,CAAC,CAAC;CACjG,QAAQ,eAAe,YAAY,KAAK,OAAO,MAAM,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC9D,YAAY,eAAe,YAAY,KAAK,OAAO,UAAS,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAPxE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAV,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAU,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,OAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UAlCX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCN,UAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MAjCgB;IAAU,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;GAAe;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA,CAAA,WAAA;IAAA,UAAA,CAAA,aAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;GAAoB;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;IAAA,UAAA,CAAA,gBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAvE;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAiE;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAmC/E,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EArCtB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAiB;IAAsB;IAAY;GAAO;GAC1F,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCX,CAAA"}
@@ -0,0 +1,414 @@
1
+ import { ApiService, ContextService } from "./juice-js-observability.mjs";
2
+ import { l as ContextBar, t as LogTable } from "./juice-js-observability-telemetry-VA4_3nzr.mjs";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, computed, inject, input } from "@angular/core";
5
+ import { map } from "rxjs";
6
+ import { rxResource } from "@angular/core/rxjs-interop";
7
+ import { Router } from "@angular/router";
8
+ import * as i1 from "@angular/forms";
9
+ import { FormsModule } from "@angular/forms";
10
+ import * as i2 from "@angular/material/button";
11
+ import { MatButtonModule } from "@angular/material/button";
12
+ import { MatFormFieldModule } from "@angular/material/form-field";
13
+ import * as i4 from "@angular/material/input";
14
+ import { MatInputModule } from "@angular/material/input";
15
+ import * as i3 from "@angular/material/select";
16
+ import { MatSelectModule } from "@angular/material/select";
17
+ var LogsPage = class LogsPage {
18
+ ctx = inject(ContextService);
19
+ api = inject(ApiService);
20
+ router = inject(Router);
21
+ service = input(...ngDevMode ? [void 0, { debugName: "service" }] : /* istanbul ignore next */ []);
22
+ severity = input(...ngDevMode ? [void 0, { debugName: "severity" }] : /* istanbul ignore next */ []);
23
+ q = input(...ngDevMode ? [void 0, { debugName: "q" }] : /* istanbul ignore next */ []);
24
+ trace = input(...ngDevMode ? [void 0, { debugName: "trace" }] : /* istanbul ignore next */ []);
25
+ spanId = input(...ngDevMode ? [void 0, { debugName: "spanId" }] : /* istanbul ignore next */ []);
26
+ instance = input(...ngDevMode ? [void 0, { debugName: "instance" }] : /* istanbul ignore next */ []);
27
+ resource = input(...ngDevMode ? [void 0, { debugName: "resource" }] : /* istanbul ignore next */ []);
28
+ services = rxResource({ stream: () => this.api.resources("service").pipe(map((p) => p.items)) });
29
+ query = computed(() => ({
30
+ serviceId: this.service(),
31
+ minSeverity: this.severity(),
32
+ q: this.q(),
33
+ traceId: this.trace(),
34
+ spanId: this.spanId(),
35
+ instanceId: this.instance(),
36
+ resourceId: this.resource()
37
+ }), ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
38
+ apply(value) {
39
+ const queryParams = {};
40
+ for (const [key, v] of Object.entries(value)) queryParams[key] = v === "" || v === void 0 ? null : v;
41
+ this.router.navigate([], {
42
+ queryParams,
43
+ queryParamsHandling: "merge"
44
+ });
45
+ }
46
+ clear() {
47
+ this.router.navigate([], { queryParams: this.ctx.keep() });
48
+ }
49
+ static ɵfac = i0.ɵɵngDeclareFactory({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.4",
52
+ ngImport: i0,
53
+ type: LogsPage,
54
+ deps: [],
55
+ target: i0.ɵɵFactoryTarget.Component
56
+ });
57
+ static ɵcmp = i0.ɵɵngDeclareComponent({
58
+ minVersion: "17.0.0",
59
+ version: "22.2.4",
60
+ type: LogsPage,
61
+ isStandalone: true,
62
+ selector: "ng-component",
63
+ inputs: {
64
+ service: {
65
+ classPropertyName: "service",
66
+ publicName: "service",
67
+ isSignal: true,
68
+ isRequired: false,
69
+ transformFunction: null
70
+ },
71
+ severity: {
72
+ classPropertyName: "severity",
73
+ publicName: "severity",
74
+ isSignal: true,
75
+ isRequired: false,
76
+ transformFunction: null
77
+ },
78
+ q: {
79
+ classPropertyName: "q",
80
+ publicName: "q",
81
+ isSignal: true,
82
+ isRequired: false,
83
+ transformFunction: null
84
+ },
85
+ trace: {
86
+ classPropertyName: "trace",
87
+ publicName: "trace",
88
+ isSignal: true,
89
+ isRequired: false,
90
+ transformFunction: null
91
+ },
92
+ spanId: {
93
+ classPropertyName: "spanId",
94
+ publicName: "spanId",
95
+ isSignal: true,
96
+ isRequired: false,
97
+ transformFunction: null
98
+ },
99
+ instance: {
100
+ classPropertyName: "instance",
101
+ publicName: "instance",
102
+ isSignal: true,
103
+ isRequired: false,
104
+ transformFunction: null
105
+ },
106
+ resource: {
107
+ classPropertyName: "resource",
108
+ publicName: "resource",
109
+ isSignal: true,
110
+ isRequired: false,
111
+ transformFunction: null
112
+ }
113
+ },
114
+ ngImport: i0,
115
+ template: `
116
+ <jc-context-bar><h1>Logs</h1></jc-context-bar>
117
+ <form class="jc-filter-form" (ngSubmit)="apply(f.value)" #f="ngForm">
118
+ <mat-form-field subscriptSizing="dynamic">
119
+ <mat-label>Service</mat-label>
120
+ <mat-select name="service" [ngModel]="service() ?? ''">
121
+ <mat-option value="">Any</mat-option>
122
+ @for (s of services.value() ?? []; track s.id) { <mat-option [value]="s.id">{{ s.key }}</mat-option> }
123
+ </mat-select>
124
+ </mat-form-field>
125
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-sm">
126
+ <mat-label>Severity at least</mat-label>
127
+ <mat-select name="severity" [ngModel]="severity() ?? ''">
128
+ <mat-option value="">Any</mat-option><mat-option value="5">Debug</mat-option><mat-option value="9">Info</mat-option>
129
+ <mat-option value="13">Warn</mat-option><mat-option value="17">Error</mat-option><mat-option value="21">Fatal</mat-option>
130
+ </mat-select>
131
+ </mat-form-field>
132
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-wide"><mat-label>Message contains</mat-label><input matInput name="q" [ngModel]="q() ?? ''"></mat-form-field>
133
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Trace ID</mat-label><input matInput name="trace" [ngModel]="trace() ?? ''"></mat-form-field>
134
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Span ID</mat-label><input matInput name="spanId" [ngModel]="spanId() ?? ''"></mat-form-field>
135
+ <button mat-flat-button type="submit">Search</button>
136
+ <button mat-button type="button" (click)="clear()">Clear</button>
137
+ </form>
138
+ <jc-log-table [query]="query()" />`,
139
+ isInline: true,
140
+ dependencies: [
141
+ {
142
+ kind: "ngmodule",
143
+ type: FormsModule
144
+ },
145
+ {
146
+ kind: "directive",
147
+ type: i1.ɵNgNoValidate,
148
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
149
+ },
150
+ {
151
+ kind: "directive",
152
+ type: i1.DefaultValueAccessor,
153
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
154
+ },
155
+ {
156
+ kind: "directive",
157
+ type: i1.NgControlStatus,
158
+ selector: "[formControlName],[ngModel],[formControl]"
159
+ },
160
+ {
161
+ kind: "directive",
162
+ type: i1.NgControlStatusGroup,
163
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
164
+ },
165
+ {
166
+ kind: "directive",
167
+ type: i1.NgModel,
168
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
169
+ inputs: [
170
+ "name",
171
+ "disabled",
172
+ "ngModel",
173
+ "ngModelOptions"
174
+ ],
175
+ outputs: ["ngModelChange"],
176
+ exportAs: ["ngModel"]
177
+ },
178
+ {
179
+ kind: "directive",
180
+ type: i1.NgForm,
181
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
182
+ inputs: ["ngFormOptions"],
183
+ outputs: ["ngSubmit"],
184
+ exportAs: ["ngForm"]
185
+ },
186
+ {
187
+ kind: "ngmodule",
188
+ type: MatButtonModule
189
+ },
190
+ {
191
+ kind: "component",
192
+ type: i2.MatButton,
193
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
194
+ inputs: ["matButton"],
195
+ exportAs: ["matButton", "matAnchor"]
196
+ },
197
+ {
198
+ kind: "ngmodule",
199
+ type: MatFormFieldModule
200
+ },
201
+ {
202
+ kind: "component",
203
+ type: i3.MatFormField,
204
+ selector: "mat-form-field",
205
+ inputs: [
206
+ "hideRequiredMarker",
207
+ "color",
208
+ "floatLabel",
209
+ "appearance",
210
+ "subscriptSizing",
211
+ "hintLabel"
212
+ ],
213
+ exportAs: ["matFormField"]
214
+ },
215
+ {
216
+ kind: "directive",
217
+ type: i3.MatLabel,
218
+ selector: "mat-label"
219
+ },
220
+ {
221
+ kind: "ngmodule",
222
+ type: MatInputModule
223
+ },
224
+ {
225
+ kind: "directive",
226
+ type: i4.MatInput,
227
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
228
+ inputs: [
229
+ "disabled",
230
+ "id",
231
+ "placeholder",
232
+ "name",
233
+ "required",
234
+ "type",
235
+ "errorStateMatcher",
236
+ "aria-describedby",
237
+ "value",
238
+ "readonly",
239
+ "disabledInteractive"
240
+ ],
241
+ exportAs: ["matInput"]
242
+ },
243
+ {
244
+ kind: "ngmodule",
245
+ type: MatSelectModule
246
+ },
247
+ {
248
+ kind: "component",
249
+ type: i3.MatSelect,
250
+ selector: "mat-select",
251
+ inputs: [
252
+ "aria-describedby",
253
+ "panelClass",
254
+ "disabled",
255
+ "disableRipple",
256
+ "tabIndex",
257
+ "hideSingleSelectionIndicator",
258
+ "placeholder",
259
+ "required",
260
+ "multiple",
261
+ "disableOptionCentering",
262
+ "compareWith",
263
+ "value",
264
+ "aria-label",
265
+ "aria-labelledby",
266
+ "errorStateMatcher",
267
+ "typeaheadDebounceInterval",
268
+ "sortComparator",
269
+ "id",
270
+ "panelWidth",
271
+ "canSelectNullableOptions"
272
+ ],
273
+ outputs: [
274
+ "openedChange",
275
+ "opened",
276
+ "closed",
277
+ "selectionChange",
278
+ "valueChange"
279
+ ],
280
+ exportAs: ["matSelect"]
281
+ },
282
+ {
283
+ kind: "component",
284
+ type: i3.MatOption,
285
+ selector: "mat-option",
286
+ inputs: [
287
+ "value",
288
+ "id",
289
+ "disabled"
290
+ ],
291
+ outputs: ["onSelectionChange"],
292
+ exportAs: ["matOption"]
293
+ },
294
+ {
295
+ kind: "component",
296
+ type: ContextBar,
297
+ selector: "jc-context-bar"
298
+ },
299
+ {
300
+ kind: "component",
301
+ type: LogTable,
302
+ selector: "jc-log-table",
303
+ inputs: ["query", "compact"]
304
+ }
305
+ ],
306
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
307
+ });
308
+ };
309
+ i0.ɵɵngDeclareClassMetadata({
310
+ minVersion: "12.0.0",
311
+ version: "22.2.4",
312
+ ngImport: i0,
313
+ type: LogsPage,
314
+ decorators: [{
315
+ type: Component,
316
+ args: [{
317
+ changeDetection: ChangeDetectionStrategy.OnPush,
318
+ imports: [
319
+ FormsModule,
320
+ MatButtonModule,
321
+ MatFormFieldModule,
322
+ MatInputModule,
323
+ MatSelectModule,
324
+ ContextBar,
325
+ LogTable
326
+ ],
327
+ template: `
328
+ <jc-context-bar><h1>Logs</h1></jc-context-bar>
329
+ <form class="jc-filter-form" (ngSubmit)="apply(f.value)" #f="ngForm">
330
+ <mat-form-field subscriptSizing="dynamic">
331
+ <mat-label>Service</mat-label>
332
+ <mat-select name="service" [ngModel]="service() ?? ''">
333
+ <mat-option value="">Any</mat-option>
334
+ @for (s of services.value() ?? []; track s.id) { <mat-option [value]="s.id">{{ s.key }}</mat-option> }
335
+ </mat-select>
336
+ </mat-form-field>
337
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-sm">
338
+ <mat-label>Severity at least</mat-label>
339
+ <mat-select name="severity" [ngModel]="severity() ?? ''">
340
+ <mat-option value="">Any</mat-option><mat-option value="5">Debug</mat-option><mat-option value="9">Info</mat-option>
341
+ <mat-option value="13">Warn</mat-option><mat-option value="17">Error</mat-option><mat-option value="21">Fatal</mat-option>
342
+ </mat-select>
343
+ </mat-form-field>
344
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-wide"><mat-label>Message contains</mat-label><input matInput name="q" [ngModel]="q() ?? ''"></mat-form-field>
345
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Trace ID</mat-label><input matInput name="trace" [ngModel]="trace() ?? ''"></mat-form-field>
346
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Span ID</mat-label><input matInput name="spanId" [ngModel]="spanId() ?? ''"></mat-form-field>
347
+ <button mat-flat-button type="submit">Search</button>
348
+ <button mat-button type="button" (click)="clear()">Clear</button>
349
+ </form>
350
+ <jc-log-table [query]="query()" />`
351
+ }]
352
+ }],
353
+ propDecorators: {
354
+ service: [{
355
+ type: i0.Input,
356
+ args: [{
357
+ isSignal: true,
358
+ alias: "service",
359
+ required: false
360
+ }]
361
+ }],
362
+ severity: [{
363
+ type: i0.Input,
364
+ args: [{
365
+ isSignal: true,
366
+ alias: "severity",
367
+ required: false
368
+ }]
369
+ }],
370
+ q: [{
371
+ type: i0.Input,
372
+ args: [{
373
+ isSignal: true,
374
+ alias: "q",
375
+ required: false
376
+ }]
377
+ }],
378
+ trace: [{
379
+ type: i0.Input,
380
+ args: [{
381
+ isSignal: true,
382
+ alias: "trace",
383
+ required: false
384
+ }]
385
+ }],
386
+ spanId: [{
387
+ type: i0.Input,
388
+ args: [{
389
+ isSignal: true,
390
+ alias: "spanId",
391
+ required: false
392
+ }]
393
+ }],
394
+ instance: [{
395
+ type: i0.Input,
396
+ args: [{
397
+ isSignal: true,
398
+ alias: "instance",
399
+ required: false
400
+ }]
401
+ }],
402
+ resource: [{
403
+ type: i0.Input,
404
+ args: [{
405
+ isSignal: true,
406
+ alias: "resource",
407
+ required: false
408
+ }]
409
+ }]
410
+ }
411
+ });
412
+ export { LogsPage };
413
+
414
+ //# sourceMappingURL=juice-js-observability-logs.page-BWFLleyX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juice-js-observability-logs.page-BWFLleyX.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/logs.page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { Router } from '@angular/router';\nimport { map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { ContextBar } from '../shared/ui';\nimport { LogTable } from '../shared/telemetry';\n\n/** Log search (Console requirements §7): by service, severity, text, trace or span; each record links to its trace. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatSelectModule, ContextBar, LogTable],\n template: `\n <jc-context-bar><h1>Logs</h1></jc-context-bar>\n <form class=\"jc-filter-form\" (ngSubmit)=\"apply(f.value)\" #f=\"ngForm\">\n <mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>Service</mat-label>\n <mat-select name=\"service\" [ngModel]=\"service() ?? ''\">\n <mat-option value=\"\">Any</mat-option>\n @for (s of services.value() ?? []; track s.id) { <mat-option [value]=\"s.id\">{{ s.key }}</mat-option> }\n </mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\">\n <mat-label>Severity at least</mat-label>\n <mat-select name=\"severity\" [ngModel]=\"severity() ?? ''\">\n <mat-option value=\"\">Any</mat-option><mat-option value=\"5\">Debug</mat-option><mat-option value=\"9\">Info</mat-option>\n <mat-option value=\"13\">Warn</mat-option><mat-option value=\"17\">Error</mat-option><mat-option value=\"21\">Fatal</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Message contains</mat-label><input matInput name=\"q\" [ngModel]=\"q() ?? ''\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Trace ID</mat-label><input matInput name=\"trace\" [ngModel]=\"trace() ?? ''\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Span ID</mat-label><input matInput name=\"spanId\" [ngModel]=\"spanId() ?? ''\"></mat-form-field>\n <button mat-flat-button type=\"submit\">Search</button>\n <button mat-button type=\"button\" (click)=\"clear()\">Clear</button>\n </form>\n <jc-log-table [query]=\"query()\" />`,\n})\nexport class LogsPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n private readonly router = inject(Router);\n\n readonly service = input<string>();\n readonly severity = input<string>();\n readonly q = input<string>();\n readonly trace = input<string>();\n readonly spanId = input<string>();\n readonly instance = input<string>();\n readonly resource = input<string>();\n\n protected readonly services = rxResource({ stream: () => this.api.resources('service').pipe(map(p => p.items)) });\n protected readonly query = computed(() => ({\n serviceId: this.service(), minSeverity: this.severity(), q: this.q(), traceId: this.trace(), spanId: this.spanId(),\n instanceId: this.instance(), resourceId: this.resource(),\n }));\n\n apply(value: Record<string, unknown>) {\n const queryParams: Record<string, unknown> = {};\n for (const [key, v] of Object.entries(value)) queryParams[key] = v === '' || v === undefined ? null : v;\n void this.router.navigate([], { queryParams, queryParamsHandling: 'merge' });\n }\n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