2015-06-24 05:54:36 +08:00
---
page_title: KairosDB Guide
page_description: KairosDB guide for Grafana
page_keywords: grafana, kairosdb, documentation
---
# KairosDB Guide
2015-08-11 05:44:08 +08:00
Grafana v2.1 brings initial support for KairosDB Datasources. While the process of adding the datasource is similar to adding a Graphite or OpenTSDB datasource type, Kairos DB does have a few different options for building queries.
2015-06-24 05:54:36 +08:00
## Adding the data source to Grafana
2016-11-05 03:29:17 +08:00

2015-08-11 05:44:08 +08:00
2016-10-21 17:01:34 +08:00
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources` .
2015-08-11 05:44:08 +08:00
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `KairosDB` from the dropdown.
2015-06-24 05:54:36 +08:00
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of your kairosdb server (default port is usually 8080)
2016-07-02 23:27:31 +08:00
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
2015-06-24 05:54:36 +08:00
## Query editor
Open a graph in edit mode by click the title.
2016-11-05 03:29:17 +08:00

2015-06-24 05:54:36 +08:00
2015-10-22 11:58:04 +08:00
For details on KairosDB metric queries checkout the official.
2015-06-24 05:54:36 +08:00
- [Query Metrics - KairosDB 0.9.4 documentation ](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html ).
## Templated queries
KairosDB Datasource Plugin provides following functions in `Variables values query` field in Templating Editor to query `metric names` , `tag names` , and `tag values` to kairosdb server.
Name | Description
2015-08-11 05:44:08 +08:00
| ------- | --------|
`metrics(query)` | Returns a list of metric names matching `query` . If nothing is given, returns a list of all metric names.
2015-07-08 15:24:05 +08:00
`tag_names(query)` | Returns a list of tag names matching `query` . If nothing is given, returns a list of all tag names.
2015-08-11 05:44:08 +08:00
`tag_values(metric,tag)` | Returns a list of values for `tag` from the given `metric` .
2015-06-24 05:54:36 +08:00
For details of `metric names` , `tag names` , and `tag values` , please refer to the KairosDB documentations.
- [List Metric Names - KairosDB 0.9.4 documentation ](http://kairosdb.github.io/kairosdocs/restapi/ListMetricNames.html )
- [List Tag Names - KairosDB 0.9.4 documentation ](http://kairosdb.github.io/kairosdocs/restapi/ListTagNames.html )
- [List Tag Values - KairosDB 0.9.4 documentation ](http://kairosdb.github.io/kairosdocs/restapi/ListTagValues.html )
2015-10-22 11:58:04 +08:00
- [Query Metrics - KairosDB 0.9.4 documentation ](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html ).