HTTP REST Api endpoint scrape_configs.yml - IBM/ibm-spectrum-scale-bridge-for-grafana GitHub Wiki

  • /scrape_configs.yml

    • Supported for Prometheus API
    • This endpoint generates only the scrape_configs list in YAML format (without global, storage, alerting, or rule_files), suitable for referencing from scrape_config_files in Prometheus 2.43 or later.
    • Designed for environments monitoring multiple IBM Storage Scale clusters or integrating into an existing central Prometheus configuration.
    • NOTE: You must have installed the PyYAML Python package on the host running the IBM Storage Scale bridge for Grafana before starting it.
    • Further information can be found in the article Generate scrape configurations for multiple systems.

Query Parameters

Parameter Type Default Description
job_suffix String (^[A-Za-z0-9_.:-]{1,64}$) (empty) Appends a literal suffix to every bridge-generated job_name (e.g. ?job_suffix=_clusterA). Essential for avoiding job name collisions across multiple clusters.
internal_metrics Boolean (true | false) false When true, adds scrape jobs for /http_metrics and /internal_stats (scraped every 60 s).
target Host or Host:Port (auto-detected) Overrides the scrape target host or host:port in static_configs.
path Absolute filesystem path (empty) Writes the generated scrape config YAML directly to a file or directory on the bridge host filesystem.

Prometheus API

Example output:

# curl -v http://9.1XX.XXX.254:9250/scrape_configs.yml?job_suffix=_clusterA -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
*   Trying 9.1XX.XXX.254:9250...
* Connected to 9.1XX.XXX.254 (9.1XX.XXX.254) port 9250 (#0)
* Server auth using Basic with user 'scale_admin'
> GET /scrape_configs.yml?job_suffix=_clusterA HTTP/1.1
> Host: 9.1XX.XXX.254:9250
> Authorization: Basic c2NhbGVfYWRtaW46VFhsV1pYSjVVM1J5YjI1blVHRnpjM2N3Y21RaENnPT0=
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain;charset=utf-8
< Server: CherryPy/18.9.0
< Date: Fri, 31 May 2024 10:55:13 GMT
< Allow: GET, HEAD, OPTIONS, TOPO
< Content-Length: 4890
<
# Generated by IBM Storage Scale bridge for Grafana.
# Do not edit, changes will be lost on the next update.
# Reference this file in prometheus.yml under scrape_config_files.
scrape_configs:
- basic_auth:
    password: TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
    username: scale_admin
  honor_timestamps: true
  job_name: GPFSFilesystem_clusterA
  metrics_path: /metrics_gpfs_filesystem
  scheme: http
  scrape_interval: 10s
  static_configs:
  - targets:
    - 10.0.100.11:9250
- basic_auth:
    password: TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
    username: scale_admin
  honor_timestamps: true
  job_name: GPFSNSDDisk_clusterA
  metrics_path: /metrics_gpfs_nsddisk
  scheme: http
  scrape_interval: 10s
  static_configs:
  - targets:
    - 10.0.100.11:9250
- basic_auth:
    password: TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
    username: scale_admin
  honor_timestamps: true
  job_name: GPFSVFSX_clusterA
  metrics_path: /metrics_gpfs_vfsx
  scheme: http
  scrape_interval: 10s
  static_configs:
  - targets:
    - 10.0.100.11:9250
...