Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

proxy /functions to graphite #815

Merged
merged 1 commit into from
Jan 10, 2018
Merged

proxy /functions to graphite #815

merged 1 commit into from
Jan 10, 2018

Conversation

replay
Copy link
Contributor

@replay replay commented Jan 10, 2018

This simply proxies calls to /functions(.*) to graphite. The latest version of graphite-mt already supports that.

Works in dev & QA

call to /functions:

root@hosted-metrics-api-2954441641-084f6:/# curl -s -H 'X-Org-Id: 1' 'http://mt-read-1-small-raintank:6060/functions' | jq '.' | more                                                                                                                                     
{
  "cumulative": {
    "function": "cumulative(seriesList)",
    "group": "Special",
    "name": "cumulative",
    "module": "graphite.render.functions",
    "params": [
      {
        "required": true,
        "type": "seriesList",
        "name": "seriesList"
      }
    ],
    "description": "Takes one metric or a wildcard seriesList.\n\nWhen a graph is drawn where width of the graph size in pixels is smaller than\nthe number of datapoints to be graphed, Graphite consolidates the values to\nto prevent line overlap. The cumulative() f$
nction changes the consolidation\nfunction from the default of 'average' to 'sum'. This is especially useful in\nsales graphs, where fractional values make no sense and a 'sum' of consolidated\nvalues is appropriate.\n\nAlias for :func:`consolidateBy(series, 'sum') 
<graphite.render.functions.consolidateBy>`\n\n.. code-block:: none\n\n  &target=cumulative(Sales.widgets.largeBlue)"
  },

call to /functions/cumulative

root@hosted-metrics-api-2954441641-084f6:/# curl -s -H 'X-Org-Id: 1' 'http://mt-read-1-small-raintank:6060/functions/cumulative' | jq '.' | more
{
  "function": "cumulative(seriesList)",
  "group": "Special",
  "name": "cumulative",
  "module": "graphite.render.functions",
  "params": [
    {
      "required": true,
      "type": "seriesList",
      "name": "seriesList"
    }
  ],
  "description": "Takes one metric or a wildcard seriesList.\n\nWhen a graph is drawn where width of the graph size in pixels is smaller than\nthe number of datapoints to be graphed, Graphite consolidates the values to\nto prevent line overlap. The cumulative() func
tion changes the consolidation\nfunction from the default of 'average' to 'sum'. This is especially useful in\nsales graphs, where fractional values make no sense and a 'sum' of consolidated\nvalues is appropriate.\n\nAlias for :func:`consolidateBy(series, 'sum') <g
raphite.render.functions.consolidateBy>`\n\n.. code-block:: none\n\n  &target=cumulative(Sales.widgets.largeBlue)"
}

fixes #794

Copy link
Member

@woodsaj woodsaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dieterbe Dieterbe merged commit ef5ff15 into master Jan 10, 2018
@Dieterbe Dieterbe deleted the functions_call branch September 18, 2018 08:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support /functions requests
3 participants