Bug 1780170: Expose metrics#270
Conversation
|
/retest |
1 similar comment
|
/retest |
a92d35f to
596a07f
Compare
| kind: Role | ||
| metadata: | ||
| name: prometheus-k8s | ||
| namespace: openshift-console-operator |
There was a problem hiding this comment.
Enable metrics to scrape in console-operator and console namespaces.
There was a problem hiding this comment.
We dont actually have a /metrics endpoint exposed for console, yet.
413aa05 to
a041171
Compare
4660f74 to
4a2aa03
Compare
|
@jhadvig @spadgett ready for review, we are wired up. A snippet of the other metrics we get automatically: |
95423a3 to
740e97f
Compare
740e97f to
97eb2ca
Compare
spadgett
left a comment
There was a problem hiding this comment.
We shouldn't be creating role bindings for things we're not using yet. Let's remove any references to metrics in openshift-console until it's needed.
jhadvig
left a comment
There was a problem hiding this comment.
Couple of questions, otherwise looking good 👍
97eb2ca to
7ad30b0
Compare
|
Metrics should be all lower case and word boundaries separated by underscore. In general we adhere to the Kubernetes Instrumentation Guidelines in OpenShift, so we should do the same here. |
|
@brancz I see that, so I did: // metric: console_url{url="https://<url>"} 1
consoleURLMetric = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "console",
Name: "url",
Help: "URL of the console exposed on the cluster",
// one label
}, []string{"url"})to give us |
|
@brancz disregard, i'll update to that per reading the doc you shared, thx! |
- Add manifest for ServiceMonitor object - Authorize prometheus to scrape metrics from console & console-operator - NOTE: console disabled until we support the /metrics endpoint - RBAC - reenable delegated auth - add rolebinding to kube-system for extension-apiserver-authentication-reader for console-operatoro - add clusterrole system:auth-delegator to console-operator - allows authentication (tokenreview) and authorization (subjectaccessreview) - required as the /metrics endpoint is protected - mount serving-cert in operator deployment - add labels to namespaces to tell openshift monitoring to begin monitoring
7ad30b0 to
346399b
Compare
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-4.1 |
|
@benjaminapetersen: #270 failed to apply on top of branch "release-4.1": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
kinda figured. |
|
@benjaminapetersen: All pull requests linked via external trackers have merged. Bugzilla bug 1780170 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Adds a new ServiceMonitor to allow the Helm metrics being scraped from console /metrics endpoint by prometheus-k8s. Closes: https://issues.redhat.com/browse/HELM-235 Reference: openshift#270 Signed-off-by: Allen Bai <abai@redhat.com>
We should expose /metrics to cluster monitor for both console & console-operator. Working out the details of this in this PR.
/metricsendpoint running, its just a matter of wiring it up/metricsendpoint at this time. This may require a follow on set of PRs, one to the console to enable aprom-clientfor the console server & collect at least basic heap metricsValidate that the operator is responding to the
/metricsendpoint via:curl --insecure -H "Authorization: Bearer $(oc whoami --show-token)" https://$(oc get route metrics --template "{{.spec.host}}"/metrics) | grep console_urlValidate that the
console_urlmetric is being reported in the monitoring UI:open $(oc get route prometheus-k8s -n openshift-monitoring -o jsonpath="{.spec.host}")Console URL
The console URL metric is tracked in the form of:
console_url{url="https://<url>"} 1Queried in the prometheus dashboard, will look like:
console_url{endpoint="https",instance="<ip>:8443",job="metrics",namespace="openshift-console-operator",pod="console-operator-<id>",service="metrics",url="https://console-openshift-console.apps.<domain>.devcluster.openshift.com"}Prometheus UI:
Our UI:
Related PRs to enable telemetry:
console_urlapproved for telemetry: Add metrics gathering for console_url telemeter#239console_urlin cluster-monitoring-operator: Add console_url metric cluster-monitoring-operator#486console_urlto observatorium: https://github.com/observatorium/configuration/pull/71/filesconsole_urlto sass-telemeterNote that this process will be simplified into a simpler config for 4.3.
Gist for the RBAC/manifest items to add in the future when we enable console itself:
Gist tracking steps for getting an metric whitelisted for telemetry