Skip to content

Commit

Permalink
New branching - release
Browse files Browse the repository at this point in the history
Note: this commit should never be reported to master
  • Loading branch information
jotak committed Oct 17, 2016
1 parent 08be0d8 commit 4e4c649
Show file tree
Hide file tree
Showing 39 changed files with 1,923 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
node_modules
npm-debug.log

dist/

.idea/
*.iml

78 changes: 78 additions & 0 deletions dist/README.adoc
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
----
40 changes: 40 additions & 0 deletions dist/capabilities.js

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

1 change: 1 addition & 0 deletions dist/capabilities.js.map

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

3 changes: 3 additions & 0 deletions dist/css/query-editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.generic-datasource-query-row .query-keyword {
width: 75px;
}
226 changes: 226 additions & 0 deletions dist/datasource.js

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

Loading

0 comments on commit 4e4c649

Please sign in to comment.