Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

* Changed the plugin to take an interval for a sampling aggregator ra… #78

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ab5d0f5
* Changed the plugin to take an interval for a sampling aggregator ra…
Nov 13, 2018
40ab07b
Added skeleton for backend plugin
May 30, 2019
092b71f
Fixed logging
May 30, 2019
b667e4d
Added simple metric request
May 31, 2019
10adc32
Parsed Remote datasource response
May 31, 2019
22d1938
Added Response structs
May 31, 2019
c770b29
Created DatasourceRequest models
May 31, 2019
102a740
Added support for aggregators
May 31, 2019
5e2051c
Refactored backend datasource
Jul 31, 2019
27b8709
Added datasource unit tests
Aug 1, 2019
83a1c43
Updated to use pointers in structs consistently
Aug 1, 2019
75eb21d
Added datasource parseQuery unit test
Aug 1, 2019
8d45bb0
Supported parsing of group by tag params
Aug 1, 2019
706010a
Added support for parsing of results with multiple series
Aug 1, 2019
f965460
Added serialization tests for KairosDB requests/responses
Aug 2, 2019
ec8ff29
Added serialization tests for Grafana panel requests
Aug 2, 2019
d3546e2
Added support for tags in backend queries
Aug 9, 2019
d1552eb
Improved error messaging
Aug 12, 2019
9b49364
Updated to parse error messages returned from KairosDB
Aug 12, 2019
4940aed
Added backend support for setting aggregator alignment
Aug 12, 2019
a8b765f
Updated datasource to inject http client
Aug 28, 2019
192ffaa
Created kairos.Client
Sep 3, 2019
0643fca
Handled error status codes in kairos.Client
Sep 3, 2019
22df841
Updated datasource#Query to set query refID in response
Sep 4, 2019
a514dbf
Resolved issue parsing Aggregators without alignment or sampling params
Sep 9, 2019
72681da
Merge remote-tracking branch 'upstream/master'
Oct 3, 2019
413b985
Updated to handle aggregator duration param as single string param
Oct 4, 2019
64be0f6
Fixed failing unit test
Oct 8, 2019
f086e0d
Moved all unit tests to target package
Oct 8, 2019
ec97277
Moved KairosDB client to remote package
Oct 8, 2019
2726fbb
Consolidated datasource code into datasource package
Oct 8, 2019
9f271a1
Updated build files for backend plugin
Oct 8, 2019
30c9c5b
Fixed rate and sampler aggregator parameters
Oct 8, 2019
d0b35b7
Modularized Aggregator parsing logic
Oct 9, 2019
26f9d24
Created MetricQueryConverter to handle metric query conversion logic
Oct 9, 2019
b4ba64c
Created GroupByConverter
Oct 9, 2019
753e145
Moved all converters to separate file
Oct 9, 2019
008c033
Injected ParameterConverters into AggregatorConverter
Oct 10, 2019
43c685d
Updated unit tests to use gomock
Oct 10, 2019
135a3d8
Renamed datasource to KairosDBDatasource
Oct 10, 2019
91e0501
Updated converter error handling
Oct 10, 2019
af45f6a
Adjust visibility of struct fields
Oct 11, 2019
e8b3eb4
Created logging package to manage loggers
Oct 14, 2019
81be079
Moved mocks to internal package
Oct 15, 2019
73e6162
Simplified GroupByConverter and added unit test
Oct 15, 2019
dc8e22f
Updated package names to reference base project
Oct 16, 2019
55e760f
Merge pull request #1 from zsabin/master
brianhks Oct 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
test-results
test-results
package-lock.json
222 changes: 222 additions & 0 deletions Gopkg.lock

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

42 changes: 42 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
branch = "master"
name = "github.com/grafana/grafana_plugin_model"

[[constraint]]
name = "github.com/hashicorp/go-hclog"
version = "0.9.2"

[[constraint]]
branch = "master"
name = "golang.org/x/net"

[prune]
go-tests = true
unused-packages = true
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: frontend backend

frontend:
grunt

backend:
go build -o ./dist/grafana-kairosdb-datasource_darwin_amd64 ./pkg

