Skip to content

Monitoring API and TCP endpoints

Deepak Narayana Rao edited this page Oct 17, 2017 · 2 revisions

Blackbox exporter is for monitoring API and TCP endpoints. Please checkout examples of blackbox exporter modules

Sunbird's blackbox_exporter modules are defined in blackboxconfig.yml

Monitoring APIs

APIs are monitored using http modules

Example:

# prometheus.yml
- job_name: 'availability_static_site'
  metrics_path: /probe
  params:
    module: [http_2xx]  # Look for a HTTP 200 response.
  static_configs:
  - targets:
    - {{static_site_url}}
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: monitor_blackbox-exporter:9115  # Blackbox exporter.

Please read relabel_configs to understand relabelling. The relabel_configs used by blackbox exporter is not documented well. We are following the structure provided in example config

Monitoring TCP end points

APIs are monitored using tcp module

Example:

# prometheus.yml
- job_name: 'availability_cassandra'
  metrics_path: /probe
  params:
    module: [tcp_connect]
  static_configs:
  - targets:
    - {{ cassandra_host }}:{{ cassandra_port }}
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: monitor_blackbox-exporter:9115  # Blackbox exporter.

Please read relabel_configs to understand relabelling. The relabel_configs used by blackbox exporter is not documented well. We are following the structure provided in example config

Clone this wiki locally