メトリクスの収集

Screwdriver.cdでは、Prometheusで利用できるメトリクスを提供しています。 設定を追加することでこれらのメトリクスを収集することができます。

APIメトリクス

prometheus.ymlのファイル内のscrape_configsに以下のジョブ設定を追加してください。

scrape_configs:
  - job_name: 'screwdriver-api'
    metrics_path: /v4/metrics
    static_configs:
      - targets:
        - <your-api-hostname>:<your-api-port>

ビルドメトリクス

このメトリクスを利用したい場合は、Pushgatewayも必要になります。また、キューサービスの設定を参照し、pushgatewayのURLを設定してください。

prometheus.ymlのファイル内のscrape_configsに以下のジョブ設定を追加してください。

scrape_configs:
  - job_name: 'pushgateway'
    static_configs:
      - targets:
        - <your-pushgateway-hostanme>:<your-pushgateway-port>
    metrics_path: /metrics
    honor_labels: true