Skip to content

Commit

Permalink
Removed unused parameter from get_metrics for indices_stats_url
Browse files Browse the repository at this point in the history
See: elastic/elasticsearch#21410

The all=true parameter is no longer supported, and causes the HTTP GET to return:

$ curl 'http://ny2-laa-005:9200/_stats?all=true'
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/_stats] contains unrecognized parameter: [all]"}],"type":"illegal_argument_exception","reason":"request [/_stats] contains unrecognized parameter: [all]"},"status":400}

This causes the es2graphite.py to throw this stack trace and continuously retry:

2016-12-12 09:31:08,006 [MainThread] [INFO    ]  2016-12-12 09:31:06: GET http://ny2-laa-005:9200/_stats?all=true
2016-12-12 09:31:08,352 [MainThread] [ERROR   ]  Traceback+%28most+recent+call+last%29%3A%0A++File+%22.%2Fes2graphite.py%22%2C+line+328%2C+in+%3Cmodule%3E%0A++++get_metrics%28%29%0A++File+%22.%2Fes2graphite.py%22%2C+line+34%2C+in+timed%0A++++result+%3D+method%28%2Aargs%2C+%2A%2Akw%29%0A++File+%22.%2Fes2graphite.py%22%2C+line+274%2C+in+get_metrics%0A++++indices_stats_data+%3D+urllib2.urlopen%28indices_stats_url%29.read%28%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+154%2C+in+urlopen%0A++++return+opener.open%28url%2C+data%2C+timeout%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+437%2C+in+open%0A++++response+%3D+meth%28req%2C+response%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+550%2C+in+http_response%0A++++%27http%27%2C+request%2C+response%2C+code%2C+msg%2C+hdrs%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+475%2C+in+error%0A++++return+self._call_chain%28%2Aargs%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+409%2C+in+_call_chain%0A++++result+%3D+func%28%2Aargs%29%0A++File+%22%2FSystem%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F2.7%2Flib%2Fpython2.7%2Furllib2.py%22%2C+line+558%2C+in+http_error_default%0A++++raise+HTTPError%28req.get_full_url%28%29%2C+code%2C+msg%2C+hdrs%2C+fp%29%0AHTTPError%3A+HTTP+Error+400%3A+Bad+Request%0A
  • Loading branch information
Aaron Sterr committed Dec 12, 2016
1 parent 642dcd3 commit ce03c9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion es2graphite.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def get_metrics():
thread_pool_metrics = process_thread_pool(args.prefix, thread_pool, cluster_health['cluster_name'])
submit_to_graphite(thread_pool_metrics)

indices_stats_url = 'http://%s/_stats?all=true' % get_es_host()
indices_stats_url = 'http://%s/_stats' % get_es_host()
if args.shard_stats:
indices_stats_url = '%s&level=shards' % indices_stats_url
elif args.health_level == 'cluster':
Expand Down

0 comments on commit ce03c9e

Please sign in to comment.