c79547cb91
This adds the optional configuration options: - statsd_host - statsd_port - statsd_metric_prefix (defaults to inventory_hostname) - statsd_default_sample_rate - statsd_sample_rate_factor Which can be defined under swift globally or on the server level. The configuration will only be added if statsd_host is defined. Change-Id: I793b189e0a1f5ca4fc1fe17b1d89f2a83af8c796
33 lines
1.3 KiB
Django/Jinja
33 lines
1.3 KiB
Django/Jinja
|
|
{% if swift_vars is defined %}
|
|
{% if swift_vars.statsd_host is defined %}
|
|
{% set statsd = 1 %}
|
|
log_statsd_host = {{ swift_vars.statsd_host | default(statsd_host) }}
|
|
{% elif swift.statsd_host is defined %}
|
|
{% set statsd =1 %}
|
|
log_statsd_host = {{ swift.statsd_host | default(statsd_host) }}
|
|
{% endif %}
|
|
{% if statsd is defined %}
|
|
{% if swift_vars.statsd_port is defined %}
|
|
log_statsd_port = {{ swift_vars.statsd_port }}
|
|
{% else %}
|
|
log_statsd_port = {{ swift.statsd_port | default(statsd_port) }}
|
|
{% endif %}
|
|
{% if swift_vars.statsd_default_sample_rate is defined %}
|
|
log_statsd_default_sample_rate = {{ swift_vars.statsd_default_sample_rate }}
|
|
{% else %}
|
|
log_statsd_default_sample_rate = {{ swift.statsd_default_sample_rate | default(statsd_default_sample_rate) }}
|
|
{% endif %}
|
|
{% if swift_vars.statsd_sample_rate_factor is defined %}
|
|
log_statsd_sample_rate_factor = {{ swift_vars.statsd_sample_rate_factor }}
|
|
{% else %}
|
|
log_statsd_sample_rate_factor = {{ swift.statsd_sample_rate_factor | default(statsd_sample_rate_factor) }}
|
|
{% endif %}
|
|
{% if swift_vars.statsd_metric_prefix is defined %}
|
|
log_statsd_metric_prefix = {{ swift_vars.statsd_metric_prefix }}
|
|
{% else %}
|
|
log_statsd_metric_prefix = {{ swift.statsd_metric_prefix | default(inventory_hostname) }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|