Skip to content

Prometheus Integration

Use this integration when your workloads already expose Prometheus metrics and you want KloudMate to ingest them without changing application code.

KloudMate does not scrape Prometheus directly. Instead, you configure the KloudMate Agent with the Prometheus receiver and export the collected metrics to KloudMate.

  1. Install and run the KloudMate Agent.
  2. Ensure you can access the Prometheus configuration or know the scrape targets you want the Agent to use.

Add a Prometheus receiver to the Agent configuration file (typically /etc/km-agent/config.yaml). You can copy scrape jobs from your existing Prometheus configuration or define a smaller metrics-only subset for KloudMate.

receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: km-agent
          scrape_interval: 5s
          static_configs:
            - targets: ["0.0.0.0:8888"]
        - job_name: kubernetes-pods
          kubernetes_sd_configs:
            - role: pod
          relabel_configs:
            - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
              regex: "true"
              action: keep
          metric_relabel_configs:
            - source_labels: [__name__]
              regex: "(request_duration_seconds.*|response_duration_seconds.*)"
              action: keep

Validate indentation carefully when copying scrape_configs into the Agent configuration.

Configure the Agent’s pipeline to include the Prometheus receiver. The otlphttp exporter is already configured by default when you install the KloudMate Agent.

service:
  pipelines:
    metrics:
      receivers: [prometheus, hostmetrics] # Add prometheus to your existing receivers
      processors: [resource, batch]
      exporters: [debug, otlphttp]
systemctl restart kmagent
systemctl status kmagent

After the Agent restarts:

  • open Explore
  • query one of the scraped Prometheus metrics
  • build dashboards or alarms once the data is visible