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 Grafana dashboard #985

Merged
merged 7 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions content/docs/2.8/operate/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,44 @@ weight = 200

## Prometheus Exporter Metrics

### Operator
### Operator

The KEDA Operator exposes Prometheus metrics which can be scraped on port `8080` at `/metrics`. The following metrics are being gathered:

- Metrics exposed by the `Operator SDK` framework as explained [here](https://sdk.operatorframework.io/docs/building-operators/golang/advanced-topics/#metrics).

### Metrics Adapter

The KEDA Metrics Adapter exposes Prometheus metrics which can be scraped on port `9022` (this can be changed by setting the `metrics-port` argument for the Metrics Adapter) at `/metrics`. The metrics collected in the Metrics Adapter are only active when the HPA is active (> 0 replicas).
The KEDA Metrics Adapter exposes Prometheus metrics which can be scraped on port `9022` (this can be changed by setting the `metrics-port` argument for the Metrics Adapter) at `/metrics`. The metrics collected in the Metrics Adapter are only active when the HPA is active (> 0 replicas).

The following metrics are being gathered:

- `keda_metrics_adapter_scaler_error_totals` - The total number of errors encountered for all scalers.
- `keda_metrics_adapter_scaled_object_error_totals`- The number of errors that have occurred for each scaled object.
- `keda_metrics_adapter_scaler_errors` - The number of errors that have occurred for each scaler.
- `keda_metrics_adapter_scaler_metrics_value`- The current value for each scaler's metric that would be used by the HPA in computing the target average.

## Premade Grafana dashboard

A premade [Grafana dashboard](https://github.com/kedacore/keda/tree/main/config/grafana/keda-dashboard.json) is available to visualize metrics exposed by the KEDA Metrics Adapter.

![KEDA Grafana dashboard](/img/grafana-dashboard.png)

The dashboard has two sections; the metric server visualizes metrics from KEDA, and the scale target visualizes the changes in replicas initially triggered by KEDA.

The metric queries are:

- `sum by(job) (rate(keda_metrics_adapter_scaler_errors_total{}[5m]))`
- `sum by(scaler) (rate(keda_metrics_adapter_scaler_errors{namespace=~"$namespace", scaledObject=~"$scaledObject", scaler=~"$scaler"}[5m]))`
- `sum by(scaledObject) (rate(keda_metrics_adapter_scaled_object_errors{namespace=~"$namespace", scaledObject=~"$scaledObject"}[5m]))`
- `sum by(metric) (rate(keda_metrics_adapter_scaler_metrics_value{namespace=~"$namespace", metric=~"$metric"}[5m]))`
- `changes(kube_deployment_spec_replicas{deployment=~"$scaledObject"}[1m])`
- `changes(kube_statefulset_replicas{statefulset=~"$scaledObject"}[1m])`

On top, the dashboard supports the following variables:

- datasource
- namespace
- scaledObject
- scaler
- metric
Binary file added static/img/grafana-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.