Skip to content

fix: rename Component Latency to Pipeline Latency and improve alert messages#93

Merged
TerrifiedBug merged 1 commit intomainfrom
fix/dashboard-labels-and-alerts
Mar 11, 2026
Merged

fix: rename Component Latency to Pipeline Latency and improve alert messages#93
TerrifiedBug merged 1 commit intomainfrom
fix/dashboard-labels-and-alerts

Conversation

@TerrifiedBug
Copy link
Owner

Summary

  • Renamed "Component Latency" to "Pipeline Latency" across all dashboard views
  • Fixed alert messages for binary metrics (e.g. pipeline_crashed) to show the pipeline name instead of useless numeric details like "is 1.00 (threshold: = 1)"
  • Numeric metric alerts now prefix the pipeline name for context

Test plan

  • Verify dashboard shows "Pipeline Latency" on the main dashboard and pipeline metrics pages
  • Trigger a pipeline crash alert and verify the message reads "Pipeline crashed: "
  • Trigger a numeric alert (e.g. CPU usage) and verify it includes the pipeline name prefix

…essages

Rename "Component Latency" to "Pipeline Latency" across dashboard, pipeline
metrics page, and metrics chart.

Fix alert messages to be human-readable: binary metrics (pipeline_crashed,
node_unreachable) now show just the event and pipeline name instead of
"is 1.00 (threshold: = 1)". Numeric metrics include the pipeline name
as a prefix.
@github-actions github-actions bot added the fix label Mar 11, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR makes two focused improvements: it consistently renames "Component Latency" to "Pipeline Latency" across all three dashboard views, and it overhauls buildMessage in alert-evaluator.ts to produce human-readable alert messages by distinguishing binary metrics (e.g. pipeline_crashed, node_unreachable) from numeric ones and surfacing the pipeline name in both cases.

  • UI renames (page.tsx ×2, metrics-chart.tsx): mechanical find-and-replace of the label, no logic touched.
  • Comment update (metric-store.ts): aligns the latencyMeanMs JSDoc comment with the new terminology.
  • Alert message logic (alert-evaluator.ts): the Prisma query for AlertRule now includes pipeline { name }, a BINARY_METRICS set is introduced, and buildMessage is updated to emit "Pipeline crashed: <name>" for binary metrics and "<name> — CPU usage at 87.50 (threshold: > 80)" for numeric ones. The optional-chaining on rule.pipeline?.name correctly handles rules that are not scoped to a specific pipeline (e.g. node-level node_unreachable rules).

Confidence Score: 5/5

  • This PR is safe to merge — changes are purely cosmetic renames plus a well-scoped alert message improvement with no security or data-integrity impact.
  • All five files contain small, isolated changes. The three UI files and the metric-store comment are trivially correct. The alert-evaluator change is logically sound: the Prisma include is properly optional-chained, the BINARY_METRICS set uses the correct AlertMetric type, and the buildMessage refactor preserves all pre-existing code paths while adding cleaner output for binary and numeric metrics.
  • No files require special attention.

Important Files Changed

Filename Overview
src/app/(dashboard)/page.tsx Single-line title rename from "Component Latency" to "Pipeline Latency". No logic changes.
src/app/(dashboard)/pipelines/[id]/metrics/page.tsx Single-line CardTitle rename from "Component Latency" to "Pipeline Latency". No logic changes.
src/components/pipeline/metrics-chart.tsx Single-line label rename from "Component Latency" to "Pipeline Latency". No logic changes.
src/server/services/metric-store.ts Comment-only update on latencyMeanMs field — "component latency" → "pipeline latency". No functional change.
src/server/services/alert-evaluator.ts Adds pipeline name to AlertRule query via Prisma include, introduces BINARY_METRICS set, and rewrites buildMessage to produce cleaner alert text for binary vs. numeric metrics.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["evaluateAlerts(nodeId, environmentId)"] --> B["Load AlertRules\n(include pipeline.name)"]
    B --> C{rule.condition\nor threshold null?}
    C -- yes --> D["skip (event-based rule)"]
    C -- no --> E["readMetricValue()"]
    E --> F{conditionMet?}
    F -- no --> G["resolve open AlertEvent\nif exists"]
    F -- yes --> H{durationSeconds\nelapsed?}
    H -- no --> I["wait — condition not\nyet sustained"]
    H -- yes --> J{existingEvent\nalready firing?}
    J -- yes --> K["no-op (deduplicated)"]
    J -- no --> L["buildMessage(rule, value, pipeline?.name)"]
    L --> M{rule.condition\nor threshold null?}
    M -- yes --> N["metricLabel: pipelineName\nor metricLabel"]
    M -- no --> O{BINARY_METRICS?}
    O -- yes --> P["e.g. 'Pipeline crashed: my-pipeline'"]
    O -- no --> Q["e.g. 'my-pipeline — CPU usage at 87.50 (threshold: > 80)'"]
    P --> R["prisma.alertEvent.create"]
    Q --> R
    N --> R
    R --> S["results.push(event, rule)"]
Loading

Last reviewed commit: 3a61dbe

@TerrifiedBug TerrifiedBug merged commit de39299 into main Mar 11, 2026
12 checks passed
@TerrifiedBug TerrifiedBug deleted the fix/dashboard-labels-and-alerts branch March 11, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant