Skip to content

Stubs for two prometheus endpoints#2936

Merged
h2zh merged 4 commits into
PelicanPlatform:mainfrom
h2zh:prometheus-stubs
Jan 15, 2026
Merged

Stubs for two prometheus endpoints#2936
h2zh merged 4 commits into
PelicanPlatform:mainfrom
h2zh:prometheus-stubs

Conversation

@h2zh

@h2zh h2zh commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

The quick fix of the linked issue is removing Grafana's access to Prometheus' /rules and /alerts endpoints, which is already done. This PR is a permanent fix:

Return empty results instead of nil to prevent nil pointer panics when external tools (like Grafana) query Prometheus' /rules or /alerts endpoints

- Return empty results instead of nil to prevent nil pointer panics
when external tools (like Grafana) query the /rules or /alerts endpoints
@h2zh h2zh linked an issue Jan 2, 2026 that may be closed by this pull request
7 tasks
@h2zh h2zh requested a review from patrickbrophy January 2, 2026 21:17

@patrickbrophy patrickbrophy 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.

@h2zh Could you write a small test to ensure that hitting these endpoints doesn't cause any undesirable behavior? Otherwise the stub implementation looks good.

h2zh added 3 commits January 12, 2026 22:51
- stubs for /rules and /alerts endpoints
- Removed the simple unit tests earlier because they are covered by the new comprehensive tests
@h2zh h2zh requested a review from patrickbrophy January 13, 2026 19:16

@patrickbrophy patrickbrophy 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.

Thanks for the tests. LGTM

@h2zh h2zh merged commit 42af28b into PelicanPlatform:main Jan 15, 2026
27 of 29 checks passed
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.

Director's frequent panics

2 participants