Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #28

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ dist/
artifacts/
work/
ci/
e2e-results/

# Editor
.idea

pkg/__debug_bin

provisioning

**/.DS_Store
.eslintcache
41 changes: 19 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Contributing to QuestDB Datasource

Thank you for your interest in contributing to this repository. We are glad you want to help us to improve the project and join our community.
Feel free to [browse the open issues](https://github.com/questdb/questdb-grafana-datasource/issues).
If you want more straightforward tasks to complete, [we have some](https://github.com/questdb/grafana-questdb-datasource/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
For more details about how you can help, please take a look at [Grafana’s Contributing Guide](https://github.com/questdb/grafana-questdb-datasource/blob/main/CONTRIBUTING.md).
Feel free to [browse the open issues](https://github.com/questdb/questdb-grafana-datasource/issues).

## Development setup

### Getting started

Clone this repository into your local environment. The frontend code lives in the `src` folder, alongside the [plugin.json file](https://grafana.com/docs/grafana/latest/developers/plugins/metadata/). The backend Go code is in the `pkg` folder. To build this plugin refer to [Build a plugin](https://grafana.com/docs/grafana/latest/developers/plugins/)
Clone this repository into your local environment. The frontend code lives in the `src` folder, alongside the [plugin.json file](https://grafana.com/docs/grafana/latest/developers/plugins/metadata/).
The backend Go code is in the `pkg` folder. To build this plugin refer to [plugin tools(https://grafana.com/developers/plugin-tools).

### Running the development version

Before you can set up the plugin, you need to set up your environment by following [Set up your environment](https://grafana.com/tutorials/build-a-data-source-backend-plugin/#set-up-your-environment).
Before you can set up the plugin, you need to set up your environment by installing:
- [golang 1.21+](https://go.dev/doc/install)
- [nodejs 18+](https://nodejs.org/en/download)
- [mage](https://github.com/magefile/mage)
- [yarn](https://classic.yarnpkg.com/en/docs/install)

#### Compiling the backend

Expand All @@ -24,6 +27,12 @@ mage test # run all Go test cases
mage build:backend && mage reloadPlugin # builds and reloads the plugin in Grafana
```

If host operating system is different from one used in grafana docker image use the following instead:

```sh
mage -v buildAll
```

#### Compiling the frontend

You can build and test the frontend by using `yarn`:
Expand All @@ -39,22 +48,10 @@ You can also have `yarn` watch for changes and automatically recompile them:
yarn watch
```

#### Running E2E tests locally

1. Install [K6](https://k6.io/docs/get-started/installation/)
2. Run `yarn test:e2e:local`
### Starting docker containers

## Create a pull request
You can start grafana and questdb containers with:

Once you are ready to make a pull request, please read and follow [Create a pull request](https://github.com/grafana/grafana/blob/master/contribute/create-pull-request.md).

## Build a release for the QuestDB data source plugin

You need to have commit rights to the GitHub repository to publish a release.

1. Update the version number in the `package.json` file.
2. Update the `CHANGELOG.md` by copy and pasting the relevant PRs
from [GitHub's Release drafter interface](https://github.com/questdb/grafana-questdb-datasource/releases/new) or by
running `npm run generate-release-notes`.
3. PR the changes.
4. Once merged, follow the Drone release process that you can find [here](https://github.com/grafana/integrations-team/wiki/Plugin-Release-Process#drone-release-proces)
```sh
docker-compose up
```
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ datasources:
- name: QuestDB
type: grafana-questdb-datasource
jsonData:
port: 8812
server: localhost
username: username
tlsMode: require
# tlsConfigurationMethod: file-path | file-content
port: 8812
username: admin
tlsMode: disable
# tlsConfigurationMethod: file-path | file-content
# tlsCACertFile: <string>
# timeout: <seconds>
# queryTimeout: <seconds>
# tlsCACertFile: <string>
maxOpenConnections: 100
maxIdleConnections: 100
maxConnectionLifetime: 14400
secureJsonData:
password: password
password: quest
# tlsCACert: <string>
```

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:

questdb:
image: 'questdb/questdb:7.3.9'
container_name: 'grafana-qdb-server'
container_name: 'grafana-questdb-server'
ports:
- '8812:8812'
- '9000:9000'
Expand Down
11 changes: 1 addition & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ go 1.21
toolchain go1.21.4

require (
dagger.io/dagger v0.9.6
github.com/docker/docker v24.0.7+incompatible
github.com/docker/go-units v0.5.0
github.com/grafana/grafana-plugin-sdk-go v0.199.0
github.com/grafana/sqlds/v2 v2.7.2
github.com/lib/pq v1.10.9 // @grafana/backend-platform
Expand All @@ -18,19 +16,14 @@ require (
)

require (
github.com/99designs/gqlgen v0.17.31 // indirect
github.com/Khan/genqlient v0.6.0 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/apache/arrow/go/v13 v13.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.6 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/contrib/samplers/jaegerremote v0.15.1 // indirect
golang.org/x/sync v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
)

Expand Down Expand Up @@ -115,8 +108,6 @@ require (
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect
Expand Down
Loading
Loading