Skip to content

Keycloak Integration

Use this integration when you want to scrape Keycloak metrics from its Prometheus-compatible metrics endpoint and send them to KloudMate through the KloudMate Agent.

  1. Install and run the KloudMate Agent.
  2. Ensure your Keycloak service exposes the /auth/metrics endpoint. If this endpoint is not available, no metrics will be scraped.
  3. Keycloak must be reachable from the node where the KloudMate Agent is running.

Add the following Prometheus receiver to your Agent configuration file (typically /etc/km-agent/config.yaml). Replace <keycloak-service-name> and <namespace> with your actual Kubernetes service name and namespace.

extensions:
  health_check:
    endpoint: 0.0.0.0:13133

receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: keycloak
          metrics_path: /auth/metrics
          scheme: http
          static_configs:
            - targets:
                - <keycloak-service-name>.<namespace>.svc.cluster.local:8080

Validate indentation carefully when copying scrape_configs into the Agent configuration.

Add the Prometheus receiver to the metrics pipeline in your Agent configuration.

service:
  extensions:
    - health_check
  telemetry:
    metrics:
      level: none
  pipelines:
    metrics/keycloak:
      receivers:
        - prometheus
      processors:
        - batch
      exporters:
        - otlphttp
systemctl restart kmagent
systemctl status kmagent

After the Agent restarts:

  • Open Explore in KloudMate.
  • Query one of the scraped Keycloak metrics.
  • Build dashboards or alarms once data is visible.