← Back to team overview

graphite-dev team mailing list archive

Re: [Question #136947]: API for getting metrics?

 

Question #136947 on Graphite changed:
https://answers.launchpad.net/graphite/+question/136947

    Status: Open => Answered

chrismd proposed the following answer:
Yes, /metrics/find/ is the way to go but unfortunately it is not
documented. I would also say that it is not guaranteed to be stable, but
to be perfectly honest it isn't terribly likely to change very soon, and
when it does it will most likely be in the form of a cleanup rather than
a huge overhaul. When I do get around to cleaning it up I will make sure
to document the API and include it in release notes. For now this is how
you can use it:

A 'query' query-string parameter is required and should be a metric
pattern like "*" to list all root-level nodes, "foo.*" to list all nodes
under foo, etc. Another parameter you may want to specify is 'format'
which can have a value of 'treejson', 'completer', or 'pickle'. The
first 2 formats are specifically for use with ExtJS widgets (TreePanel
and ComboBox respectively) whereas the 'pickle' format is most useful
for a Python script. If you have a graphite cluster you can specify a
'local' parameter also. Setting 'local' to '1' will cause the results to
only contain data local to the machine that handles the request whereas
if 'local' is '0' or omitted the default behavior is to distribute the
query to cluster members and return a combined result of the data that
exists on all machines.

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.