Skip to content

Commit

Permalink
Update for version 20200828-grafana6
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Ferrero committed Aug 28, 2020
1 parent 3295d3c commit ec0c7ac
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 34 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,51 @@
# KairosDB enhanced Grafana data source plugin

Description
===========

This plugin gives access to a new data source called `KairosDB`.
## Description

This plugin gives front-end access to `KairosDB` data source within Grafana.

Unlike the original plugin it has dynamic generation of query UI depending on the actual features available on the KairosDB server, such as group-by and aggregators, using the KairosDB `features` API.


* Automatically proposes all features available on server
* Entirely interactive query construction
* Query construction UI is self documented (using mouse over)
* Supports modifications of the features for existing queries
* Include validation rules provided by the features API

It allows you to build queries for `KairosDB` in a very intuitive way.

It allows you to build queries for `KairosDB`.
A query is the operation that fetches data from the database, executes some processing (aggregation,..), and returns the result in the form of time series.

For more information about queries and Grafana please refer to the official Grafana documentation.
For more information about queries and Grafana please refer to the official Grafana and KairosDB documentation.

This code and binaries are provided as-is, with no warranty whatsoever, but you can reuse the source code, the license is permissive :-)

## Installation

This plugin needs to be extracted to the Grafana plugins directory.
It cannot be installed through Grafana CLI.


## Plugin releases mechanism

Each release version is identified by the **version of Grafana** the plugin supports, followed by **the date** at which it has been generated.

It is important to mention that the open source version of this plugin is automatically generated by C/I scripts.

Issues and pull requests are welcome but will not be merged directly since this repository is a build artifact.

We are welcoming comments, issues and even pull requests, even if pull requests cannot be merged directly.


## Why is this repository a build artifact?

Because we have built an extensive data processing plugin on top of KairosDB... Our software adds capabilities that would not work with a core KairosDB instance.

Then developped a better plugin for our own software features from Grafana... And we really like the results, so we wanted to share this new plugin with the community, but without having to maintain two codebases.

Therefore, this repository is automatically generated in C/I by removing specific features from our plugin and providing access to core KairosDB features.

We hope you appreciate this work and we will share changes and new capabilities in the near future.

2 changes: 1 addition & 1 deletion src/directives/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ export function FeatureDirective() {
template: "=",
feature: "="
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/feature.html",
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/feature.html",
};
}
2 changes: 1 addition & 1 deletion src/directives/feature_component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export function FeatureComponentDirective() {
onEdit: "&",
onRemove: "&",
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/feature.component.html",
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/feature.component.html",
};
}
2 changes: 1 addition & 1 deletion src/directives/feature_component_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export function FeatureComponentEditorDirective() {
scope: {
component: "="
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/feature.component.editor.html",
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/feature.component.editor.html",
};
}
2 changes: 1 addition & 1 deletion src/directives/metric_name_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ export function MetricNameFieldDirective() {
metricNames: "=",
value: "="
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/metric.name.field.html"
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.name.field.html"
};
}
2 changes: 1 addition & 1 deletion src/directives/tag_input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export function TagInputDirective() {
segment: "=",
tagValues: "=",
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/tag.input.html"
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/tag.input.html"
};
}
2 changes: 1 addition & 1 deletion src/directives/tags_select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export function TagsSelectDirective() {
tagName: "=",
tagValues: "="
},
templateUrl: "public/plugins/grafana-kairosdb-datasource/partials/tags.select.html"
templateUrl: "public/plugins/grafana-kairosdb-enhanced-datasource/partials/tags.select.html"
};
}
10 changes: 5 additions & 5 deletions src/partials/annotations.editor.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="gf-form-query gf-form-group" ng-if="ctrl.datasource.initialized">
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/metric.name.row.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/tags.editor.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/metric.time.override.html'"
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.name.row.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/tags.editor.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.time.override.html'"
ng-if="ctrl.datasource.type === 'grafana-skyminer-datasource'"></ng-include>
<kairosdb-feature ng-if="ctrl.showFeatures()"
<kairosdb-enhanced-feature ng-if="ctrl.showFeatures()"
ng-repeat="feature in ctrl.features track by $index"
template="feature"
feature="ctrl.target.query.features[$index]"
variables="ctrl.templateVariables"
></kairosdb-feature>
></kairosdb-enhanced-feature>
</div>
2 changes: 1 addition & 1 deletion src/partials/feature.component.editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
</bootstrap-tagsinput>
</div>

