Support guest health reporting#73
Open
aditigaur4 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for Azure Guest Health Reporting (GHR) by introducing a GHR category taxonomy and plumbing it through health reports so Jetpack can publish the appropriate action/category metadata when reporting unhealthy states.
Changes:
- Introduces
GHRCategoryenum and adds aghr_categoryfield toHealthReport. - Updates
Reporterto gate GHR support by Jetpack version and to include--action-type GHR/--ghr-categorywhen publishing non-OK conditions. - Adds initial GHR category resolution for network (InfiniBand port down) and GPU (missing GPU count, DCGM incidents/XIDs/diag errors), including DCGM error→GHR mappings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| healthagent/reporter.py | Adds ghr_category to reports and publishes GHR metadata via Jetpack when enabled/version-supported. |
| healthagent/network.py | Sets ghr_category for InfiniBand port-down scenarios. |
| healthagent/gpu.py | Sets ghr_category for missing GPU and for incident/XID/diag-derived GPU failures. |
| healthagent/ghr.py | Adds the GHRCategory enum defining supported guest health categories. |
| healthagent/bindings.py | Adds DCGM error/XID → GHRCategory mapping helpers and constants used by GPU reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+290
to
+292
| if self.enable_ghr: | ||
| if report.ghr_category is not None: | ||
| args.extend(['--action-type', 'GHR', '--ghr-category', report.ghr_category.value]) |
Comment on lines
+220
to
+228
| # Resolve GHR for IB port down | ||
| for ni in interfaces: | ||
| if ni.type == NetDevType.INFINIBAND and ni.ib_device: | ||
| for port in ni.ib_device.ports.values(): | ||
| if port.state and not port.state.startswith("4:"): | ||
| report.ghr_category = GHRCategory.IB_PORT_DOWN | ||
| break | ||
| if report.ghr_category: | ||
| break |
aditigaur4
force-pushed
the
ghr
branch
2 times, most recently
from
July 21, 2026 20:00
bef6dd0 to
ad8dd21
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
healthagent/network.py:137
- In the permanent-degraded path (max strikes exceeded), the report is escalated to ERROR but no GHR category is selected. Because ghr_error/ghr_any are reset on every run, subsequent runs after the strike limit will publish an ERROR without the GHR action metadata, even though the condition is still degraded. Set ghr_error here as well (when a mapping exists) before returning.
def check_field(iface_name, field, check: 'ThresholdCheck', value, port_num=None, config_key=None):
key = (iface_name, field, port_num)
max_strikes = check.strikes
# Permanently degraded — re-report error without re-evaluating
Comment on lines
+1
to
+4
| from enum import Enum | ||
|
|
||
| class GHRCategory(Enum): | ||
| # Operational |
Comment on lines
+237
to
+238
| report.ghr_category = ghr_error or ghr_any | ||
|
|
Comment on lines
+165
to
+169
| version = self._get_jetpack_version() | ||
| if version is None or version < self._parse_version(self.JETPACK_VERSION_MINIMUM): | ||
| self.publish_cc = False | ||
| self.enable_ghr = False | ||
| log.warning(f"Jetpack version too old or unknown, disabling CC publishing and GHR") |
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.
Add support for guest health reporting via Jetpack.