Skip to content

Conversation

@Rahuldrabit
Copy link

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.

Copilot AI review requested due to automatic review settings January 10, 2026 20:27
Copy link
Contributor

Copilot AI left a comment

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,
Copy link

Copilot AI Jan 10, 2026

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.
status_output = Helm.status(**self.helm_configs)
status_output = Helm.status(
release_name=self.name,
namespace=self.namespace,
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

For consistency with how Helm.install() and Helm.uninstall() are called (using self.helm_configs), the namespace parameter should also use self.helm_configs["namespace"] instead of self.namespace. While both currently have the same value ("observe"), using helm_configs ensures all Helm operations use the same source of configuration and prevents potential inconsistencies if the metadata structure changes.

Suggested change
namespace=self.namespace,
namespace=self.helm_configs["namespace"],

Copilot uses AI. Check for mistakes.
Sign up for free to 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.

1 participant