Nish Patwa 17450f35f3 Adding influx relay to make the existing monitoring stack highly available
Added Influxdb relay to make the existing monitoring stack highly
available. Relay replicates the data to multiple database instances.
Also added configutation in HAProxy that load balances the read queries
to influxdb instances and write queries to influxdb relays

        ┌─────────────────┐
        │writes & queries │
        └─────────────────┘
                 │
                 ▼
         ┌───────────────┐
         │               │
┌────────│ Load Balancer │─────────┐
│        │               │         │
│        └──────┬─┬──────┘         │
│               │ │                │
│               │ │                │
│        ┌──────┘ └────────┐       │
│        │ ┌─────────────┐ │       │┌──────┐
│        │ │/write or UDP│ │       ││/query│
│        ▼ └─────────────┘ ▼       │└──────┘
│  ┌──────────┐      ┌──────────┐  │
│  │ InfluxDB │      │ InfluxDB │  │
│  │ Relay    │      │ Relay    │  │
│  └──┬────┬──┘      └────┬──┬──┘  │
│     │    |              |  │     │
│     |  ┌─┼──────────────┘  |     │
│     │  │ └──────────────┐  │     │
│     ▼  ▼                ▼  ▼     │
│  ┌──────────┐      ┌──────────┐  │
│  │          │      │          │  │
└─▶│ InfluxDB │      │ InfluxDB │◀─┘
   │          │      │          │
   └──────────┘      └──────────┘

This patch is dependent on this patch:
https://review.openstack.org/#/c/392328/

Change-Id: I05bdaa0e2fb251b48df1d26d09ad63942872293a
2016-11-10 15:54:56 +00:00

68 lines
1.4 KiB
Django/Jinja

[global_tags]
{% if inventory_hostname in groups['all_containers'] %}
node_type = "container"
{% elif inventory_hostname in groups['hosts'] %}
node_type = "physical_host"
{% endif %}
[agent]
interval = "24s"
round_interval = false
metric_batch_size = 1024
metric_buffer_limit = 10240
collection_jitter = "8s"
flush_interval = "48s"
flush_jitter = "8s"
debug = false
quiet = true
{% if inventory_hostname in groups['all_containers'] %}
hostname = "{{ ansible_hostname }}"
{% else %}
hostname = "{{ inventory_hostname }}"
{% endif %}
omit_hostname = false
[[outputs.influxdb]]
urls = ["http://{{ internal_lb_vip_address }}:{{ influxdb_port }}"]
database = "{{ influxdb_db_name }}"
precision = "s"
write_consistency = "any"
timeout = "5s"
[[inputs.processes]]
[[inputs.system]]
{% if inventory_hostname in groups['all_containers'] %}
[[inputs.net]]
{% elif inventory_hostname in groups['hosts'] %}
[[inputs.cpu]]
percpu = true
totalcpu = true
fielddrop = ["time_*"]
[[inputs.net]]
[[inputs.netstat]]
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs"]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.swap]]
{% if inventory_hostname in groups['nova_compute'] %}
[[inputs.exec]]
commands = ["/opt/telegraf/kvm_virsh.py"]
timeout = "15s"
data_format = "json"
name_prefix = "custom_"
{% endif %}
{% endif %}