Keycloak HTTP metrics

Learn about metrics for monitoring the Keycloak HTTP requests processing

Prerequisites

  • Metrics need to be enabled for Keycloak. Follow the Enabling Keycloak Metrics guide for more details.

  • A monitoring system collecting the metrics.

Metrics

Processing time

The processing time is exposed by these metrics, to monitor the Keycloak performance and how long it takes to processing the requests.

On a healthy cluster, the average processing time will remain stable. Spikes or increases in the processing time may be an early sign that some node is under load.

Tags

method

HTTP method.

outcome

A more general outcome tag.

status

The HTTP status code.

uri

The requested URI.

Metric Description

http_server_requests_seconds_count

The total number of requests processed.

http_server_requests_seconds_sum

The total duration for all the requests processed.

When histograms are enabled, the percentile buckets are available. Those are useful to create heat maps and analyze latencies, still collecting and exposing the percentile buckets will increase the load of to your monitoring system.

Active requests

The current number of active requests is also available.

Metric Description

http_server_active_requests

The current number of active requests

Bandwidth

The metrics below helps to monitor the bandwidth and consumed traffic used by Keycloak and consumed by the requests and responses received or sent.

Metric Description

http_server_bytes_written_count

The total number of responses sent.

http_server_bytes_written_sum

The total number of bytes sent.

http_server_bytes_read_count

The total number of requests received.

http_server_bytes_read_sum

The total number of bytes received.

When histograms are enabled, the percentile buckets are available. Those are useful to create heat maps and analyze latencies, still collecting and exposing the percentile buckets will increase the load of to your monitoring system.

Next steps

On this page