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 docs for additional metrics provided by metrics server #1222

Closed
wants to merge 1 commit into from

Conversation

BojanZelic
Copy link
Contributor

Metrics server actually exposes an additional metric endpoint that many probably are not aware of; This is where SLO metrics can be retrieved from;

exposes metrics like:

apiserver_request_total{group="external.metrics.k8s.io"}
apiserver_request_sli_duration_seconds_bucket{group="external.metrics.k8s.io"}

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)

Fixes #4460

@BojanZelic BojanZelic requested a review from a team as a code owner September 15, 2023 22:26
@netlify
Copy link

netlify bot commented Sep 15, 2023

Deploy Preview for keda ready!

Name Link
🔨 Latest commit 251b9d5
🔍 Latest deploy log https://app.netlify.com/sites/keda/deploys/6504d9fe3ef2b30008b2fdf9
😎 Deploy Preview https://deploy-preview-1222--keda.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

  • Add your contribution to all applicable KEDA versions
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Learn more about:

@JorTurFer
Copy link
Member

What KEDA version are you using? I'm using main tag and I don't see those metrics from metrics server prometheus endpoint

@BojanZelic
Copy link
Contributor Author

@JorTurFer I'm using the latest 2.11, but it should be present in pretty much all versions of keda metrics server;

kubectl create serviceaccount -n default monitoring-user

kubectl apply -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: prometheus
rules:
  - nonResourceURLs:
      - "/metrics"
    verbs:
      - get
EOF

kubectl create clusterrolebinding prometheus --clusterrole=prometheus --serviceaccount=default:monitoring-user

kubectl port-forward -n keda keda-metrics-apiserver-66c887bbb4-5znvl 6443:6443

# new terminal
TOKEN=$(kubectl create token monitoring-user)
curl --verbose -k -H "Authorization: Bearer $TOKEN" https://localhost:6443/metrics

@BojanZelic BojanZelic closed this Sep 18, 2023
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.

Additional exported metrics for the metrics apiserver
2 participants