Skip to content

fix(helm): use router.fullname for ServiceMonitor metadata.name#8929

Merged
apollo-mateuswgoettems merged 2 commits intodevfrom
TSH-22160/prometheus-service-monitor
Feb 27, 2026
Merged

fix(helm): use router.fullname for ServiceMonitor metadata.name#8929
apollo-mateuswgoettems merged 2 commits intodevfrom
TSH-22160/prometheus-service-monitor

Conversation

@apollo-mateuswgoettems
Copy link
Copy Markdown
Contributor

@apollo-mateuswgoettems apollo-mateuswgoettems commented Feb 27, 2026


fix(helm): use router.fullname for ServiceMonitor metadata.name

Previously, the ServiceMonitor resource was using .Release.Name as its metadata.name, while all other resources in the chart (e.g. Service, Deployment) already used the router.fullname helper. This caused a naming inconsistency: for a release named my-release, the Service would be named my-release-router but the ServiceMonitor would be named my-release.

This fix aligns the ServiceMonitor name with the rest of the chart by using {{ include "router.fullname" . }}, ensuring consistent naming across all resources and proper support for nameOverride and fullnameOverride values.

⚠️ Note: If the chart is already deployed in a cluster, this change will cause Helm to delete the old ServiceMonitor and create a new one with the updated name. This may cause a brief gap in Prometheus metrics scraping.

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

  • No changeset added: this is a Helm chart naming fix with no impact on the router binary or its configuration API.
  • No unit/integration tests added: the change was validated manually using helm template --show-only templates/servicemonitor.yaml across 3 scenarios (plain release name, release name containing "router", and fullnameOverride), confirming the rendered name matches the Service resource in all cases.

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Feb 27, 2026

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 90ed06561517738f99c59951
Build Logs: View logs


✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@github-actions

This comment has been minimized.

@apollo-mateuswgoettems apollo-mateuswgoettems merged commit 0b43f66 into dev Feb 27, 2026
15 checks passed
@apollo-mateuswgoettems apollo-mateuswgoettems deleted the TSH-22160/prometheus-service-monitor branch February 27, 2026 17:37
smyrick pushed a commit that referenced this pull request Mar 2, 2026
Co-authored-by: mateusgoettems <mateusgoettems@mateusgoettemss-MacBook-Pro.local>
smyrick pushed a commit that referenced this pull request Mar 17, 2026
Co-authored-by: mateusgoettems <mateusgoettems@mateusgoettemss-MacBook-Pro.local>
smyrick pushed a commit that referenced this pull request Mar 20, 2026
Co-authored-by: mateusgoettems <mateusgoettems@mateusgoettemss-MacBook-Pro.local>
Made-with: Cursor
@abernix abernix mentioned this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants