Add new fields to metric_relabel_config
Change-Id: I581216e5b6918c8c613c20fd141f287490509b59
This commit is contained in:
parent
be606a43c4
commit
3079228995
1 changed files with 16 additions and 7 deletions
|
@ -94,16 +94,25 @@ scrape_configs:
|
||||||
{%- if job.get('metric_relabel') %}
|
{%- if job.get('metric_relabel') %}
|
||||||
metric_relabel_configs:
|
metric_relabel_configs:
|
||||||
{%- for label in job.get('metric_relabel', []) %}
|
{%- for label in job.get('metric_relabel', []) %}
|
||||||
{%- if label.source_labels is string %}
|
- action: {{ label.get('action', 'replace') }}
|
||||||
{%- set label_list = label.source_labels.split(',') %}
|
{%- if label.get('source_labels') %}
|
||||||
{%- elif label.source_labels is list %}
|
{%- if label.source_labels is string %}
|
||||||
{%- set label_list = label.source_labels %}
|
{%- set label_list = label.source_labels.split(',') %}
|
||||||
|
{%- elif label.source_labels is list %}
|
||||||
|
{%- set label_list = label.source_labels %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if label_list is defined %}
|
||||||
|
source_labels: {{ label_list }}
|
||||||
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if label_list is defined %}
|
{%- if label.get('regex') %}
|
||||||
- source_labels: {{ label_list }}
|
|
||||||
regex: "{{ label.regex }}"
|
regex: "{{ label.regex }}"
|
||||||
|
{%- endif %}
|
||||||
|
{%- if label.get('target_label') %}
|
||||||
target_label: "{{ label.target_label }}"
|
target_label: "{{ label.target_label }}"
|
||||||
replacement: {{ label.replacement }}
|
{%- endif %}
|
||||||
|
{%- if label.get('replacement') %}
|
||||||
|
replacement: "{{ label.replacement }}"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in a new issue