Skip to content

Commit

Permalink
New templating format for resources()
Browse files Browse the repository at this point in the history
  • Loading branch information
sileht committed Dec 8, 2017
1 parent 1141039 commit 25be557
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 1,055 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 1.6.1

* Allow to have different attributes for templating
(e.g: a dropdown with "$host - $flavor", while template service will use "id")

Version 1.6.0

* Add support fore Dynamic Aggregation
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Name | Description
| ------- | --------|
`metrics(resource_id)` | Returns a list of metrics available for the resource identified by ‘resource_id’
`resources(resource_type, `attribute`, query)` | Returns a list of resource `attribute` matching `query`.
`resources(resource_type, `attribute1`, `attribute2`, query)` | Returns a list of resource `attribute` matching `query`, `attribute1` is diplayed in selector, `attribute1` used for templating.

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_templating.png)

Expand Down
43 changes: 13 additions & 30 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Gnocchi datasource for Grafana 3 and 4

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/collectd-dashboard.png)

## Installation via grafana.net

$ sudo grafana-cli plugins install gnocchixyz-gnocchi-datasource
Expand Down Expand Up @@ -39,34 +41,16 @@ This works only if Access = Direct, and CORS is properly configured on Keystone

Open a graph in edit mode by click the title.

The editor have 4 modes to retreives metrics, you can change the mode by clicking of the pencil on the right.

* Measurements of a metric:
Create one graph with datapoint of the defined metric

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode1.png)

Metric ID: the id of the metric you are interrested in
The editor have 4 modes to retrieves metrics:

* Measurements of metrics of resources:
Create one graph per metric find with the query.
* Dynamic aggregates (recommended way):
Create a *query* to select all resources you need.
Create an *operation* that select metric and do math on/between them.
Set *label* to name each graph with text or with resource attributes.

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode3.png)
![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/grafana_dynamic.png)

Query: the query to search resources
Resource type: the type of the resource (generic, instance, disk, ...)
Metric name: the name of the metric
Label attribute: the label or the resource attribute to use as label.

* Aggregated measurements of a metric across resources:
Create one graph with an aggregation of all datapoints of metrics that match the query.

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode4.png)

Query: the query to search resources
Resource type: the type of the resource (generic, instance, disk, ...)
Metric name: the name of the metric
Label attribute: the label or the resource attribute to use as label.
Other mode are mainly here old Gnocchi version that doesn't support *Dynamic aggregates*

Each mode also have the aggregator method to use to get datapoints of the metrics.

Expand Down Expand Up @@ -119,6 +103,7 @@ Name | Description
| ------- | --------|
`metrics(resource_id)` | Returns a list of metrics available for the resource identified by ‘resource_id’
`resources(resource_type, `attribute`, query)` | Returns a list of resource `attribute` matching `query`.
`resources(resource_type, `attribute1`, `attribute2`, query)` | Returns a list of resource `attribute` matching `query`, `attribute1` is diplayed in selector, `attribute1` used for templating.

![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_templating.png)

Expand All @@ -130,12 +115,10 @@ For details of `Query` format, please refer to the Gnocchi and Gnocchi client do
## Current Limitation

Grafana doesn’t allow to query two different servers when using the proxy mode,
so we are not able to query Keystone for a token and then query gnocchi.

In proxymode, we need to set a token and the Gnocchi URL on the datasource.
so we are not able to query Keystone for a token and then query Gnocchi (Except if
Gnocchi and Keystone live into the same HTTP host).

In direct mode, we can use login/password and the Keystone URL.
Note that CORS MUST be enabled on Keystone and Gnocchi servers.
In direct mode, CORS MUST be enabled on Keystone and Gnocchi servers.

## License

Expand Down
57 changes: 43 additions & 14 deletions dist/datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datasource.js.map

Large diffs are not rendered by default.

Binary file added dist/docs/collectd-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 25be557

Please sign in to comment.