Skip to content

3. Prometheus Server Configuration

Vova Nekhai edited this page Dec 13, 2021 · 10 revisions

In order to send metrics to the Anodot platform, remote-write should be configured for the Prometheus server

Important note:

In prometheus server with version < 2.18, when changing regex config restart is required. More details here

Standalone Prometheus server

In Prometheus configuration file (default prometheus.yml), add remote_write configuration

global:
 scrape_interval: 60s
 evaluation_interval: 60s
remote_write:
 - url: "http://anodot-prometheus-remote-write:1234/receive"
   queue_config:
     max_samples_per_send: 1000
     capacity: 6000
     max_shards: 20
   #write_relabel_configs:
   #- source_labels: [ __name__ ]
   #  regex: '(nginx_ingress_controller_requests|nginx_ingress_controller_ingress_upstream_latency_seconds)'
   #  action: drop

Prometheus Operator

The following is a configuration example of the Prometheus operator (some fields omitted for clarity):

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  labels:
    app: prometheus-operator-prometheus
  name: prometheus
spec:
    remoteWrite:
     - url: http://anodot-prometheus-remote-write:1234/receive
     #  writeRelabelConfigs:
     #    - action: drop
     #      regex: '(apiserver_request_count|prometheus_remote_storage_sent_batch_duration_seconds_bucket)'
     #      sourceLabels: [__name__]
       queueConfig:
         maxSamplesPerSend: 1000
  version: v2.10.0

Filtering metrics in order for them to be sent to Anodot is described here. Additional Prometheus configuration options are available on this page.

Clone this wiki locally