[Synthetics] Detect agent-level issues in monitor integration health#261367
Merged
miguelmartin-elastic merged 116 commits intoelastic:mainfrom Apr 13, 2026
Merged
Conversation
…om/miguelmartin-elastic/kibana into synthetics/missing-integrations-ui
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h statuses Both statuses are removed from the private location health API: - AgentPolicyMismatch: scenario is practically impossible in normal usage; monitors where the package policy exists now report Healthy regardless of which agent policy it is attached to - PackageNotInstalled: if the synthetics package is missing the entire app fails; surfacing it per-monitor adds noise without actionable value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, just as the reset one
…om/miguelmartin-elastic/kibana into synthetics/missing-integrations-ui
…om/miguelmartin-elastic/kibana into synthetics/missing-integrations-ui
…s-agent-health-status-258541
…nthetics-agent-health-status-258541
…nthetics-agent-health-status-258541
…nt-health-status-258541
…ts check Fleet marks deleted/unenrolled agents with status=unenrolled but still counts them in `all`. Using `active` correctly identifies policies with no currently-enrolled agents, triggering missing_agents instead of unhealthy_agent in that case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Would Approve Adds new health detection capability for Fleet agent issues in Synthetics monitoring. While this introduces new runtime behavior (new health statuses and Fleet API calls), all changes are within the author's owned code, are additive/backward-compatible, and include comprehensive tests. The scope is self-contained within the health API. No code changes detected at Macroscope would have approved this PR. A repo admin can enable approvability here. |
Contributor
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
shahzad31
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Blocked by #256738
Summary
Closes #258541. Follow-up to #256738.
Extends the monitor integration health API and UI to detect agent-level issues in private locations — specifically when no agents are enrolled or all agents are offline/unhealthy. These statuses are surfaced alongside the existing integration-level checks.
New health statuses (server):
missing_agents— the agent policy exists but has zero active agents enrolledunhealthy_agent— agents are enrolled but none are onlineAgent status is fetched in batch via Fleet's
getAgentStatusForAgentPolicyfor all relevant agent policies. The check usesstatus.active(notstatus.all) so that unenrolled/deleted agents don't incorrectly count as enrolled.Priority order (most fundamental → least):
missing_location→missing_agent_policy→missing_package_policy→missing_agents→unhealthy_agent→healthyUI changes:
MissingAgentPolicy,MissingAgents, andUnhealthyAgentare classified as non-reset-fixable — the reset button is hidden when all unhealthy locations have agent-level issuesReset API fix:
Before calling
editMonitors, the reset API now pre-filters out locations whose agent policy no longer exists. This preventsAgentPolicyNotFoundErrorfrom bubbling up as a 500 when a monitor has both fixable and non-fixable locations.Test plan
Prerequisites
Setup test monitors
Run
~/elastic/scripts/break_monitors.shagainst your Kibana instance. It creates:missing_package_policy(fixable)missing_package_policy(fixable)missing_package_policyon loc1 +missing_agentson loc2missing_agents(not fixable)missing_agent_policy(not fixable)missing_package_policyon loc1 +missing_agent_policyon loc3What to verify
Monitor list page (
/app/synthetics/monitors):Edit monitor page for Mon C:
missing_agentsPrivate locations settings page (
/app/synthetics/settings/private-locations):New health status messages:
missing_agents: "No Fleet agents are enrolled in the agent policy for this private location. Enroll an agent in Fleet to resolve this."unhealthy_agent: "All Fleet agents for this private location are unhealthy or offline. Check the agent status in Fleet."