Advertisement
karthikvee

prometheus-config

Aug 11th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. ubuntu@prometheus:~$ cat /opt/prometheus/prometheus.yml
  2. # my global config
  3. global:
  4. scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  5. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  6. # scrape_timeout is set to the global default (10s).
  7.  
  8. # Alertmanager configuration
  9. alerting:
  10. alertmanagers:
  11. - static_configs:
  12. - targets:
  13. # - alertmanager:9093
  14.  
  15. # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
  16. rule_files:
  17. # - "first_rules.yml"
  18. # - "second_rules.yml"
  19.  
  20. # A scrape configuration containing exactly one endpoint to scrape:
  21. # Here it's Prometheus itself.
  22. scrape_configs:
  23. # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  24. - job_name: 'prometheus'
  25.  
  26. # metrics_path defaults to '/metrics'
  27. # scheme defaults to 'http'.
  28.  
  29. static_configs:
  30. - targets: ['localhost:9090']
  31. - job_name: 'node_exporter'
  32. static_configs:
  33. - targets: ['localhost:9100']
  34.  
  35. ubuntu@prometheus:~$ cat /etc/systemd/system/prometheus.service
  36. [Unit]
  37. Description=Monitoring system and time series database
  38.  
  39. [Service]
  40. Restart=always
  41. User=prometheus
  42. ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data
  43. ExecReload=/bin/kill -HUP $MAINPID
  44. TimeoutStopSec=20s
  45. SendSIGKILL=no
  46. LimitNOFILE=8192
  47.  
  48. [Install]
  49. WantedBy=multi-user.target
  50.  
  51.  
  52. ubuntu@prometheus:~$ cat /etc/systemd/system/node-exporter.service
  53. [Unit]
  54. Description=Prometheus exporter for machine metrics
  55.  
  56. [Service]
  57. Restart=always
  58. User=prometheus
  59. ExecStart=/usr/local/bin/node_exporter
  60. ExecReload=/bin/kill -HUP $MAINPID
  61. TimeoutStopSec=20s
  62. SendSIGKILL=no
  63.  
  64. [Install]
  65. WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement