Repository navigation
fix(mcp): drop the health verdict from clickstack_service_health #3634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7862126
1394aec
2a97fde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| '@hyperdx/api': patch | ||
| --- | ||
|
|
||
| fix(mcp): drop the health verdict from clickstack_service_health | ||
|
|
||
| The tool no longer labels services critical, degraded or healthy, and no longer | ||
| tells agents a service needs "no action". Each service keeps its threshold | ||
| flags, score and a factual summary, so agents reason from the numbers instead of | ||
| a verdict that service-wide totals can get wrong. `summary.statusCounts` is | ||
| replaced by `summary.servicesFlagged`, and the span attributes | ||
| `mcp.service_health.critical_count` and `mcp.service_health.degraded_count` are | ||
| replaced by `mcp.service_health.flagged_count`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,9 +37,9 @@ const TIMEOUT_SUFFIX = | |
| const DESCRIPTION = | ||
| 'One-call health report for every service on a trace source: throughput, ' + | ||
| 'error rate, p50/p95/p99 latency and top error groups, compared with the ' + | ||
| 'same window yesterday and ranked worst first. Each service gets a status ' + | ||
| '(critical / degraded / healthy), flags, and a one-line summary of which ' + | ||
| 'changes crossed a threshold. New or growing error groups come first, ' + | ||
| 'same window yesterday and ranked by how far each moved the wrong way. ' + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Tool description says services are 'ranked by how far each moved the wrong way', but the actual order is flagged first, then new_errors, then score A chronic Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| 'Each service gets flags for changes that crossed a fixed threshold and ' + | ||
| 'a one-line factual summary. New or growing error groups come first, ' + | ||
| 'with first/last-seen times; operations with no prior traffic are listed ' + | ||
| 'as likely rollouts.\n\n' + | ||
| 'USE THIS FIRST for status checks, "is X healthy", post-deploy checks, and ' + | ||
|
|
@@ -53,8 +53,10 @@ const DESCRIPTION = | |
| 'use clickstack_event_deltas and ' + | ||
| 'clickstack_trace_top_time_consuming_operations.\n\n' + | ||
| 'CALIBRATION: flags fire only past fixed thresholds (see `usage` in the ' + | ||
| 'response). Small swings on a healthy service are normal variance. An ' + | ||
| 'all-healthy report is a valid answer.\n\n' + | ||
| 'response); smaller swings are usually normal variance, and no flags is ' + | ||
| 'a valid result for a routine check. Thresholds apply to service-wide ' + | ||
| 'totals, so an unflagged service can still hide a regression in one ' + | ||
| 'endpoint, pod or segment. Weigh the numbers against the question.\n\n' + | ||
| PREFER_BUILDER_OVER_SQL_NUDGE; | ||
|
|
||
| export function registerServiceHealth({ | ||
|
|
@@ -172,10 +174,7 @@ export function registerServiceHealth({ | |
| 'mcp.service_health.window_ms': | ||
| current.end.getTime() - current.start.getTime(), | ||
| 'mcp.service_health.services_assessed': ranked.length, | ||
| 'mcp.service_health.critical_count': | ||
| report.summary.statusCounts.critical, | ||
| 'mcp.service_health.degraded_count': | ||
| report.summary.statusCounts.degraded, | ||
| 'mcp.service_health.flagged_count': report.summary.servicesFlagged, | ||
| }); | ||
|
|
||
| const { data, isTrimmed, notes: trimNotes } = trimToolResponse(report); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor — Renamed 'flagged services first' test never exercises the new crossedThreshold key in compareAssessments
Every non-steady service in this fixture is flagged and has a higher score than
steady, so the test still passes if thecrossedThresholdterm is deleted fromcompareAssessments(rank.ts:191). The new buildReport test only covers the re-sort in report.ts. Add a case where an unflagged service outscores a flagged one, for example a high-volume service going from 1.0% to 1.9% errors against a chronichigh_error_rateservice with score 0, and assert that the flagged service ranks first.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond