@juice-js/observability 1.5.0-alpha.46 → 1.5.0-alpha.93
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-alert.page-CEGqjaqf.mjs → juice-js-observability-alert.page-DbO20r7s.mjs} +19 -45
- package/fesm2022/juice-js-observability-alert.page-DbO20r7s.mjs.map +1 -0
- package/fesm2022/juice-js-observability-notifications.page-COE-1zr0.mjs +486 -0
- package/fesm2022/juice-js-observability-notifications.page-COE-1zr0.mjs.map +1 -0
- package/fesm2022/juice-js-observability.mjs +57 -42
- package/fesm2022/juice-js-observability.mjs.map +1 -1
- package/package.json +1 -1
- package/types/juice-js-observability.d.ts +38 -88
- package/fesm2022/juice-js-observability-alert.page-CEGqjaqf.mjs.map +0 -1
- package/fesm2022/juice-js-observability-notifications.page-DVetQmgl.mjs +0 -758
- package/fesm2022/juice-js-observability-notifications.page-DVetQmgl.mjs.map +0 -1
|
@@ -14,6 +14,11 @@ export interface ObservabilityOptions {
|
|
|
14
14
|
* `id => ['/audit/traces', id]`. A string is an external URL. Without it, no link.
|
|
15
15
|
*/
|
|
16
16
|
auditLink?: ((traceId: string) => unknown[] | string | null) | null;
|
|
17
|
+
/**
|
|
18
|
+
* Where the host mounted the notification pages (`@juice-js/notifications-admin`, phase 5 M48), such as `/alerts/notifications`: the
|
|
19
|
+
* escalation page and the alert page link to them (an absolute URL is used as written). Without it, no link.
|
|
20
|
+
*/
|
|
21
|
+
notificationsLink?: string | null;
|
|
17
22
|
/** Show on the Approvals menu entry how many action requests wait for the signed-in user. On unless false. */
|
|
18
23
|
approvalCount?: boolean;
|
|
19
24
|
}
|
|
@@ -31,6 +36,22 @@ export declare class ObservabilityLinks {
|
|
|
31
36
|
readonly base: string;
|
|
32
37
|
/** `to('services', id)` → `['/observability', 'services', id]`. */
|
|
33
38
|
to(...segments: unknown[]): unknown[];
|
|
39
|
+
/**
|
|
40
|
+
* A Notifications admin page (`<notificationsLink>/go/<segments>`; `go` picks the tenant the signed-in user may use). Without
|
|
41
|
+
* `notificationsLink`, no link. A configured absolute URL is used as written, as text with its host case and port kept, never
|
|
42
|
+
* re-serialised; a path becomes a router link.
|
|
43
|
+
*/
|
|
44
|
+
admin(...segments: string[]): {
|
|
45
|
+
route: unknown[];
|
|
46
|
+
} | {
|
|
47
|
+
href: string;
|
|
48
|
+
} | null;
|
|
49
|
+
/** The admin page of a correlation of this platform's alerts (`alert:{id}`). */
|
|
50
|
+
correlation(key: string | null | undefined): {
|
|
51
|
+
route: unknown[];
|
|
52
|
+
} | {
|
|
53
|
+
href: string;
|
|
54
|
+
} | null;
|
|
34
55
|
/** The host's link to the audit records of a trace, if it gave one. */
|
|
35
56
|
audit(traceId: string | null | undefined): {
|
|
36
57
|
route: unknown[];
|
|
@@ -47,6 +68,11 @@ export declare class LinkPipe implements PipeTransform {
|
|
|
47
68
|
static ɵfac: i0.ɵɵFactoryDeclaration<LinkPipe, never>;
|
|
48
69
|
static ɵpipe: i0.ɵɵPipeDeclaration<LinkPipe, "jcLink", true>;
|
|
49
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the signed-in user has the admin role, which the API requires to change an escalation selection. The host answers it from its
|
|
73
|
+
* sign-in (Console: the access token's roles); the default is true, which hides nothing, and the API still refuses a non-admin with 403.
|
|
74
|
+
*/
|
|
75
|
+
export declare const OBSERVABILITY_CAN_ADMIN: InjectionToken<() => boolean>;
|
|
50
76
|
export interface Page<T> {
|
|
51
77
|
items: T[];
|
|
52
78
|
nextCursor: string | null;
|
|
@@ -222,31 +248,6 @@ export interface Rule {
|
|
|
222
248
|
/** Why the rule can never observe the service it names: it reads a signal pack the service has never sent. */
|
|
223
249
|
quiet?: string | null;
|
|
224
250
|
}
|
|
225
|
-
export interface Channel {
|
|
226
|
-
id: string;
|
|
227
|
-
key: string;
|
|
228
|
-
kind: string;
|
|
229
|
-
destination: string;
|
|
230
|
-
events: string[];
|
|
231
|
-
ruleKeys: string[];
|
|
232
|
-
environments: string[];
|
|
233
|
-
recipients: string[] | null;
|
|
234
|
-
secretRef: string | null;
|
|
235
|
-
groupWindowSeconds: number;
|
|
236
|
-
minimumSeverity: string;
|
|
237
|
-
enabled: boolean;
|
|
238
|
-
managedBy: string;
|
|
239
|
-
loadedAt: string;
|
|
240
|
-
recentFailures: number;
|
|
241
|
-
waiting: number;
|
|
242
|
-
}
|
|
243
|
-
export interface DeliveryAttempt {
|
|
244
|
-
number: number;
|
|
245
|
-
at: string;
|
|
246
|
-
statusCode: number | null;
|
|
247
|
-
error: string | null;
|
|
248
|
-
durationMs: number;
|
|
249
|
-
}
|
|
250
251
|
/** A Juice Agent. `online` means it called in within the last 2 minutes; a revoked agent is never online. */
|
|
251
252
|
export interface Agent {
|
|
252
253
|
id: string;
|
|
@@ -376,43 +377,8 @@ export interface AgentCommand {
|
|
|
376
377
|
result: Record<string, unknown> | null;
|
|
377
378
|
durationMs: number | null;
|
|
378
379
|
}
|
|
379
|
-
export interface Delivery {
|
|
380
|
-
id: string;
|
|
381
|
-
alertId: string | null;
|
|
382
|
-
actionRequestId?: string | null;
|
|
383
|
-
event: string;
|
|
384
|
-
status: string;
|
|
385
|
-
attempts: number;
|
|
386
|
-
createdAt: string;
|
|
387
|
-
firstAttemptAt: string | null;
|
|
388
|
-
deliveredAt: string | null;
|
|
389
|
-
nextAttemptAt: string | null;
|
|
390
|
-
lastStatusCode: number | null;
|
|
391
|
-
lastError: string | null;
|
|
392
|
-
history: DeliveryAttempt[];
|
|
393
|
-
suppressedBy: string | null;
|
|
394
|
-
groupedInto: string | null;
|
|
395
|
-
escalationStep: number;
|
|
396
|
-
}
|
|
397
|
-
/** What a test send did; id is the webhook-id it carried. */
|
|
398
|
-
export interface ChannelTestResult {
|
|
399
|
-
id: string;
|
|
400
|
-
delivered: boolean;
|
|
401
|
-
statusCode: number | null;
|
|
402
|
-
error: string | null;
|
|
403
|
-
durationMs: number;
|
|
404
|
-
}
|
|
405
|
-
export interface AllowlistEntry {
|
|
406
|
-
destination: string;
|
|
407
|
-
ports: number[];
|
|
408
|
-
managedBy: string;
|
|
409
|
-
loadedAt: string;
|
|
410
|
-
}
|
|
411
|
-
export interface EscalationStep {
|
|
412
|
-
afterMinutes: number;
|
|
413
|
-
endpointKeys: string[];
|
|
414
|
-
}
|
|
415
380
|
export interface EscalationPolicy {
|
|
381
|
+
/** Which alerts take the policy; its steps live in Notifications, and `pipelinePolicyExists` says whether a policy with this key is there. */
|
|
416
382
|
id: string;
|
|
417
383
|
key: string;
|
|
418
384
|
name: string;
|
|
@@ -420,8 +386,7 @@ export interface EscalationPolicy {
|
|
|
420
386
|
ruleKeys: string[];
|
|
421
387
|
environments: string[];
|
|
422
388
|
minimumSeverity: string;
|
|
423
|
-
|
|
424
|
-
steps: EscalationStep[];
|
|
389
|
+
pipelinePolicyExists: boolean;
|
|
425
390
|
updatedAt: string;
|
|
426
391
|
}
|
|
427
392
|
export interface Silence {
|
|
@@ -470,21 +435,8 @@ export interface IncidentDetail {
|
|
|
470
435
|
openAlerts: number;
|
|
471
436
|
}
|
|
472
437
|
export interface AlertNotifications {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
kind: string;
|
|
476
|
-
delivery: Delivery;
|
|
477
|
-
}[];
|
|
478
|
-
escalations: {
|
|
479
|
-
policy: string;
|
|
480
|
-
name: string;
|
|
481
|
-
state: string;
|
|
482
|
-
stepsSent: number;
|
|
483
|
-
steps: number;
|
|
484
|
-
nextAt: string | null;
|
|
485
|
-
stopReason: string | null;
|
|
486
|
-
endedAt: string | null;
|
|
487
|
-
}[];
|
|
438
|
+
/** `alert:{id}`: deliveries and escalation state are on the Notifications correlation page for it. */
|
|
439
|
+
correlationKey: string;
|
|
488
440
|
silences: Silence[];
|
|
489
441
|
incidents: IncidentSummary[];
|
|
490
442
|
}
|
|
@@ -1008,18 +960,11 @@ export declare class ApiService {
|
|
|
1008
960
|
createRule(definition: unknown): Observable<Rule>;
|
|
1009
961
|
/** With the rule's etag, so a change made since it was read isn't overwritten. */
|
|
1010
962
|
updateRule(key: string, definition: unknown, etag: string): Observable<Rule>;
|
|
1011
|
-
channels(): Observable<Page<Channel>>;
|
|
1012
|
-
createChannel(body: unknown): Observable<Channel>;
|
|
1013
|
-
updateChannel(id: string, body: unknown): Observable<Channel>;
|
|
1014
|
-
deliveries(id: string, query?: Query): Observable<Page<Delivery>>;
|
|
1015
|
-
testChannel(id: string): Observable<ChannelTestResult>;
|
|
1016
|
-
retryDelivery(channelId: string, deliveryId: string): Observable<Delivery>;
|
|
1017
|
-
allowlist(): Observable<Page<AllowlistEntry>>;
|
|
1018
|
-
putAllowlist(destination: string, ports: number[]): Observable<AllowlistEntry>;
|
|
1019
|
-
removeAllowlist(destination: string): Observable<void>;
|
|
1020
963
|
escalationPolicies(): Observable<Page<EscalationPolicy>>;
|
|
1021
964
|
createEscalationPolicy(body: unknown): Observable<EscalationPolicy>;
|
|
1022
965
|
updateEscalationPolicy(key: string, body: unknown): Observable<EscalationPolicy>;
|
|
966
|
+
/** Removes a selection (admin); the pipeline's own policy of that key is not touched. */
|
|
967
|
+
deleteEscalationPolicy(key: string): Observable<void>;
|
|
1023
968
|
silences(query?: Query): Observable<Page<Silence>>;
|
|
1024
969
|
createSilence(body: unknown): Observable<Silence>;
|
|
1025
970
|
cancelSilence(id: string): Observable<void>;
|
|
@@ -1165,5 +1110,10 @@ export declare const OBSERVABILITY_ROUTES: Routes;
|
|
|
1165
1110
|
* A group links to its first page and keeps its pages' own links (`replaceChildRouterLink: false`): juice-layout only
|
|
1166
1111
|
* opens and closes the group on a click (it has no page of its own).
|
|
1167
1112
|
* Group ids carry an `observability-` prefix, as the host's menu sits beside them.
|
|
1113
|
+
*
|
|
1114
|
+
* `alertNotifications` (phase 5, M48): the menu of the notification pages the host mounted, shown as the Alerts › Notifications group after
|
|
1115
|
+
* Alerts; the escalation selection page links to its Escalation Policies page.
|
|
1168
1116
|
*/
|
|
1169
|
-
export declare function observabilityMenus(basePath?: string, order?: number): Menus;
|
|
1117
|
+
export declare function observabilityMenus(basePath?: string, order?: number, alertNotifications?: Menus): Menus;
|
|
1118
|
+
/** The menu id of the Alerts › Notifications group {@link observabilityMenus} adds when the host mounts the notification pages. */
|
|
1119
|
+
export declare const ALERT_NOTIFICATIONS_MENU_ID = "observability-alert-notifications";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-alert.page-CEGqjaqf.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/alert.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { DatePipe, LowerCasePipe } from '@angular/common';\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 { 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 { ContextBar, HealthBadge, KeyValueTable } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\nimport { SuggestionsCard } from '../shared/suggestions';\nimport { CorrelationDecision } from '../core/models';\n\n/**\n * One alert (Console requirements §14): evidence, lifecycle history, the subject's health and reasons, the way into\n * the investigation, and acknowledgement for operators.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, DatePipe, LowerCasePipe, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatProgressBarModule,\n ContextBar, HealthBadge, KeyValueTable, AgoPipe, ReasonPipe, SuggestionsCard],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep()\" class=\"jc-crumb\">Alerts</a><span class=\"jc-crumb-sep\">›</span>\n <h1>{{ detail.value()?.alert?.rule ?? '…' }}</h1>\n </jc-context-bar>\n @if (detail.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (detail.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (detail.value(); as d) {\n <div class=\"jc-summary\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"d.alert.severity === 'Critical'\" [class.jc-health-degraded]=\"d.alert.severity === 'Warning'\">{{ d.alert.severity }}</span>\n <strong>{{ d.alert.state }}</strong>\n <span>{{ d.alert.subjectKey }}</span>\n @if (d.alert.noData) { <span class=\"jc-muted\">no data at the last evaluation: state kept</span> }\n @if (d.alert.subjectType === 'service' && d.alert.subjectId) {\n <a mat-flat-button [routerLink]=\"['services', d.alert.subjectId] | jcLink\" [queryParams]=\"investigate(d.alert.environment)\">Investigate</a>\n <a mat-stroked-button [routerLink]=\"['services', d.alert.subjectId] | jcLink\" [queryParams]=\"investigate(d.alert.environment, { tab: 'traces', status: 'error' })\">Error traces</a>\n }\n @for (l of d.links; track l.url) { <a mat-button [href]=\"l.url\" target=\"_blank\" rel=\"noopener\">{{ l.title }} ↗</a> }\n @if (d.alert.state !== 'Resolved') {\n <a mat-stroked-button data-testid=\"alert-open-incident\" [routerLink]=\"['incidents'] | jcLink\" [queryParams]=\"incidentLink(d.alert.id, d.alert.rule, d.alert.subjectKey)\">Open an incident</a>\n <a mat-stroked-button data-testid=\"alert-silence\" [routerLink]=\"['silences'] | jcLink\" [queryParams]=\"silenceLink(d.alert.subjectKey, d.alert.environment, d.alert.subjectType)\">Silence this</a>\n }\n </div>\n @if (notifications.value(); as n) {\n @for (s of n.silences; track s.id) {\n <p class=\"jc-notice\" data-testid=\"alert-silenced\">Notifications are held until {{ s.endsAt | date: 'MMM d, HH:mm' }}: “{{ s.comment }}” ({{ s.createdBy }}). The alert itself still fires and resolves.</p>\n }\n @for (i of n.incidents; track i.id) {\n <p>In incident <a [routerLink]=\"['incidents', i.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ i.title }}</a> ({{ i.state }})</p>\n }\n }\n <div class=\"jc-grid-2\">\n <section class=\"jc-card\"><h2>Evidence</h2><jc-kv [values]=\"d.evidence\" /></section>\n <section class=\"jc-card\">\n <h2>Subject health</h2>\n @for (h of d.subjectHealth; track h.subjectId + h.environment) {\n <p><jc-health [state]=\"h.state\" [stale]=\"h.stale\" /> {{ h.environment }}</p>\n <ul class=\"jc-reasons\">@for (r of h.reasons; track r) { <li>{{ r | reason }}</li> }</ul>\n } @empty { <p class=\"jc-muted\">No health for this subject.</p> }\n </section>\n </div>\n <section class=\"jc-card\" data-testid=\"alert-related\">\n <h2>Around this alert</h2>\n @if (related.value(); as r) {\n <p class=\"jc-notice\" data-testid=\"alert-related-note\">{{ r.note }}</p>\n <table class=\"jc-table\"><tbody>\n @for (i of r.items; track i.type + i.id) {\n <tr>\n <td class=\"jc-nowrap\">{{ i.at | date: 'MMM d, HH:mm:ss' }}</td>\n <td><strong>{{ i.title }}</strong>@if (i.detail) { <div class=\"jc-muted jc-small\">{{ i.detail }}</div> }</td>\n <td class=\"jc-small\"><ul class=\"jc-reasons\">@for (x of i.reasons; track x.code) { <li>{{ x.text }} <span class=\"jc-muted\">(+{{ x.points }})</span></li> }</ul></td>\n </tr>\n } @empty { <tr><td class=\"jc-muted\">No changes or dependency health changes in the 2 hours before this alert.</td></tr> }\n </tbody></table>\n @if (d.alert.subjectId && d.alert.subjectType === 'service') {\n <a mat-stroked-button [routerLink]=\"['timeline'] | jcLink\" [queryParams]=\"timelineLink(d.alert.subjectId, d.alert.environment, r.breachStartedAt)\">Open the timeline</a>\n }\n }\n @if (related.error()) { <p class=\"jc-error\">{{ relatedError() }}</p> }\n </section>\n @if (d.alert.state === 'Firing' || merged()) {\n <section class=\"jc-card\" data-testid=\"alert-suggestions\">\n <h2>Suggested with this alert</h2>\n @if (merged(); as m) { <p data-testid=\"alert-suggestion-merged\">Merged into <a [routerLink]=\"['incidents', m] | jcLink\" [queryParams]=\"ctx.keep()\">the incident</a>.</p> }\n <jc-suggestions [suggestions]=\"suggestions.value()\" (decided)=\"decided($event)\" />\n @if (suggestions.error()) { <p class=\"jc-error\">{{ suggestionsError() }}</p> }\n </section>\n }\n <section class=\"jc-card\" data-testid=\"alert-notifications\">\n <h2>Notifications</h2>\n @if (notifications.value(); as n) {\n @for (e of n.escalations; track e.policy) {\n <p>Escalation <strong>{{ e.name }}</strong>: {{ e.stepsSent }} of {{ e.steps }} steps sent, {{ e.state | lowercase }}@if (e.stopReason) { ({{ e.stopReason | reason }}) }@if (e.nextAt) {, next at {{ e.nextAt | date: 'HH:mm:ss' }} }</p>\n }\n <table class=\"jc-table\">\n <thead><tr><th>To</th><th>Event</th><th>Status</th><th>Attempts</th><th>Detail</th><th>When</th></tr></thead>\n <tbody>\n @for (x of n.deliveries; track x.delivery.id) {\n <tr>\n <td>{{ x.endpointKey }} <span class=\"jc-muted jc-small\">{{ x.kind }}</span></td>\n <td>{{ x.delivery.event }}@if (x.delivery.escalationStep) { step {{ x.delivery.escalationStep }} }</td>\n <td [class.jc-bad]=\"x.delivery.status === 'Failed'\">{{ x.delivery.status }}</td>\n <td>{{ x.delivery.attempts }}</td>\n <td class=\"jc-small\">{{ x.delivery.lastError }}@if (x.delivery.nextAttemptAt && x.delivery.status === 'Retrying') { · next {{ x.delivery.nextAttemptAt | date: 'HH:mm:ss' }} }</td>\n <td class=\"jc-nowrap\">{{ x.delivery.createdAt | date: 'MMM d, HH:mm:ss' }}</td>\n </tr>\n } @empty { <tr><td colspan=\"6\" class=\"jc-muted\">Nothing sent about this alert: no channel takes it.</td></tr> }\n </tbody>\n </table>\n }\n @if (notifications.error()) { <p class=\"jc-error\">{{ notificationsError() }}</p> }\n </section>\n <section class=\"jc-card\">\n <h2>History</h2>\n <table class=\"jc-table\"><tbody>\n @for (t of d.history; track t.at + t.to) {\n <tr><td>{{ t.at | date: 'MMM d, HH:mm:ss' }}</td><td>{{ t.from ?? '—' }} → <strong>{{ t.to }}</strong></td><td>{{ t.reason | reason }}</td><td>{{ t.value ?? '—' }}</td></tr>\n }\n </tbody></table>\n </section>\n <section class=\"jc-card\">\n <h2>Acknowledgement</h2>\n @if (d.alert.acknowledgedAt) {\n <p>By <strong>{{ d.alert.acknowledgedBy }}</strong> {{ d.alert.acknowledgedAt | ago }}@if (d.acknowledgeComment) {: “{{ d.acknowledgeComment }}”}</p>\n } @else if (d.alert.state !== 'Resolved') {\n <form (ngSubmit)=\"acknowledge()\" class=\"jc-filter-form\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Comment</mat-label><input matInput name=\"comment\" [(ngModel)]=\"comment\" maxlength=\"1000\"></mat-form-field>\n <button mat-flat-button type=\"submit\" [disabled]=\"sending()\">Acknowledge</button>\n </form>\n @if (ackError()) { <p class=\"jc-error\">{{ ackError() }}</p> }\n } @else { <p class=\"jc-muted\">Resolved without acknowledgement.</p> }\n </section>\n }`,\n})\nexport class AlertPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n protected comment = '';\n protected readonly sending = signal(false);\n protected readonly ackError = signal('');\n\n protected readonly detail = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.alert(params) });\n protected readonly error = computed(() => problemText(this.detail.error()));\n protected readonly related = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.relatedToAlert(params) });\n protected readonly relatedError = computed(() => problemText(this.related.error()));\n protected readonly notifications = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.alertNotifications(params) });\n protected readonly notificationsError = computed(() => problemText(this.notifications.error()));\n /** Only a firing alert is suggested with others, so only its page asks. */\n protected readonly suggestions = apiResource({\n params: () => (this.detail.value()?.alert.state === 'Firing' ? this.id() : undefined),\n stream: ({ params }) => this.api.alertSuggestions(params),\n });\n protected readonly suggestionsError = computed(() => problemText(this.suggestions.error()));\n /** The incident a suggestion on this page was merged into. Keyed by alert: the page is reused when a suggestion's link opens another alert. */\n private readonly mergedInto = signal<{ alert: string; incident: string } | null>(null);\n protected readonly merged = computed(() => (this.mergedInto()?.alert === this.id() ? this.mergedInto()!.incident : null));\n\n /** A decision, or null when one was refused because the list was stale: either way, read it again. */\n protected decided(d: CorrelationDecision | null) {\n if (d?.incidentId) this.mergedInto.set({ alert: this.id(), incident: d.incidentId });\n this.suggestions.reload();\n this.notifications.reload();\n }\n\n incidentLink(alert: string, rule: string, subject: string) { return this.ctx.keep({ alert, title: `${rule} on ${subject}` }); }\n\n /** The new-silence form, filled in for this alert's subject. */\n silenceLink(subject: string, environment: string | null, type: string) {\n const name = type === 'service' ? subject.replace(/^service:/, '').replace(/@[^@]*$/, '') : null;\n const host = type === 'host' ? subject.replace(/^host:/, '') : null;\n return this.ctx.keep({ service: name, environment, host });\n }\n\n /** The service page over the alert's environment, from shortly before the breach. */\n /** The service's timeline from 2 hours before the breach to 1 hour after. */\n timelineLink(service: string, environment: string | null, breach: string) {\n const at = new Date(breach).getTime();\n return this.ctx.keep({ service, env: environment, range: null, from: new Date(at - 2 * 3_600_000).toISOString(), to: new Date(at + 3_600_000).toISOString() });\n }\n\n investigate(environment: string | null, extra: Record<string, string> = {}) {\n const alert = this.detail.value()?.alert;\n const start = alert?.breachStartedAt ? new Date(alert.breachStartedAt).getTime() - 15 * 60_000 : null;\n const end = alert?.resolvedAt ? new Date(alert.resolvedAt).getTime() + 5 * 60_000 : Date.now();\n const window = start && end - start <= 24 * 3_600_000\n ? { from: new Date(start).toISOString(), to: new Date(end).toISOString(), range: null } : {};\n return this.ctx.keep({ env: environment, ...window, ...extra });\n }\n\n acknowledge() {\n this.sending.set(true);\n this.ackError.set('');\n this.api.acknowledge(this.id(), this.comment).subscribe({\n next: () => { this.sending.set(false); this.detail.reload(); this.notifications.reload(); },\n error: e => {\n this.sending.set(false);\n this.ackError.set((e as { status?: number }).status === 403 ? 'Acknowledging needs the operator or admin role.' : problemText(e));\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4IA,IAAa,YAAb,MAAa,UA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