You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: artifacts/rhdh-plugins-reference/keycloak/keycloak-plugin-admin.adoc
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,64 @@ When using client credentials, the access type must be set to `confidential` and
143
143
* `query-users`
144
144
* `view-users`
145
145
146
+
== Metrics
147
+
148
+
The Keycloak backend plugin supports link:https://opentelemetry.io/[OpenTelemetry] metrics that you can use to monitor fetch operations and diagnose potential issues.
149
+
150
+
=== Available Counters
151
+
152
+
.Keycloak metrics
153
+
[cols="60%,40%", frame="all", options="header"]
154
+
|===
155
+
|Metric Name
156
+
|Description
157
+
| `backend_keycloak_fetch_task_failure_count_total` | Counts fetch task failures where no data was returned due to an error.
158
+
| `backend_keycloak_fetch_data_batch_failure_count_total` | Counts partial data batch failures. Even if some batches fail, the plugin continues fetching others.
159
+
|===
160
+
161
+
=== Labels
162
+
163
+
All counters include the `taskInstanceId` label, which uniquely identifies each scheduled fetch task. You can use this label to trace failures back to individual task executions.
164
+
165
+
Users can enter queries in the Prometheus UI or Grafana to explore and manipulate metric data.
166
+
167
+
In the following examples, a Prometheus Query Language (PromQL) expression returns the number of backend failures.
168
+
169
+
.Example to get the number of backend failures associated with a `taskInstanceId`
PromQL supports arithmetic operations, comparison operators, logical/set operations, aggregation, and various functions. Users can combine these features to analyze time-series data effectively.
185
+
186
+
Additionally, the results can be visualized using Grafana.
187
+
====
188
+
189
+
// === Use Case Example
190
+
191
+
// Imagine your Keycloak instance is under-provisioned (e.g., low CPU/RAM limits), and the plugin is configured to send many parallel API requests.
192
+
// This could cause request timeouts or throttling. The metrics described above can help detect such behavior early, allowing administrators to:
193
+
194
+
// - Tune the plugin configuration (e.g., reduce parallelism)
195
+
// - Increase resources on the Keycloak server
196
+
// - Investigate network or permission issues
197
+
198
+
=== Exporting Metrics
199
+
200
+
You can export metrics using any OpenTelemetry-compatible backend, such as *Prometheus*.
201
+
202
+
See the link:https://backstage.io/docs/tutorials/setup-opentelemetry[Backstage OpenTelemetry setup guide] for integration instructions.
203
+
146
204
== Limitations
147
205
148
206
If you have self-signed or corporate certificate issues, you can set the following environment variable before starting {product-short}:
0 commit comments