Skip to content

Upstream 16120 - Gracefully handle hostname change in metrics code#250

Merged
cigamit merged 2 commits intomainfrom
upstream16120
Feb 28, 2026
Merged

Upstream 16120 - Gracefully handle hostname change in metrics code#250
cigamit merged 2 commits intomainfrom
upstream16120

Conversation

@cigamit
Copy link
Copy Markdown
Contributor

@cigamit cigamit commented Feb 28, 2026

SUMMARY

Upstream Notes:
Previously, we would error out because we assumed that when we got a metrics payload from redis, that there was data in it and it was for the current host.
Now, we do not assume that since we got a metrics payload, that is well formed and for the current hostname because the hostname could have changed and we could have not yet collected metrics for the new host.

@cigamit cigamit requested a review from TheWitness February 28, 2026 05:26
@cigamit cigamit self-assigned this Feb 28, 2026
@cigamit cigamit added bug Something isn't working python Pull requests that update python code labels Feb 28, 2026
Copilot AI review requested due to automatic review settings February 28, 2026 05:26
Copy link
Copy Markdown
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

Adjusts subsystem Prometheus collection to tolerate cases where Valkey/Redis still has metrics keyed by an old hostname, avoiding errors when the current node’s metrics aren’t present yet.

Changes:

  • Add a guard in CustomToPrometheusMetricsCollector.collect() to return early when the current hostname key is missing from the loaded instance payload.
  • Add debug logging for the “current host metrics missing” case.

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

Comment thread awx/main/analytics/subsystem_metrics.py Outdated
Comment thread awx/main/analytics/subsystem_metrics.py Outdated
@cigamit cigamit merged commit 8c7aa0a into main Feb 28, 2026
@cigamit cigamit deleted the upstream16120 branch February 28, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code

Development

Successfully merging this pull request may close these issues.

3 participants