Skip to content

fix(monitoring): address Copilot review nits on #41/#42 - #43

Merged
hakan-persson merged 1 commit into
mainfrom
fix/monitoring-copilot-nits
Jul 4, 2026
Merged

fix(monitoring): address Copilot review nits on #41/#42#43
hakan-persson merged 1 commit into
mainfrom
fix/monitoring-copilot-nits

Conversation

@hakan-persson

Copy link
Copy Markdown
Member

Follow-up to #41 and #42 (both merged), addressing the Copilot review comments.

Changes

  • feat(monitoring): label pod logs with env (prod/dev) #41 · Alloy env regex — anchor to ^j26-prod$. Copilot flagged a possible substring match (j26-prod-fooenv=prod). Prometheus/Alloy relabel regex is already fully anchored (^(?:...)$), so this was never a real bug — verified j26-prod-foo does not match. The explicit anchor is a no-op in behaviour but documents intent and pre-empts the confusion.
  • feat(notifications): add ServiceMonitor for notification-api #42 · ServiceMonitor metadata.namespace — set explicitly (j26-notifications), consistent with the other ServiceMonitors in the repo (signupinfo, keycloak, infratest). Makes the rendered manifest deterministic instead of relying on apply context.
  • feat(notifications): add ServiceMonitor for notification-api #42 · name/label mismatch — added a comment explaining the object is intentionally named j26-notifications (not notification-api) to match the existing in-cluster object for ArgoCD adoption.

Validation

  • alloy fmt passes (image v1.12.0).
  • kubectl kustomize k8s/app-manifest/j26-notifications renders the SM with the explicit namespace.

🤖 Generated with Claude Code

- alloy: anchor the env=prod relabel regex (^j26-prod$). It was already
  anchored implicitly by Prometheus relabel semantics, so this is a
  no-op in behaviour, but the explicit anchor documents intent and
  removes any doubt about substring matches (e.g. j26-prod-foo).
- notifications ServiceMonitor: set metadata.namespace explicitly for a
  deterministic rendered manifest (consistent with the other SMs in the
  repo), and note why the object is named for the app, not the Service.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Follow-up PR that addresses prior review feedback on monitoring manifests by making intent/behavior clearer and rendered Kubernetes resources more deterministic (consistent with other ServiceMonitors in the repo).

Changes:

  • Anchor Alloy relabel regex to ^j26-prod$ for explicit “exact match” intent.
  • Explicitly set metadata.namespace: j26-notifications on the notifications ServiceMonitor and document the intentional naming for ArgoCD adoption.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
k8s/infra-manifest/monitoring/alloy-values.yaml Makes the j26-prod namespace match intent explicit via an anchored regex for the env=prod relabel.
k8s/app-manifest/j26-notifications/servicemonitor-api.yaml Sets deterministic metadata.namespace and adds rationale comment to support ArgoCD adoption without duplicate resources.

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

@hakan-persson
hakan-persson merged commit 0a95713 into main Jul 4, 2026
1 check 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.

2 participants