Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316546

Change subject: prometheus: account for public hosts when generating targets
......................................................................

prometheus: account for public hosts when generating targets

For wikimedia.org hosts the hostname alone doesn't resolve in DNS, account for
this fact when generating targets.

Change-Id: Ic19947809abb0df9629d3ade94557835b2a292a7
---
M modules/role/templates/prometheus/node_site.yaml.erb
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/316546/1

diff --git a/modules/role/templates/prometheus/node_site.yaml.erb 
b/modules/role/templates/prometheus/node_site.yaml.erb
index c7b9979..3353a4b 100644
--- a/modules/role/templates/prometheus/node_site.yaml.erb
+++ b/modules/role/templates/prometheus/node_site.yaml.erb
@@ -9,7 +9,11 @@
   all.push(
     {
       'labels' => {'cluster' => cluster, 'site' => site },
-      'targets' => targets.map{|t| "#{t.split('.')[0]}:9100" },
+      'targets' => targets.map{ |t|
+          /.wikimedia.org$/ =~ t ?
+              "#{t}:9100" :
+              "#{t.split('.')[0]}:9100"
+      },
     }
   )
   end

-- 
To view, visit https://gerrit.wikimedia.org/r/316546
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic19947809abb0df9629d3ade94557835b2a292a7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to