@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,520 @@
1
+ import { ApiService, ContextService } from "./juice-js-observability.mjs";
2
+ import { i as TraceTable, l as ContextBar, x as apiResource } from "./juice-js-observability-telemetry-B5jMJYfn.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 { Router } from "@angular/router";
7
+ import * as i1 from "@angular/forms";
8
+ import { FormsModule } from "@angular/forms";
9
+ import * as i2 from "@angular/material/button";
10
+ import { MatButtonModule } from "@angular/material/button";
11
+ import { MatFormFieldModule } from "@angular/material/form-field";
12
+ import * as i4 from "@angular/material/input";
13
+ import { MatInputModule } from "@angular/material/input";
14
+ import * as i3 from "@angular/material/select";
15
+ import { MatSelectModule } from "@angular/material/select";
16
+ var TracesPage = class TracesPage {
17
+ ctx = inject(ContextService);
18
+ api = inject(ApiService);
19
+ router = inject(Router);
20
+ service = input(...ngDevMode ? [void 0, { debugName: "service" }] : /* istanbul ignore next */ []);
21
+ op = input(...ngDevMode ? [void 0, { debugName: "op" }] : /* istanbul ignore next */ []);
22
+ status = input(...ngDevMode ? [void 0, { debugName: "status" }] : /* istanbul ignore next */ []);
23
+ min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
24
+ max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
25
+ trace = input(...ngDevMode ? [void 0, { debugName: "trace" }] : /* istanbul ignore next */ []);
26
+ spanId = input(...ngDevMode ? [void 0, { debugName: "spanId" }] : /* istanbul ignore next */ []);
27
+ attr = input(...ngDevMode ? [void 0, { debugName: "attr" }] : /* istanbul ignore next */ []);
28
+ instance = input(...ngDevMode ? [void 0, { debugName: "instance" }] : /* istanbul ignore next */ []);
29
+ resource = input(...ngDevMode ? [void 0, { debugName: "resource" }] : /* istanbul ignore next */ []);
30
+ dependency = input(...ngDevMode ? [void 0, { debugName: "dependency" }] : /* istanbul ignore next */ []);
31
+ services = apiResource({ stream: () => this.api.resources("service").pipe(map((p) => p.items)) });
32
+ scopeText = computed(() => [
33
+ this.instance() && "an instance",
34
+ this.resource() && "a resource",
35
+ this.dependency() && "a dependency"
36
+ ].filter((x) => !!x).join(", "), ...ngDevMode ? [{ debugName: "scopeText" }] : /* istanbul ignore next */ []);
37
+ attributes = computed(() => {
38
+ const a = this.attr();
39
+ return a === void 0 ? [] : Array.isArray(a) ? a : [a];
40
+ }, ...ngDevMode ? [{ debugName: "attributes" }] : /* istanbul ignore next */ []);
41
+ query = computed(() => ({
42
+ serviceId: this.service(),
43
+ operation: this.op(),
44
+ status: this.status(),
45
+ minDurationMs: this.min(),
46
+ maxDurationMs: this.max(),
47
+ traceId: this.trace(),
48
+ spanId: this.spanId(),
49
+ attribute: this.attributes(),
50
+ instanceId: this.instance(),
51
+ resourceId: this.resource(),
52
+ dependencyId: this.dependency()
53
+ }), ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
54
+ apply(value) {
55
+ const queryParams = {};
56
+ for (const [key, v] of Object.entries(value)) queryParams[key] = v === "" || v === void 0 ? null : v;
57
+ if (typeof value["attr"] === "string") queryParams["attr"] = value["attr"].split(",").map((a) => a.trim()).filter(Boolean);
58
+ this.router.navigate([], {
59
+ queryParams,
60
+ queryParamsHandling: "merge"
61
+ });
62
+ }
63
+ clear() {
64
+ this.router.navigate([], { queryParams: this.ctx.keep() });
65
+ }
66
+ static ɵfac = i0.ɵɵngDeclareFactory({
67
+ minVersion: "12.0.0",
68
+ version: "22.2.4",
69
+ ngImport: i0,
70
+ type: TracesPage,
71
+ deps: [],
72
+ target: i0.ɵɵFactoryTarget.Component
73
+ });
74
+ static ɵcmp = i0.ɵɵngDeclareComponent({
75
+ minVersion: "17.0.0",
76
+ version: "22.2.4",
77
+ type: TracesPage,
78
+ isStandalone: true,
79
+ selector: "ng-component",
80
+ inputs: {
81
+ service: {
82
+ classPropertyName: "service",
83
+ publicName: "service",
84
+ isSignal: true,
85
+ isRequired: false,
86
+ transformFunction: null
87
+ },
88
+ op: {
89
+ classPropertyName: "op",
90
+ publicName: "op",
91
+ isSignal: true,
92
+ isRequired: false,
93
+ transformFunction: null
94
+ },
95
+ status: {
96
+ classPropertyName: "status",
97
+ publicName: "status",
98
+ isSignal: true,
99
+ isRequired: false,
100
+ transformFunction: null
101
+ },
102
+ min: {
103
+ classPropertyName: "min",
104
+ publicName: "min",
105
+ isSignal: true,
106
+ isRequired: false,
107
+ transformFunction: null
108
+ },
109
+ max: {
110
+ classPropertyName: "max",
111
+ publicName: "max",
112
+ isSignal: true,
113
+ isRequired: false,
114
+ transformFunction: null
115
+ },
116
+ trace: {
117
+ classPropertyName: "trace",
118
+ publicName: "trace",
119
+ isSignal: true,
120
+ isRequired: false,
121
+ transformFunction: null
122
+ },
123
+ spanId: {
124
+ classPropertyName: "spanId",
125
+ publicName: "spanId",
126
+ isSignal: true,
127
+ isRequired: false,
128
+ transformFunction: null
129
+ },
130
+ attr: {
131
+ classPropertyName: "attr",
132
+ publicName: "attr",
133
+ isSignal: true,
134
+ isRequired: false,
135
+ transformFunction: null
136
+ },
137
+ instance: {
138
+ classPropertyName: "instance",
139
+ publicName: "instance",
140
+ isSignal: true,
141
+ isRequired: false,
142
+ transformFunction: null
143
+ },
144
+ resource: {
145
+ classPropertyName: "resource",
146
+ publicName: "resource",
147
+ isSignal: true,
148
+ isRequired: false,
149
+ transformFunction: null
150
+ },
151
+ dependency: {
152
+ classPropertyName: "dependency",
153
+ publicName: "dependency",
154
+ isSignal: true,
155
+ isRequired: false,
156
+ transformFunction: null
157
+ }
158
+ },
159
+ ngImport: i0,
160
+ template: `
161
+ <jc-context-bar><h1>Traces</h1></jc-context-bar>
162
+ <form class="jc-filter-form" (ngSubmit)="apply(f.value)" #f="ngForm">
163
+ <mat-form-field subscriptSizing="dynamic">
164
+ <mat-label>Service</mat-label>
165
+ <mat-select name="service" [ngModel]="service() ?? ''">
166
+ <mat-option value="">Any</mat-option>
167
+ @for (s of services.value() ?? []; track s.id) { <mat-option [value]="s.id">{{ s.key }}</mat-option> }
168
+ </mat-select>
169
+ </mat-form-field>
170
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Operation</mat-label><input matInput name="op" [ngModel]="op() ?? ''"></mat-form-field>
171
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-sm">
172
+ <mat-label>Status</mat-label>
173
+ <mat-select name="status" [ngModel]="status() ?? ''">
174
+ <mat-option value="">Any</mat-option><mat-option value="error">Error</mat-option><mat-option value="ok">No error</mat-option>
175
+ </mat-select>
176
+ </mat-form-field>
177
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Min duration (ms)</mat-label><input matInput type="number" min="0" name="min" [ngModel]="min() ?? ''"></mat-form-field>
178
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Max duration (ms)</mat-label><input matInput type="number" min="0" name="max" [ngModel]="max() ?? ''"></mat-form-field>
179
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Trace ID</mat-label><input matInput name="trace" [ngModel]="trace() ?? ''"></mat-form-field>
180
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Span ID</mat-label><input matInput name="spanId" [ngModel]="spanId() ?? ''"></mat-form-field>
181
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-wide">
182
+ <mat-label>Attributes</mat-label>
183
+ <input matInput name="attr" [ngModel]="attributes().join(', ')" placeholder="http.route=/orders, messaging.destination.name=orders">
184
+ </mat-form-field>
185
+ <button mat-flat-button type="submit">Search</button>
186
+ <button mat-button type="button" (click)="clear()">Clear</button>
187
+ </form>
188
+ @if (instance() || resource() || dependency()) {
189
+ <p class="jc-muted">Also filtered by {{ scopeText() }}.
190
+ <a href="" (click)="$event.preventDefault(); apply({ instance: null, resource: null, dependency: null })">Remove</a></p>
191
+ }
192
+ <jc-trace-table [query]="query()" [limit]="100" />`,
193
+ isInline: true,
194
+ dependencies: [
195
+ {
196
+ kind: "ngmodule",
197
+ type: FormsModule
198
+ },
199
+ {
200
+ kind: "directive",
201
+ type: i1.ɵNgNoValidate,
202
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
203
+ },
204
+ {
205
+ kind: "directive",
206
+ type: i1.DefaultValueAccessor,
207
+ 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]"
208
+ },
209
+ {
210
+ kind: "directive",
211
+ type: i1.NumberValueAccessor,
212
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
213
+ },
214
+ {
215
+ kind: "directive",
216
+ type: i1.NgControlStatus,
217
+ selector: "[formControlName],[ngModel],[formControl]"
218
+ },
219
+ {
220
+ kind: "directive",
221
+ type: i1.NgControlStatusGroup,
222
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
223
+ },
224
+ {
225
+ kind: "directive",
226
+ type: i1.MinValidator,
227
+ selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
228
+ inputs: ["min"]
229
+ },
230
+ {
231
+ kind: "directive",
232
+ type: i1.NgModel,
233
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
234
+ inputs: [
235
+ "name",
236
+ "disabled",
237
+ "ngModel",
238
+ "ngModelOptions"
239
+ ],
240
+ outputs: ["ngModelChange"],
241
+ exportAs: ["ngModel"]
242
+ },
243
+ {
244
+ kind: "directive",
245
+ type: i1.NgForm,
246
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
247
+ inputs: ["ngFormOptions"],
248
+ outputs: ["ngSubmit"],
249
+ exportAs: ["ngForm"]
250
+ },
251
+ {
252
+ kind: "ngmodule",
253
+ type: MatButtonModule
254
+ },
255
+ {
256
+ kind: "component",
257
+ type: i2.MatButton,
258
+ 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] ",
259
+ inputs: ["matButton"],
260
+ exportAs: ["matButton", "matAnchor"]
261
+ },
262
+ {
263
+ kind: "ngmodule",
264
+ type: MatFormFieldModule
265
+ },
266
+ {
267
+ kind: "component",
268
+ type: i3.MatFormField,
269
+ selector: "mat-form-field",
270
+ inputs: [
271
+ "hideRequiredMarker",
272
+ "color",
273
+ "floatLabel",
274
+ "appearance",
275
+ "subscriptSizing",
276
+ "hintLabel"
277
+ ],
278
+ exportAs: ["matFormField"]
279
+ },
280
+ {
281
+ kind: "directive",
282
+ type: i3.MatLabel,
283
+ selector: "mat-label"
284
+ },
285
+ {
286
+ kind: "ngmodule",
287
+ type: MatInputModule
288
+ },
289
+ {
290
+ kind: "directive",
291
+ type: i4.MatInput,
292
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
293
+ inputs: [
294
+ "disabled",
295
+ "id",
296
+ "placeholder",
297
+ "name",
298
+ "required",
299
+ "type",
300
+ "errorStateMatcher",
301
+ "aria-describedby",
302
+ "value",
303
+ "readonly",
304
+ "disabledInteractive"
305
+ ],
306
+ exportAs: ["matInput"]
307
+ },
308
+ {
309
+ kind: "ngmodule",
310
+ type: MatSelectModule
311
+ },
312
+ {
313
+ kind: "component",
314
+ type: i3.MatSelect,
315
+ selector: "mat-select",
316
+ inputs: [
317
+ "aria-describedby",
318
+ "panelClass",
319
+ "disabled",
320
+ "disableRipple",
321
+ "tabIndex",
322
+ "hideSingleSelectionIndicator",
323
+ "placeholder",
324
+ "required",
325
+ "multiple",
326
+ "disableOptionCentering",
327
+ "compareWith",
328
+ "value",
329
+ "aria-label",
330
+ "aria-labelledby",
331
+ "errorStateMatcher",
332
+ "typeaheadDebounceInterval",
333
+ "sortComparator",
334
+ "id",
335
+ "panelWidth",
336
+ "canSelectNullableOptions"
337
+ ],
338
+ outputs: [
339
+ "openedChange",
340
+ "opened",
341
+ "closed",
342
+ "selectionChange",
343
+ "valueChange"
344
+ ],
345
+ exportAs: ["matSelect"]
346
+ },
347
+ {
348
+ kind: "component",
349
+ type: i3.MatOption,
350
+ selector: "mat-option",
351
+ inputs: [
352
+ "value",
353
+ "id",
354
+ "disabled"
355
+ ],
356
+ outputs: ["onSelectionChange"],
357
+ exportAs: ["matOption"]
358
+ },
359
+ {
360
+ kind: "component",
361
+ type: ContextBar,
362
+ selector: "jc-context-bar"
363
+ },
364
+ {
365
+ kind: "component",
366
+ type: TraceTable,
367
+ selector: "jc-trace-table",
368
+ inputs: ["query", "limit"]
369
+ }
370
+ ],
371
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
372
+ });
373
+ };
374
+ i0.ɵɵngDeclareClassMetadata({
375
+ minVersion: "12.0.0",
376
+ version: "22.2.4",
377
+ ngImport: i0,
378
+ type: TracesPage,
379
+ decorators: [{
380
+ type: Component,
381
+ args: [{
382
+ changeDetection: ChangeDetectionStrategy.OnPush,
383
+ imports: [
384
+ FormsModule,
385
+ MatButtonModule,
386
+ MatFormFieldModule,
387
+ MatInputModule,
388
+ MatSelectModule,
389
+ ContextBar,
390
+ TraceTable
391
+ ],
392
+ template: `
393
+ <jc-context-bar><h1>Traces</h1></jc-context-bar>
394
+ <form class="jc-filter-form" (ngSubmit)="apply(f.value)" #f="ngForm">
395
+ <mat-form-field subscriptSizing="dynamic">
396
+ <mat-label>Service</mat-label>
397
+ <mat-select name="service" [ngModel]="service() ?? ''">
398
+ <mat-option value="">Any</mat-option>
399
+ @for (s of services.value() ?? []; track s.id) { <mat-option [value]="s.id">{{ s.key }}</mat-option> }
400
+ </mat-select>
401
+ </mat-form-field>
402
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Operation</mat-label><input matInput name="op" [ngModel]="op() ?? ''"></mat-form-field>
403
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-sm">
404
+ <mat-label>Status</mat-label>
405
+ <mat-select name="status" [ngModel]="status() ?? ''">
406
+ <mat-option value="">Any</mat-option><mat-option value="error">Error</mat-option><mat-option value="ok">No error</mat-option>
407
+ </mat-select>
408
+ </mat-form-field>
409
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Min duration (ms)</mat-label><input matInput type="number" min="0" name="min" [ngModel]="min() ?? ''"></mat-form-field>
410
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Max duration (ms)</mat-label><input matInput type="number" min="0" name="max" [ngModel]="max() ?? ''"></mat-form-field>
411
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Trace ID</mat-label><input matInput name="trace" [ngModel]="trace() ?? ''"></mat-form-field>
412
+ <mat-form-field subscriptSizing="dynamic"><mat-label>Span ID</mat-label><input matInput name="spanId" [ngModel]="spanId() ?? ''"></mat-form-field>
413
+ <mat-form-field subscriptSizing="dynamic" class="jc-field-wide">
414
+ <mat-label>Attributes</mat-label>
415
+ <input matInput name="attr" [ngModel]="attributes().join(', ')" placeholder="http.route=/orders, messaging.destination.name=orders">
416
+ </mat-form-field>
417
+ <button mat-flat-button type="submit">Search</button>
418
+ <button mat-button type="button" (click)="clear()">Clear</button>
419
+ </form>
420
+ @if (instance() || resource() || dependency()) {
421
+ <p class="jc-muted">Also filtered by {{ scopeText() }}.
422
+ <a href="" (click)="$event.preventDefault(); apply({ instance: null, resource: null, dependency: null })">Remove</a></p>
423
+ }
424
+ <jc-trace-table [query]="query()" [limit]="100" />`
425
+ }]
426
+ }],
427
+ propDecorators: {
428
+ service: [{
429
+ type: i0.Input,
430
+ args: [{
431
+ isSignal: true,
432
+ alias: "service",
433
+ required: false
434
+ }]
435
+ }],
436
+ op: [{
437
+ type: i0.Input,
438
+ args: [{
439
+ isSignal: true,
440
+ alias: "op",
441
+ required: false
442
+ }]
443
+ }],
444
+ status: [{
445
+ type: i0.Input,
446
+ args: [{
447
+ isSignal: true,
448
+ alias: "status",
449
+ required: false
450
+ }]
451
+ }],
452
+ min: [{
453
+ type: i0.Input,
454
+ args: [{
455
+ isSignal: true,
456
+ alias: "min",
457
+ required: false
458
+ }]
459
+ }],
460
+ max: [{
461
+ type: i0.Input,
462
+ args: [{
463
+ isSignal: true,
464
+ alias: "max",
465
+ required: false
466
+ }]
467
+ }],
468
+ trace: [{
469
+ type: i0.Input,
470
+ args: [{
471
+ isSignal: true,
472
+ alias: "trace",
473
+ required: false
474
+ }]
475
+ }],
476
+ spanId: [{
477
+ type: i0.Input,
478
+ args: [{
479
+ isSignal: true,
480
+ alias: "spanId",
481
+ required: false
482
+ }]
483
+ }],
484
+ attr: [{
485
+ type: i0.Input,
486
+ args: [{
487
+ isSignal: true,
488
+ alias: "attr",
489
+ required: false
490
+ }]
491
+ }],
492
+ instance: [{
493
+ type: i0.Input,
494
+ args: [{
495
+ isSignal: true,
496
+ alias: "instance",
497
+ required: false
498
+ }]
499
+ }],
500
+ resource: [{
501
+ type: i0.Input,
502
+ args: [{
503
+ isSignal: true,
504
+ alias: "resource",
505
+ required: false
506
+ }]
507
+ }],
508
+ dependency: [{
509
+ type: i0.Input,
510
+ args: [{
511
+ isSignal: true,
512
+ alias: "dependency",
513
+ required: false
514
+ }]
515
+ }]
516
+ }
517
+ });
518
+ export { TracesPage };
519
+
520
+ //# sourceMappingURL=juice-js-observability-traces.page-DgvNixIc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juice-js-observability-traces.page-DgvNixIc.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/traces.page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { apiResource } from '../shared/resource';\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 { TraceTable } from '../shared/telemetry';\n\n/**\n * Trace search (Console requirements §5): narrow from a service and time window to one trace by operation, status,\n * duration, instance, resource, dependency, trace or span id, and span attributes such as `http.route=/orders` or\n * `messaging.destination.name=orders`. Every filter is a URL parameter, so a search is a shareable link.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatSelectModule, ContextBar, TraceTable],\n template: `\n <jc-context-bar><h1>Traces</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\"><mat-label>Operation</mat-label><input matInput name=\"op\" [ngModel]=\"op() ?? ''\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\">\n <mat-label>Status</mat-label>\n <mat-select name=\"status\" [ngModel]=\"status() ?? ''\">\n <mat-option value=\"\">Any</mat-option><mat-option value=\"error\">Error</mat-option><mat-option value=\"ok\">No error</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-md\"><mat-label>Min duration (ms)</mat-label><input matInput type=\"number\" min=\"0\" name=\"min\" [ngModel]=\"min() ?? ''\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-md\"><mat-label>Max duration (ms)</mat-label><input matInput type=\"number\" min=\"0\" name=\"max\" [ngModel]=\"max() ?? ''\"></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 <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\">\n <mat-label>Attributes</mat-label>\n <input matInput name=\"attr\" [ngModel]=\"attributes().join(', ')\" placeholder=\"http.route=/orders, messaging.destination.name=orders\">\n </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 @if (instance() || resource() || dependency()) {\n <p class=\"jc-muted\">Also filtered by {{ scopeText() }}.\n <a href=\"\" (click)=\"$event.preventDefault(); apply({ instance: null, resource: null, dependency: null })\">Remove</a></p>\n }\n <jc-trace-table [query]=\"query()\" [limit]=\"100\" />`,\n})\nexport class TracesPage {\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 op = input<string>();\n readonly status = input<string>();\n readonly min = input<string>();\n readonly max = input<string>();\n readonly trace = input<string>();\n readonly spanId = input<string>();\n readonly attr = input<string | string[]>();\n readonly instance = input<string>();\n readonly resource = input<string>();\n readonly dependency = input<string>();\n\n protected readonly services = apiResource({ stream: () => this.api.resources('service').pipe(map(p => p.items)) });\n protected readonly scopeText = computed(() =>\n [this.instance() && 'an instance', this.resource() && 'a resource', this.dependency() && 'a dependency'].filter(x => !!x).join(', '));\n protected readonly attributes = computed(() => {\n const a = this.attr();\n return a === undefined ? [] : Array.isArray(a) ? a : [a];\n });\n protected readonly query = computed(() => ({\n serviceId: this.service(), operation: this.op(), status: this.status(), minDurationMs: this.min(), maxDurationMs: this.max(),\n traceId: this.trace(), spanId: this.spanId(), attribute: this.attributes(), instanceId: this.instance(),\n resourceId: this.resource(), dependencyId: this.dependency(),\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 if (typeof value['attr'] === 'string') {\n queryParams['attr'] = (value['attr'] as string).split(',').map(a => a.trim()).filter(Boolean);\n }\n void this.router.navigate([], { queryParams, queryParamsHandling: 'merge' });\n }\n\n clear() {\n void this.router.navigate([], { queryParams: this.ctx.keep() });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwDA,IAAa,aAAb,MAAa,WAAU;CACF,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACvB,SAAS,OAAO,MAAM;CAE9B,UAAU,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,KAAK,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACpB,SAAS,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACxB,MAAM,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA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