clean:
rm -r ./dist/*
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,48 @@ Starting in Grafana 3.x the KairosDB data source is no longer included out of th

But it is easy to install this plugin!

## Overview
This plugin consists of two components: a frontend and a backend

The backend plugin provides support for [alerts](https://grafana.com/docs/alerting/rules), but is not required to use the frontend portion.

## Installation
Either clone this repo into your grafana plugins directory (default /var/lib/grafana/plugins if your installing grafana with package). Then run grunt to compile typescript.
Restart grafana-server and the plugin should be automatically detected and used.
### Install to plugins directory

If you only need the frontend component you may clone the project directly into your Grafana plugin directory
(defaults to /var/lib/grafana/plugins if you're installing grafana with package).

Then simply compile the code and restart Grafana:
```
git clone https://github.com/grafana/kairosdb-datasource
cd kairosdb-datasource
npm install
grunt
make frontend
sudo service grafana-server restart
```

## Clone into a directory of your choice
### Install with Alerts
If you wish to build the backend plugin, as well, your project must be setup within a [Go workspace](https://golang.org/doc/code.html#Workspaces).

Ensure your GOPATH environment variable points to your workspace:
```
export GOPATH=$HOME/go
cd $GOPATH/src/github.com/grafana
git clone https://github.com/grafana/kairosdb-datasource
```


Then edit your grafana.ini config file (Default location is at /etc/grafana/grafana.ini) and add this:
Edit your grafana.ini config file (Default location is at /etc/grafana/grafana.ini) to include the path to your clone.
Be aware that grafana-server needs read access to the project directory.

```ini
[plugin.kairosdb]
path = /home/your/clone/dir/datasource-plugin-kairosdb
path = $GOPATH/src/github.com/grafana/kairosdb-datasource
```

Note that if you clone it into the grafana plugins directory you do not need to add the above config option. That is only
if you want to place the plugin in a directory outside the standard plugins directory. Be aware that grafana-server
needs read access to the directory.
Then compile the code and restart Grafana:
```
npm install
make
sudo service grafana-server restart
```
40 changes: 31 additions & 9 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,48 @@ Starting in Grafana 3.x the KairosDB data source is no longer included out of th

But it is easy to install this plugin!

## Overview
This plugin consists of two components: a frontend and a backend

The backend plugin provides support for [alerts](https://grafana.com/docs/alerting/rules), but is not required to use the frontend portion.

## Installation
Either clone this repo into your grafana plugins directory (default /var/lib/grafana/plugins if your installing grafana with package). Then run grunt to compile typescript.
Restart grafana-server and the plugin should be automatically detected and used.
### Install to plugins directory

If you only need the frontend component you may clone the project directly into your Grafana plugin directory
(defaults to /var/lib/grafana/plugins if you're installing grafana with package).

Then simply compile the code and restart Grafana:
```
git clone https://github.com/grafana/kairosdb-datasource
cd kairosdb-datasource
npm install
grunt
make frontend
sudo service grafana-server restart
```

## Clone into a directory of your choice
### Install with Alerts
If you wish to build the backend plugin, as well, your project must be setup within a [Go workspace](https://golang.org/doc/code.html#Workspaces).

Ensure your GOPATH environment variable points to your workspace:
```
export GOPATH=$HOME/go
cd $GOPATH/src/github.com/kairosdb
git clone https://github.com/grafana/kairosdb-datasource
```


Then edit your grafana.ini config file (Default location is at /etc/grafana/grafana.ini) and add this:
Edit your grafana.ini config file (Default location is at /etc/grafana/grafana.ini) to include the path to your clone.
Be aware that grafana-server needs read access to the project directory.

```ini
[plugin.kairosdb]
path = /home/your/clone/dir/datasource-plugin-kairosdb
path = $GOPATH/src/github.com/kairosdb/kairosdb-datasource
```

Note that if you clone it into the grafana plugins directory you do not need to add the above config option. That is only
if you want to place the plugin in a directory outside the standard plugins directory. Be aware that grafana-server
needs read access to the directory.
Then compile the code and restart Grafana:
```
npm install
make
sudo service grafana-server restart
```
Loading