Skip to content

Commit

Permalink
Merge pull request #7 from circonus-labs/native_apis_no_graphite
Browse files Browse the repository at this point in the history
Version 0.9.0
  • Loading branch information
cody271 authored May 16, 2019
2 parents a222e3b + 2010c04 commit 5ddfe6e
Show file tree
Hide file tree
Showing 29 changed files with 1,912 additions and 531 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
npm-debug.log
.DS_Store
*.swp
package-lock.json
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ The Account ID associated with the account to pull metrics from. For standalone
### API Token
The API Token associated with the account to pull metrics from. This can be found on your API Tokens page after logging in at [https://www.circonus.com/](https://www.circonus.com/) in the "User Profile" section.

### Query Prefix
Prefix to be added to all queries sent to IRONdb.
* For standalone installations, this defaults to "**graphite.**".
* For hosted installations, this defaults to "**reconnoiter.**".

## Usage

1. Create a new panel and set the datasource to name selected in the IRONdb datasource configuration.

### Normal Queries
For normal queries, use the metric browser to navigate the metric hierarchy of your IRONdb instance or type queries manually using the *Toggle Edit Mode* menu item to the right. The query prefix configured for the selected datasource is prepended to all queries against the IRONdb instance.
For normal queries, use the metric browser to navigate the metric hierarchy of your IRONdb instance or type queries manually using the *Toggle Edit Mode* menu item to the right.
![](img/irondb-graph-metric-browser.png)

### CAQL Queries
Expand All @@ -69,6 +64,32 @@ For this processed data to be displayed on the heatmap panel as the sample above

![](img/irondb-heatmap-tsbuckets.png)

### Template Variables

**How to configure a template variable for IRONdb**

1. From a dashboard, click `Settings` in the top right.

1. On the left hand side, select the `Variables` section.

1. Click `+New` and choose a name for your new variable.

1. Select the proper data source: `IRONdb`.

1. Under `Query`, enter the metric you wish to use in this variable (without tags).

1. Enable `Include All Option` and enter `*` for `Custom all value`.

1. Click `Enabled` under `Value groups/tags` to enable tags support.

1. Enter the tag category you wish to use in your variable under `Tag values query`.

1. If you successfully completed the prior steps, `Preview of values` should now auto-complete the tag values.

1. Finish setup by clicking `Add` and then `Save`.

Your new template variable should now appear in the query builder!

# Development

The build process requires node, npm, typescrypt, and tslint
Expand Down
35 changes: 28 additions & 7 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Read more about IRONdb here:
* The default location for the plugins directory is `/var/lib/grafana/plugins`, though the location may be different in your installation, see [http://docs.grafana.org/plugins/installation/](http://docs.grafana.org/plugins/installation/) for more plugin information.

### From Releases
1. Download [https://github.com/circonus-labs/circonus-irondb-datasource/archive/v0.8.6.tar.gz](https://github.com/circonus-labs/circonus-irondb-datasource/archive/v0.8.6.tar.gz)
1. Download the desired [release version](https://github.com/circonus-labs/circonus-irondb-datasource/releases).

2. Unzip into plugins directory.

Expand Down Expand Up @@ -38,17 +38,12 @@ The Account ID associated with the account to pull metrics from. For standalone
### API Token
The API Token associated with the account to pull metrics from. This can be found on your API Tokens page after logging in at [https://www.circonus.com/](https://www.circonus.com/) in the "User Profile" section.

### Query Prefix
Prefix to be added to all queries sent to IRONdb.
* For standalone installations, this defaults to "**graphite.**".
* For hosted installations, this defaults to "**reconnoiter.**".

## Usage

1. Create a new panel and set the datasource to name selected in the IRONdb datasource configuration.

### Normal Queries
For normal queries, use the metric browser to navigate the metric hierarchy of your IRONdb instance or type queries manually using the *Toggle Edit Mode* menu item to the right. The query prefix configured for the selected datasource is prepended to all queries against the IRONdb instance.
For normal queries, use the metric browser to navigate the metric hierarchy of your IRONdb instance or type queries manually using the *Toggle Edit Mode* menu item to the right.
![](img/irondb-graph-metric-browser.png)

### CAQL Queries
Expand All @@ -69,6 +64,32 @@ For this processed data to be displayed on the heatmap panel as the sample above

![](img/irondb-heatmap-tsbuckets.png)

### Template Variables

**How to configure a template variable for IRONdb**

1. From a dashboard, click `Settings` in the top right.

1. On the left hand side, select the `Variables` section.

1. Click `+New` and choose a name for your new variable.

1. Select the proper data source: `IRONdb`.

1. Under `Query`, enter the metric you wish to use in this variable (without tags).

1. Enable `Include All Option` and enter `*` for `Custom all value`.

1. Click `Enabled` under `Value groups/tags` to enable tags support.

1. Enter the tag category you wish to use in your variable under `Tag values query`.

1. If you successfully completed the prior steps, `Preview of values` should now auto-complete the tag values.

1. Finish setup by clicking `Add` and then `Save`.

Your new template variable should now appear in the query builder!

# Development

The build process requires node, npm, typescrypt, and tslint
Expand Down
1 change: 1 addition & 0 deletions dist/config_ctrl.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/config_ctrl.js.map

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

1 change: 1 addition & 0 deletions dist/config_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class IrondbConfigCtrl {
} else if ('hosted' == this.current.jsonData.irondbType) {
this.current.jsonData.queryPrefix = this.current.jsonData.queryPrefix || 'reconnoiter.';
}
this.current.jsonData.resultsLimit = this.current.jsonData.resultsLimit || '100';
}

updateDefaultQueryPrefix() {
Expand Down
75 changes: 75 additions & 0 deletions dist/css/query_editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,78 @@
.gf-form-select-wrapper--caret-indent.gf-form-select-wrapper::after {
right: 0.775rem
}

.join-r .gf-form-label {
margin-right: 0;
}
.join-l .gf-form-label {
border-left-width: 0;
border-radius: 0;
}
.mash-r .gf-form-label {
padding-right: 0;
}
.mash-l .gf-form-label {
padding-left: 0;
}
.mash-r.half .gf-form-label {
padding-right: 4px;
}
.mash-l.half .gf-form-label {
padding-left: 4px;
}
.irondb-tag-op .gf-form-label,
.irondb-tag-end .gf-form-label {
color: #eb7b18;
}
.irondb-tag-cat .gf-form-label {
color: #598;
}
.irondb-tag-val .gf-form-label {
color: #5ca;
}
.irondb-tag-pair .gf-form-label,
.irondb-tag-sep .gf-form-label {
color: #888;
}
.irondb-tag-cat .gf-form-label:focus,
.irondb-tag-cat .gf-form-label:hover,
.irondb-tag-val .gf-form-label:focus,
.irondb-tag-val .gf-form-label:hover {
color: #fff;
}

/* menu item color changes */

.irondb-tag-op .typeahead.dropdown-menu [data-value="REMOVE"] a {
color: #bb002c !important;
}
.irondb-tag-val .typeahead.dropdown-menu [data-value^="$"] a {
color: #33b5e5 !important;
}
.irondb-tag-op .typeahead.dropdown-menu [data-value="or("] a,
.irondb-tag-op .typeahead.dropdown-menu [data-value="not("] a,
.irondb-tag-op .typeahead.dropdown-menu [data-value="and("] a,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="or("] a,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="not("] a,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="and("] a {
color: #eb7b18 !important;
}
.irondb-tag-op .typeahead.dropdown-menu [data-value="REMOVE"] a:focus,
.irondb-tag-op .typeahead.dropdown-menu [data-value="REMOVE"] a:hover,
.irondb-tag-val .typeahead.dropdown-menu [data-value^="$"] a:focus,
.irondb-tag-val .typeahead.dropdown-menu [data-value^="$"] a:hover,
.irondb-tag-op .typeahead.dropdown-menu [data-value="or("] a:focus,
.irondb-tag-op .typeahead.dropdown-menu [data-value="or("] a:hover,
.irondb-tag-op .typeahead.dropdown-menu [data-value="not("] a:focus,
.irondb-tag-op .typeahead.dropdown-menu [data-value="not("] a:hover,
.irondb-tag-op .typeahead.dropdown-menu [data-value="and("] a:focus,
.irondb-tag-op .typeahead.dropdown-menu [data-value="and("] a:hover,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="or("] a:focus,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="or("] a:hover,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="not("] a:focus,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="not("] a:hover,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="and("] a:focus,
.irondb-tag-plus .typeahead.dropdown-menu [data-value="and("] a:hover {
color: #fff !important;
}
9 changes: 6 additions & 3 deletions dist/datasource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class IrondbDatasource {
type: string;
accountId: number;
irondbType: string;
queryPrefix: string;
resultsLimit: string;
url: any;
apiToken: string;
appName: string;
Expand All @@ -20,14 +20,17 @@ export default class IrondbDatasource {
constructor(instanceSettings: any, $q: any, backendSrv: any, templateSrv: any);
query(options: any): any;
annotationQuery(options: any): void;
metricFindQuery(query: string): any;
metricFindQuery(query: string, options: any): any;
metricTagsQuery(query: string): any;
metricTagCatsQuery(query: string): any;
metricTagValsQuery(query: string, cat: string): any;
testDatasource(): any;
_throwerr(err: any): void;
_irondbSimpleRequest(method: any, url: any, isCaql?: boolean, isFind?: boolean): any;
_irondbRequest(irondbOptions: any, isCaql?: boolean): Promise<{}>;
_buildIrondbParamsAsync(options: any): {};
_buildIrondbParams(options: any): Promise<{}>;
_convertIrondbDataToGrafana(result: any): {
_convertIrondbDataToGrafana(result: any, query: any): {
data: any[];
};
_convertIrondbCaqlDataToGrafana(result: any, query: any): {
Expand Down
Loading

0 comments on commit 5ddfe6e

Please sign in to comment.