templates/agent-conf.d/consul.yaml.erb (43 lines of code) (raw):
# This check takes no init_config
init_config:
instances:
# Where your Consul HTTP Server Lives
# Remind to use https instead of http if your Consul setup is configured to do so.
- url: <%= @url %>
# If Consul setup uses SSL, you might need to set the following options as well.
# You can specify a local cert to use as client side certificate
# as a single file (containing the private key and the certificate concatenated)
# client_cert_file: '/path/to/client.concatenated.pem'
# Or as two separate files (for certificate and key):
# client_cert_file: '/path/to/client.cert.pem'
# private_key_file: '/path/to/private.key.pem'
# Whether to verifiy SSL certificates for HTTPS requests.
# Possible values: True, False or '/path/to/your/trusted_ca_bundle_file'
# ca_bundle_file: '/path/to/trusted_ca_bundle_file'
# Whether to perform checks against the Consul service Catalog
catalog_checks: <%= @catalog_checks ? 'yes' : 'no' %>
# Whether to enable new leader checks from this agent
# Note: if this is set on multiple agents in the same cluster
# you will receive one event per leader change per agent
new_leader_checks: <%= @new_leader_checks ? 'yes' : 'no' %>
# Whether to enable network latency metrics collection. When enabled
# consul network coordinates will be retrieved and latency calculated for
# each node and between data centers.
# See https://www.consul.io/docs/internals/coordinates.html
network_latency_checks: <%= @network_latency_checks ? 'yes' : 'no' %>
# Services to restrict catalog querying to
# The default settings query up to 50 services. So if you have more than
# this many in your Consul service catalog, you will want to fill in the
# whitelist
# service_whitelist:
# - zookeeper
# - gunicorn
# - redis
<%- if @service_whitelist and ! @service_whitelist.empty? -%>
service_whitelist:
<%- Array(@service_whitelist).each do |svc| -%>
<%- if svc != '' -%>
- <%= svc %>
<%- end -%>
<%- end -%>
<% end -%>