<kairosdb-feature-component-editor class="gf-form-inline" component="parameter" ng-switch-when="object"></kairosdb-feature-component-editor>
<kairosdb-enhanced-feature-component-editor class="gf-form-inline" component="parameter" ng-switch-when="object"></kairosdb-enhanced-feature-component-editor>
</div>
2 changes: 1 addition & 1 deletion src/partials/feature.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</label>
</div>
<ng-include class="gf-form" ng-switch="parameter.type" ng-repeat="parameter in ctrl.component.parameters track by $index"
src="'public/plugins/grafana-kairosdb-datasource/partials/feature.component.parameter.html'"></ng-include>
src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/feature.component.parameter.html'"></ng-include>
<div class="gf-form">
<label class="gf-form-label">
<a ng-click="ctrl.onEdit(ctrl.component)">
Expand Down
2 changes: 1 addition & 1 deletion src/partials/feature.component.parameter.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="gf-form" ng-switch-when="object">
<ng-include ng-switch="parameter.type" ng-repeat="parameter in parameter.parameters track by $index" src="'public/plugins/grafana-kairosdb-datasource/partials/feature.component.parameter.html'"></ng-include>
<ng-include ng-switch="parameter.type" ng-repeat="parameter in parameter.parameters track by $index" src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/feature.component.parameter.html'"></ng-include>
</div>
<div class="gf-form-label" ng-switch-when="bool" ng-show="parameter.value">{{parameter._label.toLowerCase()}}</div>
<div class="gf-form-label" ng-switch-when="enum">{{parameter._label.toLowerCase()}}: {{parameter.value.toLowerCase()}}</div>
Expand Down
6 changes: 3 additions & 3 deletions src/partials/feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<gf-form-switch class="gf-form" label="Show optional parameters" checked="ctrl.showOptional"></gf-form-switch>
</div>
<div class="separator"></div>
<kairosdb-feature-component-editor class="gf-form-inline" component="pickedComponent"></kairosdb-feature-component-editor>
<kairosdb-enhanced-feature-component-editor class="gf-form-inline" component="pickedComponent"></kairosdb-enhanced-feature-component-editor>
<div class="separator"></div>
<div class="gf-form" ng-if="pickedComponent">
<label class="gf-form-label">
Expand All @@ -41,11 +41,11 @@
</div>
</div>
<!-- List of all component -->
<kairosdb-feature-component class="gf-form-inline"
<kairosdb-enhanced-feature-component class="gf-form-inline"
ng-repeat="component in ctrl.feature.components track by $index"
component="component"
on-remove="ctrl.remove(component)"
on-edit="ctrl.edit(component)"
on-move-up="ctrl.moveUp(component)"
on-move-down="ctrl.moveDown(component)"></kairosdb-feature-component>
on-move-down="ctrl.moveDown(component)"></kairosdb-enhanced-feature-component>
</div>
2 changes: 1 addition & 1 deletion src/partials/filters.editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<input ng-if="filter.showInput"
class="gf-form-input" type="text"
placeholder="Enter a tag name"
kairosdb-custom-autofocus
kairosdb-enhanced-custom-autofocus
ng-keypress="ctrl.onKeyPressFilter($event, filterIndex)"
ng-blur="ctrl.onFocusOutFilterInput(filterIndex)"
ng-model="filter.name"/>
Expand Down
2 changes: 1 addition & 1 deletion src/partials/metric.name.row.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
</div>

<kairosdb-metric-name-field value="ctrl.target.query.metricName" alias="ctrl.target.query.alias" metric-names="ctrl.datasource.metricNamesStore.metricNames"></kairosdb-metric-name-field>
<kairosdb-enhanced-metric-name-field value="ctrl.target.query.metricName" alias="ctrl.target.query.alias" metric-names="ctrl.datasource.metricNamesStore.metricNames"></kairosdb-enhanced-metric-name-field>

<div class="gf-form">
<label class="gf-form-label" bs-tooltip="'Refresh metric names'" ng-click="ctrl.loadMetricNames()">
Expand Down
12 changes: 6 additions & 6 deletions src/partials/query.editor.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/metric.names.loading.html'" ng-if="!ctrl.datasource.initialized"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.names.loading.html'" ng-if="!ctrl.datasource.initialized"></ng-include>
<query-editor-row query-ctrl="ctrl" can-collapse="true" ng-if="ctrl.datasource.initialized">
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/metric.name.row.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/tags.editor.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/metric.time.override.html'"
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.name.row.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/tags.editor.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/metric.time.override.html'"
ng-if="ctrl.datasource.type === 'grafana-skyminer-datasource'"></ng-include>
<kairosdb-feature ng-if="ctrl.showFeatures()"
<kairosdb-enhanced-feature ng-if="ctrl.showFeatures()"
ng-repeat="feature in ctrl.features track by $index"
template="feature"
feature="ctrl.target.query.features[$index]"
variables="ctrl.templateVariables"
></kairosdb-feature>
></kairosdb-enhanced-feature>
</query-editor-row>
6 changes: 3 additions & 3 deletions src/partials/tags.editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
</div>
</div>
<!-- tags from controls -->
<kairosdb-tags-select
<kairosdb-enhanced-tags-select
ng-if="!ctrl.isMetricNameTemplateVariable"
selected-values="ctrl.target.query.tags[tagName]"
tag-name="tagName"
tag-values="tagValues"
ng-repeat="(tagName, tagValues) in ctrl.tags.tags">
</kairosdb-tags-select>
</kairosdb-enhanced-tags-select>
<!-- added filters -->
<ng-include src="'public/plugins/grafana-kairosdb-datasource/partials/filters.editor.html'"></ng-include>
<ng-include src="'public/plugins/grafana-kairosdb-enhanced-datasource/partials/filters.editor.html'"></ng-include>
</div>
2 changes: 1 addition & 1 deletion src/partials/tags.select.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="tags-container">
<div class="gf-form" ng-repeat="segment in ctrl.segments">
<kairosdb-tag-input segment="segment" tag-values="ctrl.availableValues" on-change="ctrl.onChange()"></kairosdb-tag-input>
<kairosdb-enhanced-tag-input segment="segment" tag-values="ctrl.availableValues" on-change="ctrl.onChange()"></kairosdb-enhanced-tag-input>
<div class="gf-form-label" ng-if="!$last">
<a ng-click="ctrl.remove(segment)">
<i class="fa fa-times"></i>
Expand Down

0 comments on commit ec0c7ac

Please sign in to comment.