The consul_exporter_config block configures the consul_exporter integration, which is an embedded version of consul_exporter. This allows for the collection of consul metrics and exposing them as Prometheus metrics.

Full reference of options:

  1. # Enables the consul_exporter integration, allowing the Agent to automatically
  2. # collect system metrics from the configured consul server address
  3. [enabled: <boolean> | default = false]
  4. # Sets an explicit value for the instance label when the integration is
  5. # self-scraped. Overrides inferred values.
  6. #
  7. # The default value for this integration is inferred from the hostname portion
  8. # of the server URL.
  9. [instance: <string>]
  10. # Automatically collect metrics from this integration. If disabled,
  11. # the consul_exporter integration will be run but not scraped and thus not
  12. # remote-written. Metrics for the integration will be exposed at
  13. # /integrations/consul_exporter/metrics and can be scraped by an external
  14. # process.
  15. [scrape_integration: <boolean> | default = <integrations_config.scrape_integrations>]
  16. # How often should the metrics be collected? Defaults to
  17. # prometheus.global.scrape_interval.
  18. [scrape_interval: <duration> | default = <global_config.scrape_interval>]
  19. # The timeout before considering the scrape a failure. Defaults to
  20. # prometheus.global.scrape_timeout.
  21. [scrape_timeout: <duration> | default = <global_config.scrape_timeout>]
  22. # Allows for relabeling labels on the target.
  23. relabel_configs:
  24. [- <relabel_config> ... ]
  25. # Relabel metrics coming from the integration, allowing to drop series
  26. # from the integration that you don't care about.
  27. metric_relabel_configs:
  28. [ - <relabel_config> ... ]
  29. # How frequent to truncate the WAL for this integration.
  30. [wal_truncate_frequency: <duration> | default = "60m"]
  31. # Monitor the exporter itself and include those metrics in the results.
  32. [include_exporter_metrics: <bool> | default = false]
  33. #
  34. # Exporter-specific configuration options
  35. #
  36. # Prefix from which to expose key/value pairs.
  37. [kv_prefix: <string> | default = ""]
  38. # Regex that determines which keys to expose.
  39. [kv_filter: <string> | default = ".*"]
  40. # Generate a health summary for each service instance. Needs n+1 queries to
  41. # collect all information.
  42. [generate_health_summary: <bool> | default = true]
  43. # HTTP API address of a Consul server or agent. Prefix with https:// to
  44. # connect using HTTPS.
  45. [server: <string> | default = "http://localhost:8500"]
  46. # Disable TLS host verification.
  47. [insecure_skip_verify: <bool> | default = false]
  48. # File path to a PEM-encoded certificate authority used to validate the
  49. # authenticity of a server certificate.
  50. [ca_file: <string> | default = ""]
  51. # File path to a PEM-encoded certificate used with the private key to verify
  52. # the exporter's authenticity.
  53. [cert_file: <string> | default = ""]
  54. # File path to a PEM-encoded private key used with the certificate to verify
  55. # the exporter's authenticity.
  56. [key_file: <string> | default = ""]
  57. # When provided, this overrides the hostname for the TLS certificate. It can
  58. # be used to ensure that the certificate name matches the hostname we declare.
  59. [server_name: <string> | default = ""]
  60. # Timeout on HTTP requests to the Consul API.
  61. [timeout: <duration> | default = "500ms"]
  62. # Limit the maximum number of concurrent requests to consul. 0 means no limit.
  63. [concurrent_request_limit: <int> | default = 0]
  64. # Allows any Consul server (non-leader) to service a read.
  65. [allow_stale: <bool> | default = true]
  66. # Forces the read to be fully consistent.
  67. [require_consistent: <bool> | default = false]

采集的指标列表

  1. consul_memberlist_tcp : irate(consul_memberlist_tcp{host="$consul"}[1m])
  2. consul_memberlist_udp : irate(consul_memberlist_udp{host="$consul"}[1m])
  3. consul_raft_apply[30s]) : delta(consul_raft_apply[30s])
  4. consul_raft_commitTime : consul_raft_commitTime
  5. consul_raft_leader_dispatchLog : consul_raft_leader_dispatchLog
  6. consul_raft_leader_lastcontact : consul_raft_leader_lastcontact
  7. consul_raft_leader_lastcontact_count : consul_raft_leader_lastcontact_count
  8. consul_raft_replication_appendEntries_rpc : consul_raft_replication_appendEntries_rpc
  9. consul_raft_replication_heartbeat : consul_raft_replication_heartbeat
  10. consul_rpc_query : delta(consul_rpc_query{host="$consul"}[30s])
  11. consul_serf_coordinate_adjustment_ms : consul_serf_coordinate_adjustment_ms{host="$consul"}
  12. labels) : COUNT (changes(consul_memberlist_gossep_sum[1m]) > 0) BY (labels)
  13. node_cpu : sum(irate(node_cpu{mode="idle", host="$consul"}[1m])) * 100 / count_scalar(node_cpu{mode="user", host="$consul"})
  14. node_load1 : node_load1{host="$consul"}
  15. node_load15 : node_load15{host="$consul"}
  16. node_load5 : node_load5{host="$consul"}