Skip to content

Fix Prometheus Helm.status crash due to invalid chart_path argument - #126

Merged
Jackson Clark (HacksonClark) merged 3 commits into
microsoft:mainfrom
Rahuldrabit:fix/prometheus-helm-status
Feb 4, 2026
Merged

Fix Prometheus Helm.status crash due to invalid chart_path argument#126
Jackson Clark (HacksonClark) merged 3 commits into
microsoft:mainfrom
Rahuldrabit:fix/prometheus-helm-status

Conversation

@Rahuldrabit

Copy link
Copy Markdown
Contributor

This PR fixes a runtime crash in Prometheus telemetry initialization.

Prometheus._is_prometheus_running() was passing the full Helm install config
(including chart_path, values, timeout) into Helm.status(), which only accepts
release_name and namespace. This caused a TypeError and prevented Prometheus
from starting.

The fix calls Helm.status() with only the required parameters, restoring
correct Helm API usage and allowing AIOpsLab and Stratus evaluations to run
end-to-end.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix a runtime crash in Prometheus telemetry initialization where Helm.status() was being called with incorrect parameters. The original code incorrectly passed the entire helm_configs dictionary (containing release_name, chart_path, and namespace) to Helm.status(), which only accepts release_name and namespace as positional parameters.

Changes:

  • Modified _is_prometheus_running() to call Helm.status() with explicit named parameters instead of unpacking the full helm_configs dictionary
  • Added a trailing newline at end of file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

try:
status_output = Helm.status(**self.helm_configs)
status_output = Helm.status(
release_name=self.name,

CopilotAIJan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release_name parameter should use self.helm_configs["release_name"] instead of self.name. The self.name attribute is set to metadata["Name"] which is "Prometheus" (capitalized), while the actual Helm release name in helm_configs is "prometheus" (lowercase). Using self.name will cause Helm.status() to query for the wrong release name and fail to detect when Prometheus is running. This inconsistency with how Helm.install() and Helm.uninstall() use the release_name will lead to incorrect behavior.

Suggested change
release_name=self.name,
release_name=self.helm_configs["release_name"],

Copilot uses AI. Check for mistakes.
Comment threadaiopslab/service/telemetry/prometheus.py
@Rahuldrabit

Copy link
Copy Markdown
ContributorAuthor

before fixed , the error
TypeError: Helm.status() got an unexpected keyword argument 'chart_path'

after fixed , the error
RuntimeError: Failed to get status for release prometheus: Error: release: not found

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@HacksonClark
Jackson Clark (HacksonClark) merged commit 706cd38 into microsoft:mainFeb 4, 2026
1 check passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Rahuldrabit@HacksonClark@vitrixLab