Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing scrape annotations to provider pods #5529

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

turkenh
Copy link
Member

@turkenh turkenh commented Mar 29, 2024

Description of your changes

All crossplane providers expose metrics by default, the ones inherited from controller runtime at minimum. In provider pods, the package manager adds the metrics port already but don't add the Prometheus scrape annotations, which would be convenient for observing providers without additional configuration.

This PR adds the following annotations to all provider pods by default:

"prometheus.io/scrape": "true"
"prometheus.io/port":   "8080"
"prometheus.io/path":   "/metrics"

It is possible to disable this behavior with a DeploymentRuntimeConfig as below:

apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: no-scrape
spec:
  deploymentTemplate:
    spec:
      selector: {}
      template:
        metadata:
          annotations:
            prometheus.io/scrape: "false"

We are already adding these annotations to Crossplane and RBAC manager pods.

I have:

Need help with this checklist? See the cheat sheet.

Signed-off-by: Hasan Turken <turkenh@gmail.com>
@turkenh turkenh merged commit 0b8eaa5 into crossplane:master Mar 29, 2024
20 checks passed
Copy link

Backport failed for release-1.14, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.14
git worktree add -d .worktree/backport-5529-to-release-1.14 origin/release-1.14
cd .worktree/backport-5529-to-release-1.14
git switch --create backport-5529-to-release-1.14
git cherry-pick -x 6365d26beb3a68b2e4058ec97626339da7e11346

Copy link

Successfully created backport PR for release-1.15:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants