Making users happy with Service Level Indicator...

Making users happy with Service Level Indicators and observability

A single sign-on system like Keycloak is a central component of the application landscape. Users depend on it to log in to their applications. Detailed monitoring and analysis options help prevent outages or resolve them quickly.
The Keycloak team has implemented numerous technical improvements regarding logs, metrics, and traces. We also provide a guide to service-level indicators and a matching Grafana dashboard for defining and monitoring behavior from the user perspective.
This talk offers practical advice on using Keycloak and is also a case study of how observability can be implemented for custom-built applications.

Alexander Schwartz PRO

November 26, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

27 slides
  1. Making users happy with service level indicators and observability Alexander

    Schwartz | Principal Software Engineer | IBM Grafana & Friends Meetup, AWS Community | Frankfurt (DE) | 2026-11-26
  2. The single sign on challenge • All applications depend on

    it • All users depend on it • There are usage spikes
  3. Keycloak is an Open Source Identity and Access Management Solution

    🎂 Initial commit 2013-07-02 🏆 Cloud Native Computing Foundation Incubating project since April 2023 📜 Apache License, Version 2.0 ⭐ 38k GitHub stars
  4. Recipe to make users happy • • Login works Login

    is fast Plus a lot of small details like token refresh, user data self management, password reset, auditing, … Spoiler: Keycloak now contains great observability features of Quarkus!
  5. Availability 👍 Measured by external tests to an application endpoint

    SLO: “Keycloak should be available X% of the time within 30 days”. Negatively affected by: • • • • Software upgrades of your service Unavailable infrastructure Denial of service attacks … https://www.keycloak.org/observability/keycloak-service-level-indicators
  6. Error Rate ⚖ Reported by the application or a load

    balancer SLO: “The rate of errors due to server problems for authentication requests should be less than X% within 30 days.” Negatively affected by: • • Problems with neighboring systems …
  7. Latency ⏱ Reported by the application or a load balancer

    SLO: “X% of authentication related requests should be faster than Y ms within 30 days.” Negatively affected by: • • • • Database or other infrastructure load Application load Lack of scalability …
  8. Measuring Availability 👍 1. Enable metrics. Prometheus will report the

    “up” metric. count_over_time( sum (up{ container="keycloak", namespace="$namespace" } > 0)[30d:15s] ) / count_over_time(vector(1)[30d:15s])
  9. Measuring Error Rate ⚖ 1. Identify relevant URLs and response

    code http_server_requests_seconds_count{method="POST",outcome="REDIRECTION", status="302",uri="/realms/{realm}/login-actions/authenticate"} 1.0 sum( rate( http_server_requests_seconds_count{ uri=~"/realms/...", outcome="SERVER_ERROR", container="keycloak", namespace="$namespace"} [30d] ) ) without (...) / sum( // without filtering by outcome ) without (...)
  10. Measuring Latency ⏱ 1. 2. Enable histograms for URL requests

    and add service level objective Use same URLs and response codes as before http_server_requests_seconds_bucket{method="POST",outcome="REDIRECTION",status="302" ,uri="/realms/{realm}/login-actions/authenticate",le="0.25"} 1.0 sum( rate( http_server_requests_seconds_bucket{ uri=~"/realms/...", le="0.25", container="keycloak", namespace="$namespace"} [30d] ) ) without (...) / sum( // use http_server_requests_seconds_count instead ) without (...)
  11. Create a Dashboard with SLOs • • Keycloak provides an

    example Grafana dashboard Drill down to essential troubleshooting metrics ◦ Keycloak metrics including user event metrics ◦ JVM metrics ◦ Database Metrics ◦ HTTP metrics ◦ Infinispan metrics https://www.keycloak.org/observability/grafana-dashboards https://www.keycloak.org/observability/metrics-for-troubleshooting
  12. Analyzing Errors You will find information by: • • •

    • Analyzing application logs Visualizing of metrics for correlation … Enabling tracing and exemplars
  13. Analyzing Latencies You will find information by: • • •

    • Additional logging (for example hibernate slow queries) Visualizing of metrics for correlation … Enabling tracing and exemplars
  14. Enabling tracing Tracing records all activities in a call with

    context and timing • • • • • • Enable tracing for your application. In production, apply sampling to trace for example 1% of all request to reduce overhead and limit collected data. Independent of the sampling, 100% of the logs will contain trace IDs, and it will propagate between systems. Set up firewalls and proxies to limit propagation of trace information Set up a destination for the tracing data (for example Jaeger or Tempo). Use web UIs to filter by duration, errors, URIs, and export/import single traces https://www.keycloak.org/observability/tracing
  15. Tracing implementation in Keycloak • • • Added custom tags

    for searching (Client ID, Realm name, User session ID, Token ID, Authentication Session ID, …) Default spans for REST, HTTP client calls and SQL Custom spans for LDAP and password handling
  16. Enabling Exemplars Exemplars connect metrics to recorded traces • •

    • • • Enable metrics and tracing for your application. Activate exemplar handling in Prometheus (or similar). Scrape the metrics in a format with exemplar support (OpenMetrics). Set up metrics datasource in Grafana (or similar) where to link for traces Set up dashboards in Grafana (or similar) to show exemplars http_server_requests_seconds_bucket{method="POST", ...} 1.0 # {span_id="ca8881cc77d54b5b",trace_id="884e409792e6a2c78a1b7d7fb8 0ddb13"} 0.272186118 1752144128.685 https://www.keycloak.org/observability/exemplars
  17. Happy users, happy devops team! • • • Track the

    metrics that matter for your users Make SLOs the base of your alertings Chase tail latencies and errors with exemplars
  18. Simple numbers, happy management • • • Have one set

    of numbers to share with your management Optimize your infrastructure costs with the given latency target Balance feature development vs. SLI optimization
  19. Links • • • • Slides: Keycloak https://www.keycloak.org/ Keycloak Observability

    https://www.keycloak.org/guides#observability KeycloakCon Barcelona / 15 March 2027 (part of KubeCon) https://keycloak-day.dev/ Keycloak DevDay / 8+9 April 2027 (sold out) https://keycloak-day.dev/ Kudos to the Quarkus observability efforts (thank you to Bruno Baptista and Erin Schnabel) and the Keycloak team (Martin Bartosz, Michal Hajas, Ryan Emerson, Kamesh Akella)

More Decks by Alexander Schwartz

Other Decks in Technology