@juice-js/observability 1.5.0-alpha.45 → 1.5.0-alpha.62
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/fesm2022/{juice-js-observability-agent.page-DE84_XZr.mjs → juice-js-observability-agent.page-Bwe-EmOJ.mjs} +2 -2
- package/fesm2022/{juice-js-observability-agent.page-DE84_XZr.mjs.map → juice-js-observability-agent.page-Bwe-EmOJ.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-agents.page-C-o-OXai.mjs → juice-js-observability-agents.page-CJYBSJ8O.mjs} +2 -2
- package/fesm2022/{juice-js-observability-agents.page-C-o-OXai.mjs.map → juice-js-observability-agents.page-CJYBSJ8O.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-alert.page-KyakwaUL.mjs → juice-js-observability-alert.page-CEGqjaqf.mjs} +3 -3
- package/fesm2022/{juice-js-observability-alert.page-KyakwaUL.mjs.map → juice-js-observability-alert.page-CEGqjaqf.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-alerts.page-up57Y8fX.mjs → juice-js-observability-alerts.page-C5zfUEHp.mjs} +2 -2
- package/fesm2022/{juice-js-observability-alerts.page-up57Y8fX.mjs.map → juice-js-observability-alerts.page-C5zfUEHp.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-approvals.page-BgHDUGd4.mjs → juice-js-observability-approvals.page-DaVTxyu1.mjs} +2 -2
- package/fesm2022/{juice-js-observability-approvals.page-BgHDUGd4.mjs.map → juice-js-observability-approvals.page-DaVTxyu1.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-incident.page-BryX9L8h.mjs → juice-js-observability-incident.page-g1q8yaVb.mjs} +3 -3
- package/fesm2022/{juice-js-observability-incident.page-BryX9L8h.mjs.map → juice-js-observability-incident.page-g1q8yaVb.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-incidents.page-B4DbQAWr.mjs → juice-js-observability-incidents.page-CObvTD52.mjs} +2 -2
- package/fesm2022/{juice-js-observability-incidents.page-B4DbQAWr.mjs.map → juice-js-observability-incidents.page-CObvTD52.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-load-runs.page-UPQFzG3h.mjs → juice-js-observability-load-runs.page-DSfhobd-.mjs} +2 -2
- package/fesm2022/{juice-js-observability-load-runs.page-UPQFzG3h.mjs.map → juice-js-observability-load-runs.page-DSfhobd-.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-logs.page-DtCoZuZg.mjs → juice-js-observability-logs.page-DC-mUpX6.mjs} +2 -2
- package/fesm2022/{juice-js-observability-logs.page-DtCoZuZg.mjs.map → juice-js-observability-logs.page-DC-mUpX6.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-metrics.page-By3pnaJz.mjs → juice-js-observability-metrics.page-BV9yMbns.mjs} +2 -2
- package/fesm2022/{juice-js-observability-metrics.page-By3pnaJz.mjs.map → juice-js-observability-metrics.page-BV9yMbns.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-notifications.page-DIXE52Rt.mjs → juice-js-observability-notifications.page-BpiDip9e.mjs} +36 -4
- package/fesm2022/juice-js-observability-notifications.page-BpiDip9e.mjs.map +1 -0
- package/fesm2022/{juice-js-observability-overview.page-CdSUNH6a.mjs → juice-js-observability-overview.page-CndYucfJ.mjs} +2 -2
- package/fesm2022/{juice-js-observability-overview.page-CdSUNH6a.mjs.map → juice-js-observability-overview.page-CndYucfJ.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-resource.page-CIY0hWSX.mjs → juice-js-observability-resource.page-Yj_jtwmS.mjs} +2 -2
- package/fesm2022/{juice-js-observability-resource.page-CIY0hWSX.mjs.map → juice-js-observability-resource.page-Yj_jtwmS.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-resources.page-Ch6GVPyx.mjs → juice-js-observability-resources.page-5NFM0Q92.mjs} +2 -2
- package/fesm2022/{juice-js-observability-resources.page-Ch6GVPyx.mjs.map → juice-js-observability-resources.page-5NFM0Q92.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-rules.page-DXORXLHp.mjs → juice-js-observability-rules.page-CXSJCNpv.mjs} +2 -2
- package/fesm2022/{juice-js-observability-rules.page-DXORXLHp.mjs.map → juice-js-observability-rules.page-CXSJCNpv.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-service.page-DeOXv1WO.mjs → juice-js-observability-service.page-CvS4LE89.mjs} +2 -2
- package/fesm2022/{juice-js-observability-service.page-DeOXv1WO.mjs.map → juice-js-observability-service.page-CvS4LE89.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-services.page-BfLmDTLd.mjs → juice-js-observability-services.page-CtiBl1ji.mjs} +2 -2
- package/fesm2022/{juice-js-observability-services.page-BfLmDTLd.mjs.map → juice-js-observability-services.page-CtiBl1ji.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-silences.page-WxGogpDD.mjs → juice-js-observability-silences.page-DMaUp5Ax.mjs} +2 -2
- package/fesm2022/{juice-js-observability-silences.page-WxGogpDD.mjs.map → juice-js-observability-silences.page-DMaUp5Ax.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-slo.page-BRigA4Ss.mjs → juice-js-observability-slo.page-11DGthNO.mjs} +3 -3
- package/fesm2022/{juice-js-observability-slo.page-BRigA4Ss.mjs.map → juice-js-observability-slo.page-11DGthNO.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-slos.page-DVg2gK4Y.mjs → juice-js-observability-slos.page-D1lpgmlH.mjs} +2 -2
- package/fesm2022/{juice-js-observability-slos.page-DVg2gK4Y.mjs.map → juice-js-observability-slos.page-D1lpgmlH.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-suggestions-CBuNlU0Y.mjs → juice-js-observability-suggestions-CgXS6o6u.mjs} +2 -2
- package/fesm2022/{juice-js-observability-suggestions-CBuNlU0Y.mjs.map → juice-js-observability-suggestions-CgXS6o6u.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-telemetry-CaunxC3Y.mjs → juice-js-observability-telemetry-BG91FqGp.mjs} +32 -4
- package/fesm2022/juice-js-observability-telemetry-BG91FqGp.mjs.map +1 -0
- package/fesm2022/{juice-js-observability-timeline.page-ChDtTC3b.mjs → juice-js-observability-timeline.page-CZND4ioM.mjs} +2 -2
- package/fesm2022/{juice-js-observability-timeline.page-ChDtTC3b.mjs.map → juice-js-observability-timeline.page-CZND4ioM.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-topology.page-BN5NL2st.mjs → juice-js-observability-topology.page-CwaImyQT.mjs} +2 -2
- package/fesm2022/{juice-js-observability-topology.page-BN5NL2st.mjs.map → juice-js-observability-topology.page-CwaImyQT.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-trace.page-CtJQZkNW.mjs → juice-js-observability-trace.page-BofeMnqj.mjs} +2 -2
- package/fesm2022/{juice-js-observability-trace.page-CtJQZkNW.mjs.map → juice-js-observability-trace.page-BofeMnqj.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-traces.page-BkGlHFEK.mjs → juice-js-observability-traces.page-CCVWmg44.mjs} +2 -2
- package/fesm2022/{juice-js-observability-traces.page-BkGlHFEK.mjs.map → juice-js-observability-traces.page-CCVWmg44.mjs.map} +1 -1
- package/fesm2022/juice-js-observability.mjs +47 -29
- package/fesm2022/juice-js-observability.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_observability.scss +38 -14
- package/types/juice-js-observability.d.ts +11 -1
- package/fesm2022/juice-js-observability-notifications.page-DIXE52Rt.mjs.map +0 -1
- package/fesm2022/juice-js-observability-telemetry-CaunxC3Y.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-overview.page-CdSUNH6a.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/shared/platform-panel.ts","../../../../projects/juice-js/observability/src/lib/pages/overview.page.ts"],"sourcesContent":["import { DecimalPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { EMPTY, catchError, interval, map, switchMap, takeWhile, tap, timer } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { PlatformLevel } from '../core/models';\nimport { formatAgo, formatBytes, formatDuration, formatPercent } from './format';\nimport { apiResource } from './resource';\nimport { problemText } from './telemetry';\n\n/** How often the panel reads again: the platform samples every 15 s, so faster shows nothing new. */\nconst REFRESH_MS = 15_000;\n\nconst LEVEL_CLASS: Record<PlatformLevel, string> = {\n ok: 'jc-health-healthy', warn: 'jc-health-degraded', bad: 'jc-health-unhealthy', unknown: 'jc-health-unknown',\n};\n\nconst RESOURCE_NAMES: Record<string, string> = {\n 'clickhouse.cpu': 'ClickHouse CPU', 'clickhouse.inserts_in_flight': 'Collector inserts in flight', 'collector.queue': 'Export queue',\n};\n\nexport function formatRate(perSecond: number | null | undefined): string {\n if (perSecond === null || perSecond === undefined) return '—';\n return perSecond >= 1000 ? `${(perSecond / 1000).toFixed(perSecond >= 100_000 ? 0 : 1)}k/s` : `${perSecond.toFixed(perSecond >= 10 ? 0 : 1)}/s`;\n}\n\n/** A resource's figure in its own unit: cores and inserts as numbers, shares as percentages. */\nexport function formatMeasure(value: number | null | undefined, unit: string): string {\n if (value === null || value === undefined) return '—';\n return unit === 'cores' || unit === 'inserts' ? value.toFixed(value >= 10 ? 0 : 1) : formatPercent(value);\n}\n\n/**\n * The Overview's \"Platform\" panel (Phase 11 R8) and the capacity view (R9), for operators: the workers, ingestion, ClickHouse and disk, each\n * green, amber or red against the scale steps' lines, and what the platform held at in the steps it is calibrated on. A viewer doesn't see it.\n */\n@Component({\n selector: 'jc-platform-panel',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DecimalPipe],\n template: `\n @if (!hidden()) {\n <section class=\"jc-card jc-platform\" aria-labelledby=\"jc-platform-title\">\n <div class=\"jc-row\">\n <h2 id=\"jc-platform-title\">Platform</h2>\n @if (o(); as o) {\n <span class=\"jc-badge\" [class]=\"cls(o.status === 'ok' ? 'ok' : 'bad')\">{{ o.status }}</span>\n <span class=\"jc-muted\" title=\"When this replica last sampled the Collector, ClickHouse and PostgreSQL (every 15 s)\">{{ o.sampledAt ? 'sampled ' + ago(o.sampledAt) : 'not sampled yet' }}</span>\n }\n </div>\n @if (error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (o(); as o) {\n <div class=\"jc-grid-2\">\n <div>\n <h3>Workers</h3>\n @for (w of o.workers; track w.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(w.level)\">{{ w.state }}</span>\n <strong>{{ w.name }}</strong>\n @if (w.utilisation !== null) { <span title=\"Its recent passes against its interval\">{{ pct(w.utilisation) }} busy</span> }\n @if (w.lastPassEndedAt) { <span class=\"jc-muted\">last pass {{ ago(w.lastPassEndedAt) }}</span> }\n </div>\n }\n @for (b of o.backlogs; track b.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(b.level)\">{{ b.state }}</span>\n <strong>{{ b.name }} backlog</strong>\n <span class=\"jc-muted\">{{ b.ageSeconds === null ? '—' : seconds(b.ageSeconds) }} of {{ seconds(b.lineSeconds) }}</span>\n </div>\n }\n </div>\n <div>\n <h3>Ingestion</h3>\n @if (o.ingestion; as i) {\n @for (s of i.signals; track s.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(s.level)\">{{ s.name }}</span>\n <span>{{ rate(s.acceptedPerSecond) }} received</span>\n <span [class.jc-muted]=\"!s.refusedPerSecond\">{{ rate(s.refusedPerSecond) }} refused</span>\n <span [class.jc-muted]=\"!s.droppedPerSecond\">{{ rate(s.droppedPerSecond) }} dropped</span>\n </div>\n }\n @for (q of i.queues; track q.exporter) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(q.level)\">{{ pct(q.fill) }}</span>\n <span>{{ q.exporter }} queue</span>\n <span class=\"jc-muted\">{{ q.size | number }} of {{ q.capacity | number }}</span>\n </div>\n }\n } @else { <p class=\"jc-muted\">No figures: the Collector's metrics page isn't read (Telemetry:CollectorMetricsUrl), or the last sample is old.</p> }\n\n <h3>ClickHouse</h3>\n @if (o.clickHouse; as c) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(c.cpuLevel)\">CPU</span>\n <span>{{ c.cores === null ? '—' : c.cores.toFixed(1) }} of {{ c.coresAvailable ?? '—' }} cores</span>\n <span class=\"jc-muted\">{{ c.runningQueries }} queries running</span>\n </div>\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(c.insertLevel)\">inserts</span>\n <span>p95 {{ ms(c.insertP95Seconds) }}</span>\n <span class=\"jc-muted\">{{ c.insertsInFlight === null ? '—' : c.insertsInFlight.toFixed(1) }} in flight</span>\n </div>\n @for (r of c.reads.slice(0, 6); track r.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(r.level)\">p95 {{ ms(r.p95Seconds) }}</span>\n <span>{{ r.name }}</span><span class=\"jc-muted\">{{ r.count }} in the last minute</span>\n </div>\n }\n } @else { <p class=\"jc-muted\">No figures: ClickHouse isn't sampled (ClickHouse:MonitorConnectionString), or didn't answer.</p> }\n\n <h3>Disk</h3>\n @if (o.disk; as d) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(d.level)\">{{ d.daysUntilFull !== null ? days(d.daysUntilFull) + ' until full' : d.bytesPerDay === null ? 'no estimate yet' : d.bytesPerDay > 0 ? 'fits at retention' : 'not growing' }}</span>\n <span>{{ bytes(d.used) }} used, {{ bytes(d.free) }} free</span>\n </div>\n <div class=\"jc-list-row\">\n <span>{{ bytes(d.bytesPerDay) }} a day@if (d.estimated) { <span class=\"jc-muted\"> (estimated from today)</span> }</span>\n <span class=\"jc-muted\">at retention: {{ bytes(d.needAtRetention) }} of {{ bytes(d.total) }}</span>\n </div>\n } @else { <p class=\"jc-muted\">No figures.</p> }\n </div>\n </div>\n\n <h3>Capacity</h3>\n <p class=\"jc-muted\">{{ o.capacity.label }}</p>\n <div class=\"jc-list-row\">\n @for (l of o.capacity.load; track l.signal) {\n <span>{{ l.signal }} <strong>{{ l.multiple === null ? '—' : l.multiple.toFixed(1) + '×' }}</strong>\n <span class=\"jc-muted\">({{ rate(l.perSecond) }} of {{ rate(l.reference) }} at 1×)</span></span>\n }\n </div>\n @if (o.capacity.calibrated) {\n <p>Held every line to <strong>{{ o.capacity.heldTo }}×</strong>; crossed one by {{ o.capacity.crossedAt }}×\n @if (o.capacity.crossed.length) { <span class=\"jc-muted\">({{ o.capacity.crossed.join('; ') }})</span> }.\n @if (o.capacity.headroom !== null) { Today's load is {{ (1 / o.capacity.headroom * 100).toFixed(0) }} % of what held. }\n <span class=\"jc-muted\">What held is a measurement, not a plan: a step meets only a few bursts, so plan a step under it.</span></p>\n }\n <div class=\"jc-list-row jc-muted\">\n Now: {{ o.capacity.mix.rules ?? '—' }} rules, {{ o.capacity.mix.slos ?? '—' }} SLOs, {{ o.capacity.mix.services ?? '—' }} services\n @if (o.capacity.mix.calibratedRules !== null) {\n · calibrated with {{ o.capacity.mix.calibratedRules }} rules, {{ o.capacity.mix.calibratedSlos }} SLOs, {{ o.capacity.mix.calibratedServices }} services\n and {{ o.capacity.mix.calibratedSearchesPerSecond }} searches a second\n }\n </div>\n <table class=\"jc-table\">\n <thead><tr><th>Resource</th><th>Now</th>@if (o.capacity.calibrated) { <th>Where every line held ({{ o.capacity.heldTo }}×)</th><th>Where one crossed ({{ o.capacity.crossedAt }}×)</th> }</tr></thead>\n <tbody>\n @for (r of o.capacity.resources; track r.name) {\n <tr>\n <td>{{ resource(r.name) }}</td>\n <td><span class=\"jc-badge\" [class]=\"cls(r.level)\">{{ measure(r.now, r.unit) }}</span></td>\n @if (o.capacity.calibrated) { <td>{{ measure(r.atHeld, r.unit) }}</td><td>{{ measure(r.atCrossed, r.unit) }}</td> }\n </tr>\n }\n </tbody>\n </table>\n }\n </section>\n }`,\n})\nexport class PlatformPanel {\n private readonly api = inject(ApiService);\n\n /** The last read's failure, cleared by the next that succeeds: a failed read keeps the last figures and the 15 s reads going. */\n private readonly failed = signal<unknown>(undefined);\n protected readonly overview = apiResource({\n // Only for operators and admins (the tenant says so): a viewer never asks, so never gets the 403.\n // A new tenant answer starts afresh: a 403 before it doesn't stop the reads it allows.\n stream: () => this.api.tenant$.pipe(tap(() => this.failed.set(undefined)), switchMap(t => t.canOperate\n ? timer(0, REFRESH_MS).pipe(\n // Refused (a role taken away since sign-in): stop asking, rather than be refused every 15 s.\n takeWhile(() => (this.failed() as { status?: number } | undefined)?.status !== 403),\n switchMap(() => this.api.platformOverview().pipe(\n tap(() => this.failed.set(undefined)),\n catchError(e => { this.failed.set(e); return EMPTY; }))))\n : EMPTY)),\n });\n protected readonly o = computed(() => this.overview.value());\n /** Whether the user is an operator or admin, from the tenant (false until it is known). */\n private readonly canOperate = toSignal(this.api.tenant$.pipe(map(t => !!t.canOperate)), { initialValue: false });\n /** A viewer isn't an operator: no panel (and a 403 from a role changed since sign-in hides it too, without an error). */\n protected readonly hidden = computed(() => !this.canOperate() || (this.failed() as { status?: number } | undefined)?.status === 403);\n protected readonly error = computed(() => this.failed() && !this.hidden() ? problemText(this.failed()) : '');\n\n /** A tick a second, so \"sampled … ago\" counts up between the 15 s reads instead of standing at the read's figure. */\n private readonly tick = toSignal(interval(1000), { initialValue: 0 });\n protected ago(iso: string): string { this.tick(); return formatAgo(iso); }\n\n protected cls(level: PlatformLevel): string { return `jc-badge ${LEVEL_CLASS[level]}`; }\n protected pct(share: number): string { return formatPercent(share); }\n protected rate(perSecond: number | null): string { return formatRate(perSecond); }\n protected bytes(bytes: number | null): string { return formatBytes(bytes); }\n protected measure(value: number | null, unit: string): string { return formatMeasure(value, unit); }\n protected ms(seconds: number | null): string { return formatDuration(seconds === null ? null : seconds * 1000); }\n protected seconds(s: number): string { return s >= 120 ? `${Math.round(s / 60)} min` : `${Math.round(s)} s`; }\n protected days(d: number): string { return d >= 365 ? 'over a year' : `${Math.round(d)} days`; }\n protected resource(name: string): string { return RESOURCE_NAMES[name] ?? (name.startsWith('worker.') ? `Worker ${name.slice(7)}` : name); }\n}\n","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 { map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { HealthState } from '../core/models';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ContextBar, HealthBadge } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\nimport { PlatformPanel } from '../shared/platform-panel';\n\nconst ORDER: HealthState[] = ['Critical', 'Unhealthy', 'Degraded', 'Offline', 'Unknown', 'Healthy'];\n\n/** How many rows each list shows: the overview orients, the alerts and services pages list everything. */\nconst SHOWN = 10;\n\n/**\n * Where an investigation starts (Console requirements §4, §21 step 1): what is firing and which services are not\n * healthy, each one click from its service page. Orientation, not a dashboard.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, AgoPipe, PlatformPanel],\n template: `\n <jc-context-bar><h1>Overview</h1></jc-context-bar>\n @if (health.isLoading() || alerts.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (health.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <div class=\"jc-tiles\">\n @for (s of order; track s) {\n <a class=\"jc-card jc-tile\" [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">\n <jc-health [state]=\"s\" /><strong>{{ counts()[s] ?? 0 }}</strong><span class=\"jc-muted\">services</span>\n </a>\n }\n </div>\n\n <section class=\"jc-card\">\n <div class=\"jc-row\">\n <h2>Firing alerts @if (firing().length) { <span class=\"jc-muted\">({{ firing().length }}@if (criticalCount()) { · {{ criticalCount() }} critical})</span> }</h2>\n @if (firing().length) { <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">All firing alerts</a> }\n </div>\n @for (a of firingShown(); track a.id) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity !== 'Critical'\">{{ a.severity }}</span>\n <a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a>\n <span>{{ a.subjectKey }}</span>\n <span class=\"jc-muted\">fired {{ a.firedAt | ago }}@if (a.acknowledgedBy) { · acknowledged by {{ a.acknowledgedBy }} }</span>\n </div>\n } @empty { <p class=\"jc-muted\">Nothing firing.</p> }\n @if (firing().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">Critical first, then the newest; {{ firing().length - shown }} more.</span>\n <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">See all {{ firing().length }}</a></p>\n }\n </section>\n\n <section class=\"jc-card\">\n <h2>Services needing attention @if (attention().length) { <span class=\"jc-muted\">({{ attention().length }})</span> }</h2>\n @for (h of attention().slice(0, shown); track h.subjectId + h.environment) {\n <div class=\"jc-list-row\">\n <jc-health [state]=\"h.state\" [stale]=\"h.stale\" />\n <a [routerLink]=\"['services', h.subjectId] | jcLink\" [queryParams]=\"ctx.keep({ env: h.environment })\">{{ h.subjectName }}</a>\n <span class=\"jc-muted\">{{ h.environment }}</span>\n <span>{{ h.reasons.slice(0, 3).map(reason).join(' · ') }}</span>\n <span class=\"jc-muted\">since {{ h.since | ago }}</span>\n </div>\n } @empty { <p class=\"jc-muted\">Every evaluated service is healthy.</p> }\n @if (attention().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">The worst first; {{ attention().length - shown }} more. The counts above open each state's list:</span>\n @for (s of order; track s) { @if (s !== 'Healthy' && counts()[s]) {\n <a [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ counts()[s] }} {{ s.toLowerCase() }}</a>\n } }</p>\n }\n </section>\n\n <jc-platform-panel />`,\n})\nexport class OverviewPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly order = ORDER;\n protected readonly shown = SHOWN;\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n protected readonly health = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.health({ subjectType: 'service', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly alerts = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.allAlerts({ state: 'firing', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly error = computed(() => problemText(this.health.error()));\n /** Critical first, then the newest. */\n protected readonly firing = computed(() => [...(this.alerts.value() ?? [])].sort((a, b) =>\n Number(b.severity === 'Critical') - Number(a.severity === 'Critical')\n || (b.firedAt ?? '').localeCompare(a.firedAt ?? '')));\n protected readonly firingShown = computed(() => this.firing().slice(0, SHOWN));\n protected readonly criticalCount = computed(() => this.firing().filter(a => a.severity === 'Critical').length);\n protected readonly counts = computed(() => {\n const counts: Partial<Record<HealthState, number>> = {};\n for (const h of this.health.value() ?? []) counts[h.state] = (counts[h.state] ?? 0) + 1;\n return counts;\n });\n protected readonly attention = computed(() => (this.health.value() ?? [])\n .filter(h => h.state !== 'Healthy')\n .sort((a, b) => ORDER.indexOf(a.state) - ORDER.indexOf(b.state)));\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,aAAa;AAEnB,MAAM,cAA6C;CACjD,IAAI;CAAqB,MAAM;CAAsB,KAAK;CAAuB,SAAS;AAC3F;AAED,MAAM,iBAAyC;CAC7C,kBAAkB;CAAkB,gCAAgC;CAA+B,mBAAmB;AACvH;AAED,SAAgB,WAAW,WAAoC;CAC7D,IAAI,cAAc,QAAQ,cAAc,QAAW,OAAO;CAC1D,OAAO,aAAa,MAAO,IAAI,YAAY,IAAA,CAAM,QAAQ,aAAa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AA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UArDb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDc,UAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MApDJ;IAAU,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;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,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAW;IAAa,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA3F;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA6D;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAsD3E,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAxDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAsB;IAAY;IAAa;IAAS;GAAa;GACrG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDX,CAAA"}
|
|
1
|
+
{"version":3,"file":"juice-js-observability-overview.page-CndYucfJ.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/shared/platform-panel.ts","../../../../projects/juice-js/observability/src/lib/pages/overview.page.ts"],"sourcesContent":["import { DecimalPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { EMPTY, catchError, interval, map, switchMap, takeWhile, tap, timer } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { PlatformLevel } from '../core/models';\nimport { formatAgo, formatBytes, formatDuration, formatPercent } from './format';\nimport { apiResource } from './resource';\nimport { problemText } from './telemetry';\n\n/** How often the panel reads again: the platform samples every 15 s, so faster shows nothing new. */\nconst REFRESH_MS = 15_000;\n\nconst LEVEL_CLASS: Record<PlatformLevel, string> = {\n ok: 'jc-health-healthy', warn: 'jc-health-degraded', bad: 'jc-health-unhealthy', unknown: 'jc-health-unknown',\n};\n\nconst RESOURCE_NAMES: Record<string, string> = {\n 'clickhouse.cpu': 'ClickHouse CPU', 'clickhouse.inserts_in_flight': 'Collector inserts in flight', 'collector.queue': 'Export queue',\n};\n\nexport function formatRate(perSecond: number | null | undefined): string {\n if (perSecond === null || perSecond === undefined) return '—';\n return perSecond >= 1000 ? `${(perSecond / 1000).toFixed(perSecond >= 100_000 ? 0 : 1)}k/s` : `${perSecond.toFixed(perSecond >= 10 ? 0 : 1)}/s`;\n}\n\n/** A resource's figure in its own unit: cores and inserts as numbers, shares as percentages. */\nexport function formatMeasure(value: number | null | undefined, unit: string): string {\n if (value === null || value === undefined) return '—';\n return unit === 'cores' || unit === 'inserts' ? value.toFixed(value >= 10 ? 0 : 1) : formatPercent(value);\n}\n\n/**\n * The Overview's \"Platform\" panel (Phase 11 R8) and the capacity view (R9), for operators: the workers, ingestion, ClickHouse and disk, each\n * green, amber or red against the scale steps' lines, and what the platform held at in the steps it is calibrated on. A viewer doesn't see it.\n */\n@Component({\n selector: 'jc-platform-panel',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DecimalPipe],\n template: `\n @if (!hidden()) {\n <section class=\"jc-card jc-platform\" aria-labelledby=\"jc-platform-title\">\n <div class=\"jc-row\">\n <h2 id=\"jc-platform-title\">Platform</h2>\n @if (o(); as o) {\n <span class=\"jc-badge\" [class]=\"cls(o.status === 'ok' ? 'ok' : 'bad')\">{{ o.status }}</span>\n <span class=\"jc-muted\" title=\"When this replica last sampled the Collector, ClickHouse and PostgreSQL (every 15 s)\">{{ o.sampledAt ? 'sampled ' + ago(o.sampledAt) : 'not sampled yet' }}</span>\n }\n </div>\n @if (error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (o(); as o) {\n <div class=\"jc-grid-2\">\n <div>\n <h3>Workers</h3>\n @for (w of o.workers; track w.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(w.level)\">{{ w.state }}</span>\n <strong>{{ w.name }}</strong>\n @if (w.utilisation !== null) { <span title=\"Its recent passes against its interval\">{{ pct(w.utilisation) }} busy</span> }\n @if (w.lastPassEndedAt) { <span class=\"jc-muted\">last pass {{ ago(w.lastPassEndedAt) }}</span> }\n </div>\n }\n @for (b of o.backlogs; track b.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(b.level)\">{{ b.state }}</span>\n <strong>{{ b.name }} backlog</strong>\n <span class=\"jc-muted\">{{ b.ageSeconds === null ? '—' : seconds(b.ageSeconds) }} of {{ seconds(b.lineSeconds) }}</span>\n </div>\n }\n </div>\n <div>\n <h3>Ingestion</h3>\n @if (o.ingestion; as i) {\n @for (s of i.signals; track s.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(s.level)\">{{ s.name }}</span>\n <span>{{ rate(s.acceptedPerSecond) }} received</span>\n <span [class.jc-muted]=\"!s.refusedPerSecond\">{{ rate(s.refusedPerSecond) }} refused</span>\n <span [class.jc-muted]=\"!s.droppedPerSecond\">{{ rate(s.droppedPerSecond) }} dropped</span>\n </div>\n }\n @for (q of i.queues; track q.exporter) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(q.level)\">{{ pct(q.fill) }}</span>\n <span>{{ q.exporter }} queue</span>\n <span class=\"jc-muted\">{{ q.size | number }} of {{ q.capacity | number }}</span>\n </div>\n }\n } @else { <p class=\"jc-muted\">No figures: the Collector's metrics page isn't read (Telemetry:CollectorMetricsUrl), or the last sample is old.</p> }\n\n <h3>ClickHouse</h3>\n @if (o.clickHouse; as c) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(c.cpuLevel)\">CPU</span>\n <span>{{ c.cores === null ? '—' : c.cores.toFixed(1) }} of {{ c.coresAvailable ?? '—' }} cores</span>\n <span class=\"jc-muted\">{{ c.runningQueries }} queries running</span>\n </div>\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(c.insertLevel)\">inserts</span>\n <span>p95 {{ ms(c.insertP95Seconds) }}</span>\n <span class=\"jc-muted\">{{ c.insertsInFlight === null ? '—' : c.insertsInFlight.toFixed(1) }} in flight</span>\n </div>\n @for (r of c.reads.slice(0, 6); track r.name) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(r.level)\">p95 {{ ms(r.p95Seconds) }}</span>\n <span>{{ r.name }}</span><span class=\"jc-muted\">{{ r.count }} in the last minute</span>\n </div>\n }\n } @else { <p class=\"jc-muted\">No figures: ClickHouse isn't sampled (ClickHouse:MonitorConnectionString), or didn't answer.</p> }\n\n <h3>Disk</h3>\n @if (o.disk; as d) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class]=\"cls(d.level)\">{{ d.daysUntilFull !== null ? days(d.daysUntilFull) + ' until full' : d.bytesPerDay === null ? 'no estimate yet' : d.bytesPerDay > 0 ? 'fits at retention' : 'not growing' }}</span>\n <span>{{ bytes(d.used) }} used, {{ bytes(d.free) }} free</span>\n </div>\n <div class=\"jc-list-row\">\n <span>{{ bytes(d.bytesPerDay) }} a day@if (d.estimated) { <span class=\"jc-muted\"> (estimated from today)</span> }</span>\n <span class=\"jc-muted\">at retention: {{ bytes(d.needAtRetention) }} of {{ bytes(d.total) }}</span>\n </div>\n } @else { <p class=\"jc-muted\">No figures.</p> }\n </div>\n </div>\n\n <h3>Capacity</h3>\n <p class=\"jc-muted\">{{ o.capacity.label }}</p>\n <div class=\"jc-list-row\">\n @for (l of o.capacity.load; track l.signal) {\n <span>{{ l.signal }} <strong>{{ l.multiple === null ? '—' : l.multiple.toFixed(1) + '×' }}</strong>\n <span class=\"jc-muted\">({{ rate(l.perSecond) }} of {{ rate(l.reference) }} at 1×)</span></span>\n }\n </div>\n @if (o.capacity.calibrated) {\n <p>Held every line to <strong>{{ o.capacity.heldTo }}×</strong>; crossed one by {{ o.capacity.crossedAt }}×\n @if (o.capacity.crossed.length) { <span class=\"jc-muted\">({{ o.capacity.crossed.join('; ') }})</span> }.\n @if (o.capacity.headroom !== null) { Today's load is {{ (1 / o.capacity.headroom * 100).toFixed(0) }} % of what held. }\n <span class=\"jc-muted\">What held is a measurement, not a plan: a step meets only a few bursts, so plan a step under it.</span></p>\n }\n <div class=\"jc-list-row jc-muted\">\n Now: {{ o.capacity.mix.rules ?? '—' }} rules, {{ o.capacity.mix.slos ?? '—' }} SLOs, {{ o.capacity.mix.services ?? '—' }} services\n @if (o.capacity.mix.calibratedRules !== null) {\n · calibrated with {{ o.capacity.mix.calibratedRules }} rules, {{ o.capacity.mix.calibratedSlos }} SLOs, {{ o.capacity.mix.calibratedServices }} services\n and {{ o.capacity.mix.calibratedSearchesPerSecond }} searches a second\n }\n </div>\n <table class=\"jc-table\">\n <thead><tr><th>Resource</th><th>Now</th>@if (o.capacity.calibrated) { <th>Where every line held ({{ o.capacity.heldTo }}×)</th><th>Where one crossed ({{ o.capacity.crossedAt }}×)</th> }</tr></thead>\n <tbody>\n @for (r of o.capacity.resources; track r.name) {\n <tr>\n <td>{{ resource(r.name) }}</td>\n <td><span class=\"jc-badge\" [class]=\"cls(r.level)\">{{ measure(r.now, r.unit) }}</span></td>\n @if (o.capacity.calibrated) { <td>{{ measure(r.atHeld, r.unit) }}</td><td>{{ measure(r.atCrossed, r.unit) }}</td> }\n </tr>\n }\n </tbody>\n </table>\n }\n </section>\n }`,\n})\nexport class PlatformPanel {\n private readonly api = inject(ApiService);\n\n /** The last read's failure, cleared by the next that succeeds: a failed read keeps the last figures and the 15 s reads going. */\n private readonly failed = signal<unknown>(undefined);\n protected readonly overview = apiResource({\n // Only for operators and admins (the tenant says so): a viewer never asks, so never gets the 403.\n // A new tenant answer starts afresh: a 403 before it doesn't stop the reads it allows.\n stream: () => this.api.tenant$.pipe(tap(() => this.failed.set(undefined)), switchMap(t => t.canOperate\n ? timer(0, REFRESH_MS).pipe(\n // Refused (a role taken away since sign-in): stop asking, rather than be refused every 15 s.\n takeWhile(() => (this.failed() as { status?: number } | undefined)?.status !== 403),\n switchMap(() => this.api.platformOverview().pipe(\n tap(() => this.failed.set(undefined)),\n catchError(e => { this.failed.set(e); return EMPTY; }))))\n : EMPTY)),\n });\n protected readonly o = computed(() => this.overview.value());\n /** Whether the user is an operator or admin, from the tenant (false until it is known). */\n private readonly canOperate = toSignal(this.api.tenant$.pipe(map(t => !!t.canOperate)), { initialValue: false });\n /** A viewer isn't an operator: no panel (and a 403 from a role changed since sign-in hides it too, without an error). */\n protected readonly hidden = computed(() => !this.canOperate() || (this.failed() as { status?: number } | undefined)?.status === 403);\n protected readonly error = computed(() => this.failed() && !this.hidden() ? problemText(this.failed()) : '');\n\n /** A tick a second, so \"sampled … ago\" counts up between the 15 s reads instead of standing at the read's figure. */\n private readonly tick = toSignal(interval(1000), { initialValue: 0 });\n protected ago(iso: string): string { this.tick(); return formatAgo(iso); }\n\n protected cls(level: PlatformLevel): string { return `jc-badge ${LEVEL_CLASS[level]}`; }\n protected pct(share: number): string { return formatPercent(share); }\n protected rate(perSecond: number | null): string { return formatRate(perSecond); }\n protected bytes(bytes: number | null): string { return formatBytes(bytes); }\n protected measure(value: number | null, unit: string): string { return formatMeasure(value, unit); }\n protected ms(seconds: number | null): string { return formatDuration(seconds === null ? null : seconds * 1000); }\n protected seconds(s: number): string { return s >= 120 ? `${Math.round(s / 60)} min` : `${Math.round(s)} s`; }\n protected days(d: number): string { return d >= 365 ? 'over a year' : `${Math.round(d)} days`; }\n protected resource(name: string): string { return RESOURCE_NAMES[name] ?? (name.startsWith('worker.') ? `Worker ${name.slice(7)}` : name); }\n}\n","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 { map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { HealthState } from '../core/models';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ContextBar, HealthBadge } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\nimport { PlatformPanel } from '../shared/platform-panel';\n\nconst ORDER: HealthState[] = ['Critical', 'Unhealthy', 'Degraded', 'Offline', 'Unknown', 'Healthy'];\n\n/** How many rows each list shows: the overview orients, the alerts and services pages list everything. */\nconst SHOWN = 10;\n\n/**\n * Where an investigation starts (Console requirements §4, §21 step 1): what is firing and which services are not\n * healthy, each one click from its service page. Orientation, not a dashboard.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, AgoPipe, PlatformPanel],\n template: `\n <jc-context-bar><h1>Overview</h1></jc-context-bar>\n @if (health.isLoading() || alerts.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (health.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <div class=\"jc-tiles\">\n @for (s of order; track s) {\n <a class=\"jc-card jc-tile\" [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">\n <jc-health [state]=\"s\" /><strong>{{ counts()[s] ?? 0 }}</strong><span class=\"jc-muted\">services</span>\n </a>\n }\n </div>\n\n <section class=\"jc-card\">\n <div class=\"jc-row\">\n <h2>Firing alerts @if (firing().length) { <span class=\"jc-muted\">({{ firing().length }}@if (criticalCount()) { · {{ criticalCount() }} critical})</span> }</h2>\n @if (firing().length) { <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">All firing alerts</a> }\n </div>\n @for (a of firingShown(); track a.id) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity !== 'Critical'\">{{ a.severity }}</span>\n <a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a>\n <span>{{ a.subjectKey }}</span>\n <span class=\"jc-muted\">fired {{ a.firedAt | ago }}@if (a.acknowledgedBy) { · acknowledged by {{ a.acknowledgedBy }} }</span>\n </div>\n } @empty { <p class=\"jc-muted\">Nothing firing.</p> }\n @if (firing().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">Critical first, then the newest; {{ firing().length - shown }} more.</span>\n <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">See all {{ firing().length }}</a></p>\n }\n </section>\n\n <section class=\"jc-card\">\n <h2>Services needing attention @if (attention().length) { <span class=\"jc-muted\">({{ attention().length }})</span> }</h2>\n @for (h of attention().slice(0, shown); track h.subjectId + h.environment) {\n <div class=\"jc-list-row\">\n <jc-health [state]=\"h.state\" [stale]=\"h.stale\" />\n <a [routerLink]=\"['services', h.subjectId] | jcLink\" [queryParams]=\"ctx.keep({ env: h.environment })\">{{ h.subjectName }}</a>\n <span class=\"jc-muted\">{{ h.environment }}</span>\n <span>{{ h.reasons.slice(0, 3).map(reason).join(' · ') }}</span>\n <span class=\"jc-muted\">since {{ h.since | ago }}</span>\n </div>\n } @empty { <p class=\"jc-muted\">Every evaluated service is healthy.</p> }\n @if (attention().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">The worst first; {{ attention().length - shown }} more. The counts above open each state's list:</span>\n @for (s of order; track s) { @if (s !== 'Healthy' && counts()[s]) {\n <a [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ counts()[s] }} {{ s.toLowerCase() }}</a>\n } }</p>\n }\n </section>\n\n <jc-platform-panel />`,\n})\nexport class OverviewPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly order = ORDER;\n protected readonly shown = SHOWN;\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n protected readonly health = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.health({ subjectType: 'service', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly alerts = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.allAlerts({ state: 'firing', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly error = computed(() => problemText(this.health.error()));\n /** Critical first, then the newest. */\n protected readonly firing = computed(() => [...(this.alerts.value() ?? [])].sort((a, b) =>\n Number(b.severity === 'Critical') - Number(a.severity === 'Critical')\n || (b.firedAt ?? '').localeCompare(a.firedAt ?? '')));\n protected readonly firingShown = computed(() => this.firing().slice(0, SHOWN));\n protected readonly criticalCount = computed(() => this.firing().filter(a => a.severity === 'Critical').length);\n protected readonly counts = computed(() => {\n const counts: Partial<Record<HealthState, number>> = {};\n for (const h of this.health.value() ?? []) counts[h.state] = (counts[h.state] ?? 0) + 1;\n return counts;\n });\n protected readonly attention = computed(() => (this.health.value() ?? [])\n .filter(h => h.state !== 'Healthy')\n .sort((a, b) => ORDER.indexOf(a.state) - ORDER.indexOf(b.state)));\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,aAAa;AAEnB,MAAM,cAA6C;CACjD,IAAI;CAAqB,MAAM;CAAsB,KAAK;CAAuB,SAAS;AAC3F;AAED,MAAM,iBAAyC;CAC7C,kBAAkB;CAAkB,gCAAgC;CAA+B,mB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;;;;;;;;;;;;;;;EAoDX,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
-
import { a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, u as KeyValueTable, y as ReasonPipe } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, u as KeyValueTable, y as ReasonPipe } from "./juice-js-observability-telemetry-BG91FqGp.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, input } from "@angular/core";
|
|
5
5
|
import { RouterLink } from "@angular/router";
|
|
@@ -271,4 +271,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
271
271
|
});
|
|
272
272
|
export { ResourcePage };
|
|
273
273
|
|
|
274
|
-
//# sourceMappingURL=juice-js-observability-resource.page-
|
|
274
|
+
//# sourceMappingURL=juice-js-observability-resource.page-Yj_jtwmS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-resource.page-
|
|
1
|
+
{"version":3,"file":"juice-js-observability-resource.page-Yj_jtwmS.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/resource.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { apiResource } from '../shared/resource';\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, ReasonPipe } from '../shared/format';\nimport { ConfidenceBadge, ContextBar, HealthBadge, KeyValueTable } from '../shared/ui';\nimport { LogTable, MetricExplorer, TraceTable, problemText } from '../shared/telemetry';\n\n/**\n * A host, container, pod, database or destination (Console requirements §11): what runs on it or who uses it, its\n * health, and its telemetry. A database or destination has traces (the calls to it) but no logs or metrics of its own.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, ConfidenceBadge, KeyValueTable, TraceTable, LogTable,\n MetricExplorer, AgoPipe],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: resource.value()?.type })\" class=\"jc-crumb\">Resources</a>\n <span class=\"jc-crumb-sep\">›</span>\n <h1>{{ resource.value()?.displayName ?? '…' }}</h1>\n <span class=\"jc-muted\">{{ resource.value()?.type }}</span>\n </jc-context-bar>\n @if (resource.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resource.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (resource.value(); as r) {\n <div class=\"jc-grid-2\">\n <section class=\"jc-card\">\n <h2>Identity</h2>\n <jc-kv [values]=\"{ key: r.key, 'first seen': r.firstSeen, 'last seen': r.lastSeen }\" />\n <jc-kv [values]=\"r.attributes\" empty=\"\" />\n @for (h of r.health; track h.subjectId) {\n <p><jc-health [state]=\"h.state\" [stale]=\"h.stale\" /> {{ h.reasons.map(reason).join(' · ') }}</p>\n }\n </section>\n <section class=\"jc-card\">\n @if (isInfrastructure()) {\n <h2>Instances running here</h2>\n @for (i of r.instances; track i.id) {\n <div class=\"jc-list-row\"><jc-health [state]=\"i.health\" /><span>{{ i.instanceKey }}</span>\n <span class=\"jc-muted\">{{ i.environment }}</span><span class=\"jc-muted\">{{ i.lastSeen | ago }}</span></div>\n } @empty { <p class=\"jc-muted\">No service instances seen on it.</p> }\n } @else {\n <h2>Used by</h2>\n @for (e of users(); track e.id) {\n <div class=\"jc-list-row\"><a [routerLink]=\"['services', e.source] | jcLink\" [queryParams]=\"ctx.keep()\">{{ name(e.source) }}</a>\n <span>{{ e.relation }}</span><jc-confidence [confidence]=\"e.confidence\" />\n <a [routerLink]=\"['topology'] | jcLink\" [queryParams]=\"ctx.keep({ edge: e.id })\">evidence</a></div>\n } @empty { <p class=\"jc-muted\">No users seen{{ ctx.environment() ? ' in ' + ctx.environment() : '' }}.</p> }\n }\n </section>\n </div>\n @if (isInfrastructure()) {\n <h2>Metrics</h2>\n <jc-metric-explorer [scope]=\"{ resourceId: id() }\" />\n <h2>Logs</h2>\n <jc-log-table [query]=\"{ resourceId: id() }\" />\n } @else {\n <h2>Traces that reach it</h2>\n <jc-trace-table [query]=\"{ resourceId: id() }\" />\n }\n }`,\n})\nexport class ResourcePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n\n protected readonly resource = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.resource(params) });\n protected readonly topology = apiResource({ params: () => this.ctx.environment(), stream: ({ params }) => this.api.topology(params || null) });\n protected readonly error = computed(() => problemText(this.resource.error()));\n protected readonly isInfrastructure = computed(() => ['host', 'container', 'k8s-pod'].includes(this.resource.value()?.type ?? ''));\n protected readonly users = computed(() => (this.topology.value()?.edges ?? []).filter(e => e.target === this.id()));\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n name(id: string) { return this.topology.value()?.nodes.find(n => n.id === id)?.displayName ?? id; }\n}\n"],"mappings":";;;;;;;AAkEA,IAAa,eAAb,MAAa,aAAY;CACJ,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CAC/B,KAAK,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,WAAW,YAAY;EAAE,cAAc,KAAK,GAAE;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,MAAM;CAAC,CAAE;CACrG,WAAW,YAAY;EAAE,cAAc,KAAK,IAAI,YAAW;EAAI,SAAS,EAAE,aAA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
1
1
|
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
-
import { c as ContextBar, g as AgoPipe, h as apiResource, m as screenPages, o as problemText } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { c as ContextBar, g as AgoPipe, h as apiResource, m as screenPages, o as problemText } from "./juice-js-observability-telemetry-BG91FqGp.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from "@angular/core";
|
|
5
5
|
import { RouterLink } from "@angular/router";
|
|
@@ -206,4 +206,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
206
206
|
});
|
|
207
207
|
export { ResourcesPage };
|
|
208
208
|
|
|
209
|
-
//# sourceMappingURL=juice-js-observability-resources.page-
|
|
209
|
+
//# sourceMappingURL=juice-js-observability-resources.page-5NFM0Q92.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-resources.page-
|
|
1
|
+
{"version":3,"file":"juice-js-observability-resources.page-5NFM0Q92.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/resources.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { SearchablePage } from '@juice-js/layout';\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';\nimport { screenPages } from '../shared/paging';\n\nconst TYPES = ['host', 'container', 'k8s-pod', 'database', 'messaging-destination'];\n\n/**\n * Where services run and what they use (Console requirements §11): hosts, containers, pods, databases and\n * destinations, as discovery reconciled them. Never deleted automatically; renames come only from configured aliases.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatPaginatorModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Resources</h1>\n @for (t of types; track t) {\n <a class=\"jc-chip\" [class.jc-selected]=\"t === (type() ?? 'host')\" [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: t })\">{{ t }}</a>\n }\n </jc-context-bar>\n @if (resources.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resources.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (capped()) { <p class=\"jc-notice\">Showing the first 5,000 only. Narrow the list with the search box or a filter.</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Name</th><th>Key</th><th>First seen</th><th>Last seen</th></tr></thead>\n <tbody>\n @for (r of pages.visible(); track r.id) {\n <tr><td><a [routerLink]=\"['resources', r.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ r.displayName }}</a></td>\n <td class=\"jc-mono jc-small\">{{ r.key }}</td><td>{{ r.firstSeen | ago }}</td><td>{{ r.lastSeen | ago }}</td></tr>\n } @empty { <tr><td colspan=\"4\" class=\"jc-muted\">None seen.</td></tr> }\n </tbody>\n </table>\n @if (pages.needed()) {\n <mat-paginator [length]=\"rows().length\" [pageSize]=\"pages.size()\" [pageIndex]=\"pages.index()\" [pageSizeOptions]=\"pages.sizes\"\n (page)=\"pages.change($event)\" aria-label=\"Pages\" />\n }`,\n})\nexport class ResourcesPage implements SearchablePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly types = TYPES;\n readonly type = input<string>();\n private readonly filter = signal('');\n\n protected readonly resources = apiResource({\n params: () => this.type() ?? 'host',\n stream: ({ params }) => this.api.resources(params),\n });\n protected readonly error = computed(() => problemText(this.resources.error()));\n protected readonly capped = computed(() => (this.resources.value()?.nextCursor ?? null) !== null);\n protected readonly rows = computed(() => (this.resources.value()?.items ?? [])\n .filter(r => !this.filter() || `${r.displayName} ${r.key}`.toLowerCase().includes(this.filter().toLowerCase())));\n\n protected readonly pages = screenPages(this.rows);\n\n onSearch(query: string) { this.filter.set(query); }\n}\n"],"mappings":";;;;;;;;;AAcA,MAAM,QAAQ;CAAC;CAAQ;CAAa;CAAW;CAAY;AAAuB;AAgClF,IAAa,gBAAb,MAAa,cAAa;CACL,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,QAAQ;CAClB,OAAO,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACd,SAAS,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEjB,YAAY,YAAY;EACzC,cAAc,KAAK,KAAI,KAAM;EAC7B,SAAS,EAAE,aAAa,KAAK,IAAI,UAAU,MAAM;CAClD,CAAA;CACkB,QAAQ,eAAe,YAAY,KAAK,UAAU,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3D,SAAS,gBAAgB,KAAK,UAAU,MAAK,CAAE,EAAE,cAAc,UAAU,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC9E,OAAO,gBAAgB,KAAK,UAAU,MAAK,CAAE,EAAE,SAAS,CAAA,EAAA,CACxE,QAAO,MAAK,CAAC,KAAK,OAAM,KAAM,GAAG,EAAE,YAAW,GAAI,EAAE,MAAM,YAAW,CAAE,CAAC,SAAS,KAAK,OAAM,CAAE,CAAC,YAAW,CAAE,CAAC,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE/F,QAAQ,YAAY,KAAK,IAAI;CAEhD,SAAS,OAAa;EAAI,KAAK,OAAO,IAAI,KAAK;CAAG;CAlBvC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;E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;IAAU;IAAY;IAAoB;IAAsB;IAAY;GAAO;GAC7F,UAAU;;;;;;;;;;;;;;;;;;;;;;EAsBX,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
-
import { c as ContextBar, g as AgoPipe, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { c as ContextBar, g as AgoPipe, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-BG91FqGp.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, signal } from "@angular/core";
|
|
5
5
|
import { RouterLink } from "@angular/router";
|
|
@@ -590,4 +590,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
590
590
|
});
|
|
591
591
|
export { RulesPage };
|
|
592
592
|
|
|
593
|
-
//# sourceMappingURL=juice-js-observability-rules.page-
|
|
593
|
+
//# sourceMappingURL=juice-js-observability-rules.page-CXSJCNpv.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-rules.page-DXORXLHp.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/rules.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { apiResource } from '../shared/resource';\nimport { RouterLink } from '@angular/router';\nimport { Observable, forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { Rule } from '../core/models';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst TEMPLATES: Record<string, string> = {\n ErrorRate: 'Ratio of failed requests, 0 to 1. Fires above the threshold.',\n LatencyP95: 'Milliseconds at the 95th percentile. Fires above the threshold.',\n ThroughputAbsent: 'Requests in the window, for a service that had traffic. Fires at or below the threshold.',\n DeliveryFailureRate: 'Ratio of failed deliveries, 0 to 1. Fires above the threshold.',\n HostMemory: 'Ratio of host memory used, 0 to 1. Fires above the threshold.',\n MediatorErrors: 'Mediator errors in the window. Fires above the threshold.',\n ConsumerFailures: 'Failed consumer messages in the window. Fires above the threshold.',\n SloBurn: \"An SLO's burn rate over a long and a short window. Fires when both reach the rate; one alert per SLO.\",\n};\n\n/** A TimeSpan as the API writes it (`1.02:03:04`) in seconds. */\nfunction seconds(value: unknown): number {\n const match = /^(?:(\\d+)\\.)?(\\d+):(\\d+):(\\d+)/.exec(String(value ?? ''));\n return match ? (+(match[1] ?? 0)) * 86400 + +match[2] * 3600 + +match[3] * 60 + +match[4] : 0;\n}\n\nfunction span(total: number): string {\n const s = Math.max(0, Math.round(total || 0));\n const pad = (n: number) => String(n).padStart(2, '0');\n const days = Math.floor(s / 86400);\n return `${days ? `${days}.` : ''}${pad(Math.floor(s / 3600) % 24)}:${pad(Math.floor(s / 60) % 60)}:${pad(s % 60)}`;\n}\n\ninterface RuleForm {\n key: string; name: string; template: string; severity: string; service: string; environment: string; host: string; threshold: number | null; recoveryThreshold: number | null;\n minimumSamples: number; scheduleSeconds: number; windowSeconds: number; forSeconds: number; recoverySeconds: number; cooldownSeconds: number; enabled: boolean;\n}\n\nconst NEW_RULE: RuleForm = {\n key: '', name: '', template: 'ErrorRate', severity: 'Warning', service: '', environment: '', host: '', threshold: null, recoveryThreshold: null,\n minimumSamples: 10, scheduleSeconds: 60, windowSeconds: 300, forSeconds: 120, recoverySeconds: 120, cooldownSeconds: 600, enabled: true,\n};\n\n/**\n * Rules and their current state (Console requirements §14), and changing them for admins. They stay typed templates (D5): this page never takes a query.\n * A rule in the deployment's file is shown but changed there. Disabling one, or changing what it watches, closes its open alerts, which the form says first.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, FormsModule, MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar>\n <h1>Rules</h1>\n <span class=\"jc-spacer\"></span>\n <button mat-flat-button type=\"button\" data-testid=\"rule-new\" (click)=\"startNew()\">New rule</button>\n </jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (form(); as f) {\n <section class=\"jc-card\" data-testid=\"rule-form\">\n <h2>{{ editing() ? 'Change ' + editing()!.key : 'New rule' }}</h2>\n <form class=\"jc-form\" (ngSubmit)=\"save(f)\">\n @if (!editing()) { <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Name</mat-label><input matInput name=\"name\" [(ngModel)]=\"f.name\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Template</mat-label>\n <mat-select name=\"template\" [(ngModel)]=\"f.template\">@for (t of templates(); track t) { <mat-option [value]=\"t\">{{ t }}</mat-option> }</mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity</mat-label>\n <mat-select name=\"severity\" [(ngModel)]=\"f.severity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n @if (f.template === 'HostMemory') {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Host (all if empty)</mat-label><input matInput name=\"host\" [(ngModel)]=\"f.host\"></mat-form-field>\n } @else {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Service (all if empty)</mat-label><input matInput name=\"service\" [(ngModel)]=\"f.service\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Environment (all if empty)</mat-label><input matInput name=\"environment\" [(ngModel)]=\"f.environment\"></mat-form-field>\n }\n <p class=\"jc-muted jc-small jc-form-actions\">{{ hint(f.template) }}</p>\n @if (offPack(f.template); as pack) { <p class=\"jc-muted jc-small jc-form-actions\" data-testid=\"rule-pack-off\">{{ f.template }} reads the {{ pack }} signal pack, which this deployment has switched off: the rule can only be saved disabled.</p> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"threshold\" [(ngModel)]=\"f.threshold\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recovery threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"recoveryThreshold\" [(ngModel)]=\"f.recoveryThreshold\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Minimum samples</mat-label><input matInput type=\"number\" name=\"minimumSamples\" [(ngModel)]=\"f.minimumSamples\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Every (s)</mat-label><input matInput type=\"number\" name=\"schedule\" [(ngModel)]=\"f.scheduleSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Window (s)</mat-label><input matInput type=\"number\" name=\"window\" [(ngModel)]=\"f.windowSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Fire after (s)</mat-label><input matInput type=\"number\" name=\"for\" [(ngModel)]=\"f.forSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recover after (s)</mat-label><input matInput type=\"number\" name=\"recovery\" [(ngModel)]=\"f.recoverySeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Cooldown (s)</mat-label><input matInput type=\"number\" name=\"cooldown\" [(ngModel)]=\"f.cooldownSeconds\"></mat-form-field>\n <mat-checkbox name=\"enabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n @if (editing()) { <p class=\"jc-muted jc-small jc-form-actions\">Disabling this rule, or changing its template or scope, resolves its open alerts: nothing would be watching them any more.</p> }\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"rule-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"form.set(null)\">Cancel</button>\n @if (saveError()) { <span class=\"jc-error\" data-testid=\"rule-error\">{{ saveError() }}</span> }\n </div>\n </form>\n </section>\n }\n <table class=\"jc-table\" data-testid=\"rules\">\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><th></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 }@if (r.managedBy === 'config') { · from the rules file }@if (r.managedBy === 'platform') { · the platform's, for SLOs }</div>\n @if (r.quiet) { <div class=\"jc-error jc-small\" [attr.data-testid]=\"'rule-quiet-' + r.key\">Never observes: {{ r.quiet }}.</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 <td class=\"jc-row-actions\">@if (r.managedBy === 'api') { <button mat-button type=\"button\" [attr.data-testid]=\"'rule-edit-' + r.key\" (click)=\"edit(r)\">Change</button> }</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 /**\n * What a rule can be made from: SloBurn is described, but its rules are the platform's own, made for SLOs. A template of a signal pack that is\n * off is left out, except the one the rule being changed has, which it can still be saved with while disabled.\n */\n protected readonly templates = computed(() => {\n const off = new Set((this.data.value()?.packs ?? []).filter(p => !p.enabled).flatMap(p => p.ruleTemplates));\n const current = this.editing()?.template;\n return Object.keys(TEMPLATES).filter(t => t !== 'SloBurn' && (!off.has(t) || t === current));\n });\n protected readonly form = signal<RuleForm | null>(null);\n protected readonly editing = signal<Rule | null>(null);\n protected readonly saving = signal(false);\n protected readonly saveError = signal('');\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 packs: this.api.signalPacks(),\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 protected hint(template: string): string { return TEMPLATES[template] ?? ''; }\n\n /** The name of the switched-off signal pack a template reads, if it does. */\n protected offPack(template: string): string | null {\n return this.data.value()?.packs.find(p => !p.enabled && p.ruleTemplates.includes(template))?.name ?? null;\n }\n\n protected startNew() { this.editing.set(null); this.saveError.set(''); this.form.set({ ...NEW_RULE }); }\n\n protected edit(rule: Rule) {\n const d = rule.definition;\n this.editing.set(rule);\n this.saveError.set('');\n this.form.set({\n key: rule.key, name: rule.name, template: rule.template, severity: rule.severity, service: String(d['service'] ?? ''), environment: String(d['environment'] ?? ''), host: String(d['host'] ?? ''),\n threshold: d['threshold'] as number, recoveryThreshold: (d['recoveryThreshold'] as number | null) ?? null, minimumSamples: d['minimumSamples'] as number, scheduleSeconds: seconds(d['schedule']), windowSeconds: seconds(d['window']),\n forSeconds: seconds(d['forDuration']), recoverySeconds: seconds(d['recoveryDuration']), cooldownSeconds: seconds(d['cooldown']), enabled: rule.enabled,\n });\n }\n\n protected save(f: RuleForm) {\n const host = f.template === 'HostMemory';\n const body = {\n key: f.key, name: f.name, template: f.template, severity: f.severity, service: host ? '' : f.service.trim(), environment: host ? '' : f.environment.trim().toLowerCase(), host: host ? f.host.trim() : '',\n threshold: f.threshold, recoveryThreshold: f.recoveryThreshold, minimumSamples: f.minimumSamples, schedule: span(f.scheduleSeconds), window: span(f.windowSeconds), forDuration: span(f.forSeconds),\n recoveryDuration: span(f.recoverySeconds), cooldown: span(f.cooldownSeconds), enabled: f.enabled,\n };\n const editing = this.editing();\n const request: Observable<Rule> = editing ? this.api.updateRule(editing.key, body, editing.etag) : this.api.createRule(body);\n this.saving.set(true);\n this.saveError.set('');\n request.subscribe({\n next: () => { this.saving.set(false); this.form.set(null); this.data.reload(); },\n error: e => { this.saving.set(false); this.saveError.set(problemText(e)); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,YAAoC;CACxC,WAAW;CACX,YAAY;CACZ,kBAAkB;CAClB,qBAAqB;CACrB,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;CAClB,SAAS;AACV;AAGD,SAAS,QAAQ,OAAc;CAC7B,MAAM,QAAQ,iCAAiC,KAAK,OAAO,SAAS,EAAE,CAAC;CACvE,OAA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IAAa;IAAiB;IAAmB;IAAoB;IAAgB;IAAsB;IAAiB;IAAY;GAAO;GAC/K,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEX,CAAA"}
|
|
1
|
+
{"version":3,"file":"juice-js-observability-rules.page-CXSJCNpv.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/rules.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { apiResource } from '../shared/resource';\nimport { RouterLink } from '@angular/router';\nimport { Observable, forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { Rule } from '../core/models';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst TEMPLATES: Record<string, string> = {\n ErrorRate: 'Ratio of failed requests, 0 to 1. Fires above the threshold.',\n LatencyP95: 'Milliseconds at the 95th percentile. Fires above the threshold.',\n ThroughputAbsent: 'Requests in the window, for a service that had traffic. Fires at or below the threshold.',\n DeliveryFailureRate: 'Ratio of failed deliveries, 0 to 1. Fires above the threshold.',\n HostMemory: 'Ratio of host memory used, 0 to 1. Fires above the threshold.',\n MediatorErrors: 'Mediator errors in the window. Fires above the threshold.',\n ConsumerFailures: 'Failed consumer messages in the window. Fires above the threshold.',\n SloBurn: \"An SLO's burn rate over a long and a short window. Fires when both reach the rate; one alert per SLO.\",\n};\n\n/** A TimeSpan as the API writes it (`1.02:03:04`) in seconds. */\nfunction seconds(value: unknown): number {\n const match = /^(?:(\\d+)\\.)?(\\d+):(\\d+):(\\d+)/.exec(String(value ?? ''));\n return match ? (+(match[1] ?? 0)) * 86400 + +match[2] * 3600 + +match[3] * 60 + +match[4] : 0;\n}\n\nfunction span(total: number): string {\n const s = Math.max(0, Math.round(total || 0));\n const pad = (n: number) => String(n).padStart(2, '0');\n const days = Math.floor(s / 86400);\n return `${days ? `${days}.` : ''}${pad(Math.floor(s / 3600) % 24)}:${pad(Math.floor(s / 60) % 60)}:${pad(s % 60)}`;\n}\n\ninterface RuleForm {\n key: string; name: string; template: string; severity: string; service: string; environment: string; host: string; threshold: number | null; recoveryThreshold: number | null;\n minimumSamples: number; scheduleSeconds: number; windowSeconds: number; forSeconds: number; recoverySeconds: number; cooldownSeconds: number; enabled: boolean;\n}\n\nconst NEW_RULE: RuleForm = {\n key: '', name: '', template: 'ErrorRate', severity: 'Warning', service: '', environment: '', host: '', threshold: null, recoveryThreshold: null,\n minimumSamples: 10, scheduleSeconds: 60, windowSeconds: 300, forSeconds: 120, recoverySeconds: 120, cooldownSeconds: 600, enabled: true,\n};\n\n/**\n * Rules and their current state (Console requirements §14), and changing them for admins. They stay typed templates (D5): this page never takes a query.\n * A rule in the deployment's file is shown but changed there. Disabling one, or changing what it watches, closes its open alerts, which the form says first.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, FormsModule, MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar>\n <h1>Rules</h1>\n <span class=\"jc-spacer\"></span>\n <button mat-flat-button type=\"button\" data-testid=\"rule-new\" (click)=\"startNew()\">New rule</button>\n </jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (form(); as f) {\n <section class=\"jc-card\" data-testid=\"rule-form\">\n <h2>{{ editing() ? 'Change ' + editing()!.key : 'New rule' }}</h2>\n <form class=\"jc-form\" (ngSubmit)=\"save(f)\">\n @if (!editing()) { <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Name</mat-label><input matInput name=\"name\" [(ngModel)]=\"f.name\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Template</mat-label>\n <mat-select name=\"template\" [(ngModel)]=\"f.template\">@for (t of templates(); track t) { <mat-option [value]=\"t\">{{ t }}</mat-option> }</mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity</mat-label>\n <mat-select name=\"severity\" [(ngModel)]=\"f.severity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n @if (f.template === 'HostMemory') {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Host (all if empty)</mat-label><input matInput name=\"host\" [(ngModel)]=\"f.host\"></mat-form-field>\n } @else {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Service (all if empty)</mat-label><input matInput name=\"service\" [(ngModel)]=\"f.service\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Environment (all if empty)</mat-label><input matInput name=\"environment\" [(ngModel)]=\"f.environment\"></mat-form-field>\n }\n <p class=\"jc-muted jc-small jc-form-actions\">{{ hint(f.template) }}</p>\n @if (offPack(f.template); as pack) { <p class=\"jc-muted jc-small jc-form-actions\" data-testid=\"rule-pack-off\">{{ f.template }} reads the {{ pack }} signal pack, which this deployment has switched off: the rule can only be saved disabled.</p> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"threshold\" [(ngModel)]=\"f.threshold\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recovery threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"recoveryThreshold\" [(ngModel)]=\"f.recoveryThreshold\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Minimum samples</mat-label><input matInput type=\"number\" name=\"minimumSamples\" [(ngModel)]=\"f.minimumSamples\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Every (s)</mat-label><input matInput type=\"number\" name=\"schedule\" [(ngModel)]=\"f.scheduleSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Window (s)</mat-label><input matInput type=\"number\" name=\"window\" [(ngModel)]=\"f.windowSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Fire after (s)</mat-label><input matInput type=\"number\" name=\"for\" [(ngModel)]=\"f.forSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recover after (s)</mat-label><input matInput type=\"number\" name=\"recovery\" [(ngModel)]=\"f.recoverySeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Cooldown (s)</mat-label><input matInput type=\"number\" name=\"cooldown\" [(ngModel)]=\"f.cooldownSeconds\"></mat-form-field>\n <mat-checkbox name=\"enabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n @if (editing()) { <p class=\"jc-muted jc-small jc-form-actions\">Disabling this rule, or changing its template or scope, resolves its open alerts: nothing would be watching them any more.</p> }\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"rule-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"form.set(null)\">Cancel</button>\n @if (saveError()) { <span class=\"jc-error\" data-testid=\"rule-error\">{{ saveError() }}</span> }\n </div>\n </form>\n </section>\n }\n <table class=\"jc-table\" data-testid=\"rules\">\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><th></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 }@if (r.managedBy === 'config') { · from the rules file }@if (r.managedBy === 'platform') { · the platform's, for SLOs }</div>\n @if (r.quiet) { <div class=\"jc-error jc-small\" [attr.data-testid]=\"'rule-quiet-' + r.key\">Never observes: {{ r.quiet }}.</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 <td class=\"jc-row-actions\">@if (r.managedBy === 'api') { <button mat-button type=\"button\" [attr.data-testid]=\"'rule-edit-' + r.key\" (click)=\"edit(r)\">Change</button> }</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 /**\n * What a rule can be made from: SloBurn is described, but its rules are the platform's own, made for SLOs. A template of a signal pack that is\n * off is left out, except the one the rule being changed has, which it can still be saved with while disabled.\n */\n protected readonly templates = computed(() => {\n const off = new Set((this.data.value()?.packs ?? []).filter(p => !p.enabled).flatMap(p => p.ruleTemplates));\n const current = this.editing()?.template;\n return Object.keys(TEMPLATES).filter(t => t !== 'SloBurn' && (!off.has(t) || t === current));\n });\n protected readonly form = signal<RuleForm | null>(null);\n protected readonly editing = signal<Rule | null>(null);\n protected readonly saving = signal(false);\n protected readonly saveError = signal('');\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 packs: this.api.signalPacks(),\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 protected hint(template: string): string { return TEMPLATES[template] ?? ''; }\n\n /** The name of the switched-off signal pack a template reads, if it does. */\n protected offPack(template: string): string | null {\n return this.data.value()?.packs.find(p => !p.enabled && p.ruleTemplates.includes(template))?.name ?? null;\n }\n\n protected startNew() { this.editing.set(null); this.saveError.set(''); this.form.set({ ...NEW_RULE }); }\n\n protected edit(rule: Rule) {\n const d = rule.definition;\n this.editing.set(rule);\n this.saveError.set('');\n this.form.set({\n key: rule.key, name: rule.name, template: rule.template, severity: rule.severity, service: String(d['service'] ?? ''), environment: String(d['environment'] ?? ''), host: String(d['host'] ?? ''),\n threshold: d['threshold'] as number, recoveryThreshold: (d['recoveryThreshold'] as number | null) ?? null, minimumSamples: d['minimumSamples'] as number, scheduleSeconds: seconds(d['schedule']), windowSeconds: seconds(d['window']),\n forSeconds: seconds(d['forDuration']), recoverySeconds: seconds(d['recoveryDuration']), cooldownSeconds: seconds(d['cooldown']), enabled: rule.enabled,\n });\n }\n\n protected save(f: RuleForm) {\n const host = f.template === 'HostMemory';\n const body = {\n key: f.key, name: f.name, template: f.template, severity: f.severity, service: host ? '' : f.service.trim(), environment: host ? '' : f.environment.trim().toLowerCase(), host: host ? f.host.trim() : '',\n threshold: f.threshold, recoveryThreshold: f.recoveryThreshold, minimumSamples: f.minimumSamples, schedule: span(f.scheduleSeconds), window: span(f.windowSeconds), forDuration: span(f.forSeconds),\n recoveryDuration: span(f.recoverySeconds), cooldown: span(f.cooldownSeconds), enabled: f.enabled,\n };\n const editing = this.editing();\n const request: Observable<Rule> = editing ? this.api.updateRule(editing.key, body, editing.etag) : this.api.createRule(body);\n this.saving.set(true);\n this.saveError.set('');\n request.subscribe({\n next: () => { this.saving.set(false); this.form.set(null); this.data.reload(); },\n error: e => { this.saving.set(false); this.saveError.set(problemText(e)); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,YAAoC;CACxC,WAAW;CACX,YAAY;CACZ,kBAAkB;CAClB,qBAAqB;CACrB,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;CAClB,SAAS;AACV;AAGD,SAAS,QAAQ,OAAc;CAC7B,MAAM,QAAQ,iCAAiC,KAAK,OAAO,SAAS,EAAE,CAAC;CACvE,OAAO,QAAS,EAAE,MAAM,MAAM,KAAM,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK;AAC9F;AAEA,SAAS,KAAK,OAAa;CACzB,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC,CAAC;CAC5C,MAAM,OAAO,MAAc,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;CACpD,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK;CACjC,OAAO,GAAG,OAAO,GAAG,KAAI,KAAM,KAAK,IAAI,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,EAAC,GAAI,IAAI,KAAK,MAAM,IAAI,EAAE,IAAI,EAAE,EAAC,GAAI,IAAI,IAAI,EAAE;AACjH;AAOA,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AAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,mBAAA;IAAA,UAAA,CAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA5J;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAsJ;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAuEpK,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EAzErB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAa;IAAiB;IAAmB;IAAoB;IAAgB;IAAsB;IAAiB;IAAY;GAAO;GAC/K,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEX,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe, ObservabilityLinks } from "./juice-js-observability.mjs";
|
|
2
|
-
import { _ as DurationPipe, a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, i as ServiceStatsCharts, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, v as PercentPipe, y as ReasonPipe } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { _ as DurationPipe, a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, i as ServiceStatsCharts, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, v as PercentPipe, y as ReasonPipe } from "./juice-js-observability-telemetry-BG91FqGp.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, input, linkedSignal, signal } from "@angular/core";
|
|
5
5
|
import { Router, RouterLink } from "@angular/router";
|
|
@@ -1308,4 +1308,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1308
1308
|
});
|
|
1309
1309
|
export { ServicePage };
|
|
1310
1310
|
|
|
1311
|
-
//# sourceMappingURL=juice-js-observability-service.page-
|
|
1311
|
+
//# sourceMappingURL=juice-js-observability-service.page-CvS4LE89.mjs.map
|