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