Skip to content

kubernetes-manifests/prometheus-scrape-config-files

Repository files navigation

prometheus-scrape-config-files

Useful prometheus scrape config files

Usage

Clone repo:

git clone --depth=1 https://github.com/kubernetes-manifests/prometheus-scrape-config-files.git

Generate configmap that contains scrape config files using kustomize:

configMapGenerator:
  - files:
      - "prometheus-scrape-config-files/kubernetes-pods.yaml"
      - "prometheus-scrape-config-files/kubernetes-service-endpoints.yaml"
      - "prometheus-scrape-config-files/kube-state-metrics.yaml"
    name: scrape-config
    behavior: replace
    options:
      disableNameSuffixHash: true

Make sure configmap is mounted into prometheus or victoria pods:

        volumeMounts:
        - mountPath: /scrapeconfig
          name: scrape-config
      volumes:
        - configMap:
            defaultMode: 420
            name: scrape-config
          name: scrape-config

And set scrape_config_files in "promscrape.config" file:

scrape_config_files:
  - /scrapeconfig/*.yaml

About

scrape_config_files for Prometheus and VictoriaMetrics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published