OfficialSPIMonitoring / AuditStale
keycloak-metrics-spi
aerogear/keycloak-metrics-spi ↗
Exposes Keycloak metrics (Prometheus format) via an SPI.KeycloakのメトリクスをPrometheus形式で公開するSPI
- ★
- 614
- Forks
- 163
- Contributors
- 56
- Updated
- 2024-11-08
- KC
- 26.0.0
- License
- Apache-2.0
What it can doできること5
- Expose a Prometheus-format metrics endpoint at
/realms/<realm>/metrics.Prometheus形式のメトリクスエンドポイントを/realms/<realm>/metricsに公開 - Count logins, failed logins, client logins, refresh tokens, code-to-token exchanges and registrations (and their errors), labelled by realm, IdP and client.ログイン・失敗・クライアントログイン・リフレッシュ・コード交換・登録とそのエラーを、realm・IdP・クライアント別のラベル付きで集計
- Record a request-duration histogram per HTTP method, response-error counts and JVM metrics, plus every generic user/admin event.HTTPメソッド別のレスポンス時間ヒストグラム、エラー応答数、JVMメトリクス、全ユーザー/管理イベントも記録
- Push metrics to a Prometheus PushGateway (with basic auth and instance/cluster grouping) for clustered setups.クラスタ構成向けに、Prometheus PushGatewayへのプッシュに対応(Basic認証、インスタンス/クラスタ単位のグルーピング可)
- Optionally add consolidated URI labels and filter them by keyword; a ready-made Grafana dashboard is available.URIラベルの付与とキーワードでの絞り込みも可能。Grafanaダッシュボードも公開されている
What it cannot do / limitsできないこと・制約5
- The endpoint returns data for all realms whichever realm is in the URL — there is no per-realm isolation.URLのrealmに関係なく全realmのデータを返す(realm単位の分離はない)
- The endpoint is externally reachable unless you set
DISABLE_EXTERNAL_ACCESSand forwardX-Forwarded-Hostfrom your proxy.DISABLE_EXTERNAL_ACCESSを設定してプロキシでX-Forwarded-Hostを付けない限り、外部からアクセスできてしまう - Scraping each node behind a load balancer is problematic — you need the PushGateway.ロードバランサ配下では各ノードのスクレイプが難しく、PushGatewayが必要
- Login counters only cover non-admin users.ログイン系カウンタは管理者以外のユーザーのみが対象
- Low activity — listed as "less active" on the official extensions page, with the last commit in 2024.活動は低調。公式拡張ページでは "less active" 扱いで、最終コミットは2024年
Requirements前提条件
- Copy the JAR into both the build and run stages of the Quarkus image, and enable the
metrics-listenerevent listener per realm.QuarkusイメージのビルドとランタイムのJARを両方のステージにコピーし、realmごとにmetrics-listenerを有効化