Refactor telegraf prometheus input
This commit is contained in:
		
							parent
							
								
									05014af744
								
							
						
					
					
						commit
						8a861e080b
					
				
					 2 changed files with 15 additions and 5 deletions
				
			
		| 
						 | 
					@ -18,12 +18,19 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[inputs.prometheus]]
 | 
					[[inputs.prometheus]]
 | 
				
			||||||
  urls = [
 | 
					  urls = [
 | 
				
			||||||
  {%- for url in svc.prometheus.urls -%}
 | 
					  {%- for url in svc.prometheus_unprotected.urls -%}
 | 
				
			||||||
    "{{ url }}",
 | 
					    "{{ url }}",
 | 
				
			||||||
  {%- endfor -%}
 | 
					  {%- endfor -%}
 | 
				
			||||||
  ]
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bearer_token_string = "{{ svc.prometheus.bearer_token }}"
 | 
					[[inputs.prometheus]]
 | 
				
			||||||
 | 
					  urls = [
 | 
				
			||||||
 | 
					  {%- for url in svc.prometheus_protected.urls -%}
 | 
				
			||||||
 | 
					    "{{ url }}",
 | 
				
			||||||
 | 
					  {%- endfor -%}
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bearer_token_string = "{{ svc.prometheus_protected.bearer_token }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[inputs.postgresql]]
 | 
					[[inputs.postgresql]]
 | 
				
			||||||
  address = "postgres://{{ svc.postgresql.user }}:{{ svc.postgresql.pass }}@{{ svc.postgresql.host }}:{{ svc.postgresql.port }}/{{ svc.postgresql.database }}?sslmode=verify-full"
 | 
					  address = "postgres://{{ svc.postgresql.user }}:{{ svc.postgresql.pass }}@{{ svc.postgresql.host }}:{{ svc.postgresql.port }}/{{ svc.postgresql.database }}?sslmode=verify-full"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,12 +6,15 @@ telegraf_svc:
 | 
				
			||||||
    token: "{{ vault_telegraf.influxdb_token }}"
 | 
					    token: "{{ vault_telegraf.influxdb_token }}"
 | 
				
			||||||
    organization: serguzim.net
 | 
					    organization: serguzim.net
 | 
				
			||||||
    bucket: metrics
 | 
					    bucket: metrics
 | 
				
			||||||
  prometheus:
 | 
					  prometheus_unprotected:
 | 
				
			||||||
 | 
					    urls:
 | 
				
			||||||
 | 
					      - https://matrix.msrg.cc/_synapse/metrics
 | 
				
			||||||
 | 
					      - https://push.serguzim.me/metrics
 | 
				
			||||||
 | 
					      - https://tick.serguzim.me/metrics
 | 
				
			||||||
 | 
					  prometheus_protected:
 | 
				
			||||||
    urls:
 | 
					    urls:
 | 
				
			||||||
      - https://ci.serguzim.me/metrics
 | 
					      - https://ci.serguzim.me/metrics
 | 
				
			||||||
      - https://git.serguzim.me/metrics
 | 
					      - https://git.serguzim.me/metrics
 | 
				
			||||||
      - https://matrix.msrg.cc/_synapse/metrics
 | 
					 | 
				
			||||||
      - https://tick.serguzim.me/metrics
 | 
					 | 
				
			||||||
    bearer_token: "{{ vault_metrics_token }}"
 | 
					    bearer_token: "{{ vault_metrics_token }}"
 | 
				
			||||||
  postgresql:
 | 
					  postgresql:
 | 
				
			||||||
    user: "{{ vault_telegraf.db.user }}"
 | 
					    user: "{{ vault_telegraf.db.user }}"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue