Skip to content

Commit

Permalink
Remove Graphite query prefix from preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
cody271 committed May 16, 2019
1 parent f341111 commit 2010c04
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 45 deletions.
7 changes: 1 addition & 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 Down
7 changes: 1 addition & 6 deletions dist/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 Down
1 change: 0 additions & 1 deletion dist/datasource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default class IrondbDatasource {
type: string;
accountId: number;
irondbType: string;
queryPrefix: string;
resultsLimit: string;
url: any;
apiToken: string;
Expand Down
5 changes: 2 additions & 3 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.

6 changes: 2 additions & 4 deletions dist/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default class IrondbDatasource {
type: string;
accountId: number;
irondbType: string;
queryPrefix: string;
resultsLimit: string;
url: any;
apiToken: string;
Expand All @@ -25,7 +24,6 @@ export default class IrondbDatasource {
this.id = instanceSettings.id;
this.accountId = (instanceSettings.jsonData || {}).accountId;
this.irondbType = (instanceSettings.jsonData || {}).irondbType;
this.queryPrefix = (instanceSettings.jsonData || {}).queryPrefix;
this.resultsLimit = (instanceSettings.jsonData || {}).resultsLimit;
this.apiToken = (instanceSettings.jsonData || {}).apiToken;
this.url = instanceSettings.url;
Expand Down Expand Up @@ -169,7 +167,7 @@ export default class IrondbDatasource {
headers['X-Snowth-Advisory-Limit'] = this.resultsLimit;
if ('standalone' == this.irondbType && !isCaql) {
if (!isFind) {
baseUrl = baseUrl + '/' + this.queryPrefix + '/series_multi';
baseUrl = baseUrl + '/series_multi';
}
}
if (isCaql && !isFind) {
Expand Down Expand Up @@ -403,7 +401,7 @@ export default class IrondbDatasource {
result[i]['leaf_data'].egress_function = target.egressoverride;
}
if ('hosted' == this.irondbType) {
cleanOptions['std']['names'].push({ leaf_name: this.queryPrefix + result[i]['name'], leaf_data: result[i]['leaf_data'] });
cleanOptions['std']['names'].push({ leaf_name: result[i]['name'], leaf_data: result[i]['leaf_data'] });
} else {
cleanOptions['std']['names'].push({ leaf_name: result[i]['metric_name'], leaf_data: result[i]['leaf_data'] });
}
Expand Down
10 changes: 0 additions & 10 deletions dist/partials/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ <h3 class="page-heading">IRONdb Details</h3>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.accountId' placeholder="enter account id"></input>
<info-popover mode="right-absolute">
<p>The Account ID associated with the account to pull metrics from. This can be found on your user profile page after logging in at <a href="https://www.circonus.com/">https://www.circonus.com/</a> in the "My Accounts" section.</p>
<p>For standalone installations, this is the account_id setting as configured in the "Graphite Listener" section of the /opt/circonus/etc/irondb.conf file.</p>
</info-popover>
</div>
<div class="gf-form" ng-show="ctrl.current.jsonData.irondbType == 'hosted'">
Expand All @@ -31,15 +30,6 @@ <h3 class="page-heading">IRONdb Details</h3>
<p>The API Token associated with the account to pull metrics from. This can be found on your API Tokens page after logging in at <a href="https://www.circonus.com/">https://www.circonus.com/</a> in the "User Profile" section.</p>
</info-popover>
</div>
<div class="gf-form">
<span class="gf-form-label width-9">Query Prefix</span>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.queryPrefix' ng-init="ctrl.current.jsonData.queryPrefix"></input>
<info-popover mode="right-absolute">
<p>Prefix to be added to all queries sent to IRONdb.</p>
<p>For standalone installations, this defaults to "<strong>graphite.</strong>".</p>
<p>For hosted installations, this defaults to "<strong>reconnoiter.</strong>".</p>
</info-popover>
</div>
<div class="gf-form">
<span class="gf-form-label width-9">Results Limit</span>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.resultsLimit' ng-init="ctrl.current.jsonData.resultsLimit"></input>
Expand Down
6 changes: 2 additions & 4 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default class IrondbDatasource {
type: string;
accountId: number;
irondbType: string;
queryPrefix: string;
resultsLimit: string;
url: any;
apiToken: string;
Expand All @@ -25,7 +24,6 @@ export default class IrondbDatasource {
this.id = instanceSettings.id;
this.accountId = (instanceSettings.jsonData || {}).accountId;
this.irondbType = (instanceSettings.jsonData || {}).irondbType;
this.queryPrefix = (instanceSettings.jsonData || {}).queryPrefix;
this.resultsLimit = (instanceSettings.jsonData || {}).resultsLimit;
this.apiToken = (instanceSettings.jsonData || {}).apiToken;
this.url = instanceSettings.url;
Expand Down Expand Up @@ -169,7 +167,7 @@ export default class IrondbDatasource {
headers['X-Snowth-Advisory-Limit'] = this.resultsLimit;
if ('standalone' == this.irondbType && !isCaql) {
if (!isFind) {
baseUrl = baseUrl + '/' + this.queryPrefix + '/series_multi';
baseUrl = baseUrl + '/series_multi';
}
}
if (isCaql && !isFind) {
Expand Down Expand Up @@ -403,7 +401,7 @@ export default class IrondbDatasource {
result[i]['leaf_data'].egress_function = target.egressoverride;
}
if ('hosted' == this.irondbType) {
cleanOptions['std']['names'].push({ leaf_name: this.queryPrefix + result[i]['name'], leaf_data: result[i]['leaf_data'] });
cleanOptions['std']['names'].push({ leaf_name: result[i]['name'], leaf_data: result[i]['leaf_data'] });
} else {
cleanOptions['std']['names'].push({ leaf_name: result[i]['metric_name'], leaf_data: result[i]['leaf_data'] });
}
Expand Down
10 changes: 0 additions & 10 deletions src/partials/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ <h3 class="page-heading">IRONdb Details</h3>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.accountId' placeholder="enter account id"></input>
<info-popover mode="right-absolute">
<p>The Account ID associated with the account to pull metrics from. This can be found on your user profile page after logging in at <a href="https://www.circonus.com/">https://www.circonus.com/</a> in the "My Accounts" section.</p>
<p>For standalone installations, this is the account_id setting as configured in the "Graphite Listener" section of the /opt/circonus/etc/irondb.conf file.</p>
</info-popover>
</div>
<div class="gf-form" ng-show="ctrl.current.jsonData.irondbType == 'hosted'">
Expand All @@ -31,15 +30,6 @@ <h3 class="page-heading">IRONdb Details</h3>
<p>The API Token associated with the account to pull metrics from. This can be found on your API Tokens page after logging in at <a href="https://www.circonus.com/">https://www.circonus.com/</a> in the "User Profile" section.</p>
</info-popover>
</div>
<div class="gf-form">
<span class="gf-form-label width-9">Query Prefix</span>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.queryPrefix' ng-init="ctrl.current.jsonData.queryPrefix"></input>
<info-popover mode="right-absolute">
<p>Prefix to be added to all queries sent to IRONdb.</p>
<p>For standalone installations, this defaults to "<strong>graphite.</strong>".</p>
<p>For hosted installations, this defaults to "<strong>reconnoiter.</strong>".</p>
</info-popover>
</div>
<div class="gf-form">
<span class="gf-form-label width-9">Results Limit</span>
<input class="gf-form-input width-30" type="text" ng-model='ctrl.current.jsonData.resultsLimit' ng-init="ctrl.current.jsonData.resultsLimit"></input>
Expand Down

0 comments on commit 2010c04

Please sign in to comment.