diff options
author | Byron Jones <glob@mozilla.com> | 2014-03-19 09:03:37 +0100 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-03-19 09:03:37 +0100 |
commit | 80c784ce1b8805b4d1797bcc1c49bc40a7ea1946 (patch) | |
tree | 3a482ceebb4e397018b7d9e13f5612f851980f51 /Bugzilla/Metrics/Reporter/ElasticSearch.pm | |
parent | f77964694b3bd7a3c4c733824614659c44057bf6 (diff) | |
download | bugzilla-80c784ce1b8805b4d1797bcc1c49bc40a7ea1946.tar.gz bugzilla-80c784ce1b8805b4d1797bcc1c49bc40a7ea1946.tar.xz |
Bug 985305: update the metrics elasticsearch reporter to bypass es node discovery
Diffstat (limited to 'Bugzilla/Metrics/Reporter/ElasticSearch.pm')
-rw-r--r-- | Bugzilla/Metrics/Reporter/ElasticSearch.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/Metrics/Reporter/ElasticSearch.pm b/Bugzilla/Metrics/Reporter/ElasticSearch.pm index 4b424b5da..1bab2502c 100644 --- a/Bugzilla/Metrics/Reporter/ElasticSearch.pm +++ b/Bugzilla/Metrics/Reporter/ElasticSearch.pm @@ -79,10 +79,18 @@ sub report { # throw at ES require ElasticSearch; - ElasticSearch->new( + my $es = ElasticSearch->new( servers => Bugzilla->params->{metrics_elasticsearch_server}, transport => 'http', - )->index( + ); + # the ElasticSearch module queries the server for a list of nodes and + # connects directly to a random node. that bypasses our load balancer so we + # disable that by setting the server list directly. + $es->transport->servers(Bugzilla->params->{metrics_elasticsearch_server}); + # as the discovered node list is lazy-loaded, increase _refresh_in so it + # won't call ->refresh_servers() + $es->transport->{_refresh_in} = 1; + $es->index( index => Bugzilla->params->{metrics_elasticsearch_index}, type => Bugzilla->params->{metrics_elasticsearch_type}, ttl => Bugzilla->params->{metrics_elasticsearch_ttl}, |