-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: this commit should never be reported to master
- Loading branch information
Showing
39 changed files
with
1,923 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
node_modules | ||
npm-debug.log | ||
|
||
dist/ | ||
|
||
.idea/ | ||
*.iml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
= Hawkular Datasource for Grafana | ||
:source-language: javascript | ||
|
||
This project is the Hawkular Datasource plugin for Grafana 3. It works with: | ||
|
||
* Metrics standalone servers as well | ||
* Hawkular servers, starting from version Alpha13 | ||
== Installing | ||
|
||
=== From source | ||
|
||
Download the source code and copy the content of `dist` to `hawkular` inside Grafana's plugin directory. | ||
|
||
[source,bash] | ||
---- | ||
# This is the default for Linux Grafana installs. Change it to match yours, if needed. | ||
GRAFANA_PLUGINS=/var/lib/grafana/plugins | ||
wget https://github.com/hawkular/hawkular-grafana-datasource/archive/master.zip -O hawkular-grafana-datasource-master.zip | ||
unzip hawkular-grafana-datasource-master.zip | ||
mkdir ${GRAFANA_PLUGINS}/hawkular | ||
cp -R hawkular-grafana-datasource-master/dist/* ${GRAFANA_PLUGINS}/hawkular | ||
---- | ||
|
||
=== From the Grafana plugin directory | ||
|
||
COMING SOON | ||
|
||
== Configuration | ||
|
||
The datasource URL must point to the Hawkular Metrics service, e.g. `http://myhost:8080/hawkular/metrics` | ||
|
||
`direct` access mode only works with standalone Metrics servers currently. If you active it, make sure to allow | ||
the Grafana server origin in Metrics' configuration. | ||
|
||
Authentication must be set when working with a Hawkular server. Check the 'Basic Auth' box and fill the user and password fields. | ||
|
||
Select the tenant. On Hawkular servers, use `hawkular`. | ||
|
||
Openshift-Metrics users must provide an authentication token. | ||
|
||
== Using Grafana Templating (variables) | ||
|
||
Grafana allows you to create dashboard templates through the definition of variables. This is link:http://docs.grafana.org/reference/templating/[documented on Grafana's site]. | ||
With the Hawkular Datasource Plugin, the variables of type _'Query'_ are mapped to the http://www.hawkular.org/docs/rest/rest-metrics.html#GET__metrics[_@get (url)/metrics_] | ||
Hawkular Metrics endpoint and can be used to retrieve tenant's metric names. Use the _Query Options_ text field to pass query parameters. | ||
[TIP] | ||
For instance, if you have metrics tagged _"type:memory"_ and others tagged _"type:cpu"_, you can write _"?tags=type:memory"_ to get only the _"memory"_ ones, or _"?tags=type:cpu|memory"_ to get them both. The leading question mark is not mandatory. | ||
|
||
There is an exception to that rule: if the query string is prefixed with _'tags/'_, the variable will contain the matching tag names rather than the metric names. In this case, the Hawkular Metrics endpoint link:++http://www.hawkular.org/docs/rest/rest-metrics.html#GET__metrics_tags__tags_++[_@get (url)/metrics/tags/{tags}_] will be used. | ||
[TIP] | ||
For instance, type _"tags/type:*"_ to get all of the available tag values for _"type"_. | ||
|
||
Once you have set some variables, you can use them in graph queries: either for row or graph duplication, or to display multiple series in a single graph from a single query. This is especially useful when metric names contain some dynamic parts and thus cannot be known in advance. | ||
|
||
== Building | ||
|
||
You need `npm` and `grunt` to build the project. Clone this repository, then from that directory run: | ||
|
||
[source,bash] | ||
---- | ||
npm install | ||
grunt | ||
---- | ||
|
||
Files are generated under the `dist` directory. | ||
|
||
To test it, copy these files to `${GRAFANA_PLUGINS}/hawkular` and restart grafana-server. | ||
|
||
== Building and running a Docker image | ||
|
||
[source,bash] | ||
---- | ||
# This will build the image | ||
docker build -t hawkular/hawkular-grafana-datasource . | ||
# This will run the image on http://localhost:3000/ | ||
docker run -i -p 3000:3000 --name hawkular-grafana-datasource --rm hawkular/hawkular-grafana-datasource | ||
---- |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.generic-datasource-query-row .query-keyword { | ||
width: 75px; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.