Hosted Graphite Docs
Get StartedBook a Demo
  • Welcome to Hosted Graphite
  • Getting Started
  • HG-CLI
  • Sending Metrics
    • Supported Protocols
    • Graphite Tag Support
    • Metric Management
    • Metric APIs
  • Language Guide
    • Metric Libraries
    • .NET
    • Go
    • Java
    • Javascript
    • Node.js
    • PHP
    • Postman
    • Python 2.x
    • Python 3.x
    • Python Pickle
    • Ruby
    • Shell
    • TypeScript
  • Dashboard and Graphs
    • Primary Dashboards
    • Dashboard Library
    • Local Dashboard Integration
    • Worldmap Panel
    • Graphite Dashboard Guide
    • Graphite Graph Menu Reference
    • Other Dashboard Options
  • Alerting Guide
    • Alerting Overview
    • Alerts API
    • Notification Channels API
    • Scheduled Mutes API
    • Using Your Own Alerting
  • Agents Guide
    • The Hosted Graphite Agent
      • Base Metrics
      • System Layout
    • Telegraf
    • K8 Telegraf Daemon
    • OpenTelemetry
    • collectd Agent
    • StatsD Agent
    • Diamond
  • Add-Ons and Integrations Guide
    • AWS CloudWatch
    • Azure Monitor Metrics
    • GCP Metrics
    • Carbon-C-Relay
    • Circle CI
    • Cloudbees
    • Collectd Add Ons
    • GitHub
    • GitLab
    • Heroku
    • Hosted StatsD
    • New Relic
    • Papertrail
    • Pingdom
    • Sentry
    • Sitespeed
    • StatsD Add-on
    • Statuspage
  • Account Management
    • Access Keys
    • Account Diagnostics
    • Account Settings
    • Team Access: Limited Access Groups
    • SAML Authentication
    • Team Access
  • Additional Features
    • Aggregation Rules
    • Data Views
  • API Guides
    • Metrics API
    • Tag API
    • Graphite Render API
    • Render Variables API
    • Dashboard API
    • Annotations and Events API
    • Aggregation Rules API
    • Alerts APIs
  • FAQ
    • General
    • Business
    • Technical
    • Account Metrics and Limiting
    • Customization
    • Troubleshooting
    • Support
    • Changelog
Powered by GitBook
On this page
  • Creating a variable
  • Create a variable
  • Updating a variable
  • Update a variable
  • Search variables
  • Search Variables
  • Get variable values
  • Get variable values
  • Delete a variable
  • Delete a variable
  • Graphing with render variables

Was this helpful?

  1. API Guides

Render Variables API

PreviousGraphite Render APINextDashboard API

Last updated 1 year ago

Was this helpful?

Contents

Render Variables provide versatility when constructing metric queries. Instead of hard-coding full metric names, use variables as placeholders to dynamically build your queries. This is similar, but not the same as the primary dashboard’s built-in template variables.

NOTE: we advise against using render variables in alert queries.

Create a variable

POST /v1/variables/<var-name>/

Replace <var-name> with the name you want to give the variable. Place your variable values in a JSON file and include it in the POST request. A variable name is required, however the values can be empty.

Example variable values:

{
  "values": [
    "foobar",
    "foo",
    "bar",
    "baz"
  ]
}

Curl example:

curl -X POST "https://YOUR-API-KEY@api.hostedgraphite.com/v1/variables/<var-name>/" -d @values.json

Make sure to include the forward slash character at the end of the request.


Update a variable

PUT /v1/variables/<var-name>/

Overwrites the values for an existing variable

Curl example:

curl -X PUT "https://<apikey>@api.hostedgraphite.com/v1/variables/<var-name>/" -d @values.json

Search Variables

GET /v1/variables/?query=

A “contains” query that will return a JSON object with the name and path of variables that contain the search term. To list all variables, leave the query empty.

Path Parameters

Name
Type
Description

query

String

Curl example:

curl -X GET "https://<apikey>@api.hostedgraphite.com/v1/variables/?query="

If you have no variables or there are no variables that match your query you will be returned with an empty object:

{
  "variables": []
}

Get variable values

GET /v1/variables/<var-name>/

Returns a JSON object with the values assigned to <var-name>

Curl example:

curl -X GET "https://<apikey>@api.hostedgraphite.com/v1/variables/<var-name>/"

Delete a variable

DELETE /v1/variables/<var-name>/

Curl example:

curl -X DELETE "https://<apikey>@api.hostedgraphite.com/v1/variables/<var-name>/"

This cannot be done with the simple query builder, you must toggle the edit mode to the free-text mode.

Refer to a render variable by including the variable name enclosed in angled brackets in your metric query: <variable-name>

Using dashboard templates within render variables

You can place template variables within render variables by surrounding them with curly brackets:

$foo.<{$foo}_metric>.bar

Render Variables API
Creating a variable
Updating a variable
Search variables
Get variable values
Delete a variable
Graphing with render variables
Creating a variable
Updating a variable
Search variables
Get variable values
Delete a variable
Graphing with render variables