prometheus.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # my global config
  2. global:
  3. scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  4. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  5. # scrape_timeout is set to the global default (10s).
  6. # Alertmanager configuration
  7. alerting:
  8. alertmanagers:
  9. - static_configs:
  10. - targets:
  11. # - alertmanager:9093
  12. # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
  13. rule_files:
  14. # - "first_rules.yml"
  15. # - "second_rules.yml"
  16. # A scrape configuration containing exactly one endpoint to scrape:
  17. # Here it's Prometheus itself.
  18. scrape_configs:
  19. - job_name: 'Prometheus'
  20. static_configs:
  21. - targets: ['127.0.0.1:9090']
  22. - job_name: 'Grafana'
  23. static_configs:
  24. - targets: ['127.0.0.1:3000']
  25. - job_name: 'Nacos'
  26. metrics_path: '/nacos/actuator/prometheus'
  27. static_configs:
  28. - targets: ['127.0.0.1:8848']
  29. # monitor 监控的账号密码
  30. basic_auth:
  31. username: ruoyi
  32. password: 123456
  33. - job_name: RuoYi-Cloud-Plus
  34. honor_timestamps: true
  35. scrape_interval: 15s
  36. scrape_timeout: 10s
  37. metrics_path: /actuator/prometheus
  38. scheme: http
  39. # monitor 监控的账号密码
  40. basic_auth:
  41. username: ruoyi
  42. password: 123456
  43. http_sd_configs:
  44. - url: 'http://127.0.0.1:9100/actuator/prometheus/sd'
  45. # monitor 监控的账号密码
  46. basic_auth:
  47. username: ruoyi
  48. password: 123456
  49. relabel_configs:
  50. # 如果目标有context_path标签,则修改metrics_path以包含该上下文路径
  51. - source_labels: [__meta_http_sd_context_path]
  52. target_label: __metrics_path__
  53. replacement: '${1}/actuator/prometheus'