Skip to content

Commit

Permalink
Update project name, resolve date formatting issue & empty results UI
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlb committed Mar 25, 2024
1 parent f6d3de6 commit 142ab3c
Show file tree
Hide file tree
Showing 49 changed files with 206 additions and 137 deletions.
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ well.
There are many ways you can contribute! :heart:

### Bug Reports and Fixes :bug:
- If you find a bug, please search for it in the [Issues](https://github.com/slackhq/slack-kaldb-app/issues), and if it isn't already tracked,
[create a new issue](https://github.com/slackhq/slack-kaldb-app/issues/new). Fill out the "Bug Report" section of the issue template. Even if an Issue is closed, feel free to comment and add details, it will still
- If you find a bug, please search for it in the [Issues](https://github.com/slackhq/slack-astra-app/issues), and if it isn't already tracked,
[create a new issue](https://github.com/slackhq/slack-astra-app/issues/new). Fill out the "Bug Report" section of the issue template. Even if an Issue is closed, feel free to comment and add details, it will still
be reviewed.
- Issues that have already been identified as a bug (note: able to reproduce) will be labelled `bug`.
- If you'd like to submit a fix for a bug, [send a Pull Request](#creating_a_pull_request) and mention the Issue number.
- Include tests that isolate the bug and verifies that it was fixed.

### New Features :bulb:
- If you'd like to add new functionality to this project, describe the problem you want to solve in a [new Issue](https://github.com/slackhq/slack-kaldb-app/issues/new).
- If you'd like to add new functionality to this project, describe the problem you want to solve in a [new Issue](https://github.com/slackhq/slack-astra-app/issues/new).
- Issues that have been identified as a feature request will be labelled `enhancement`.
- If you'd like to implement the new feature, please wait for feedback from the project
maintainers before spending too much time writing the code. In some cases, `enhancement`s may
Expand All @@ -28,7 +28,7 @@ There are many ways you can contribute! :heart:
alternative implementation of something that may have advantages over the way its currently
done, or you have any other change, we would be happy to hear about it!
- If its a trivial change, go ahead and [send a Pull Request](#creating_a_pull_request) with the changes you have in mind.
- If not, [open an Issue](https://github.com/slackhq/slack-kaldb-app/issues/new) to discuss the idea first.
- If not, [open an Issue](https://github.com/slackhq/slack-astra-app/issues/new) to discuss the idea first.

If you're new to our project and looking for some way to make your first contribution, look for
Issues labelled `good first contribution`.
Expand All @@ -37,7 +37,7 @@ Issues labelled `good first contribution`.

For your contribution to be accepted:

- [x] You must have signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackhq/slack-kaldb-app).
- [x] You must have signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackhq/slack-astra-app).
- [x] The test suite must be complete and pass.
- [x] The changes must be approved by code review.
- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number.
Expand Down Expand Up @@ -93,15 +93,15 @@ There are more details about processes and workflow in the [Maintainer's Guide](

#### Proxying
Depending on your setup, it may be advantageous for you to setup a proxy from your
local machine to a KalDB query node running in a cloud environment. Below is
local machine to a Astra query node running in a cloud environment. Below is
an example command to do that (NOTE: this may or may not work depending on
your setup):
```
ssh -N -L $LOCALHOST_PORT:localhost:$REMOTE_PORT $NODE_NAME
```

You would then be able to use `host.docker.internal:$LOCALHOST_PORT` as the
KalDB datasource URL inside your Grafana instance.
Astra datasource URL inside your Grafana instance.


### Backend
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe your issue here.
- [ ] discussion

### Requirements (place an `x` in each of the `[ ]`)
* [ ] I've read and understood the [Contributing guidelines](https://github.com/slackhq/slack-kaldb-app/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [ ] I've read and understood the [Contributing guidelines](https://github.com/slackhq/slack-astra-app/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [ ] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).
* [ ] I've searched for any related issues and avoided creating a duplicate issue.

Expand All @@ -23,7 +23,7 @@ Filling out the following details about bugs will help us solve your issue soone

#### Reproducible in:

slack-kaldb-app version:
slack-astra-app version:

Go version:

Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Describe the goal of this PR. Mention any related Issue numbers.

### Requirements (place an `x` in each `[ ]`)

* [ ] I've read and understood the [Contributing Guidelines](https://github.com/slackhq/slack-kaldb-app/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [ ] I've read and understood the [Contributing Guidelines](https://github.com/slackhq/slack-astra-app/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [ ] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).

> The following point can be removed after setting up CI (such as Travis) with coverage reports (such as Codecov)
Expand All @@ -13,4 +13,4 @@ Describe the goal of this PR. Mention any related Issue numbers.

> The following point can be removed after setting up a CLA reporting tool such as cla-assistant.io
* [ ] I've read, agree to, and signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackhq/slack-kaldb-app).
* [ ] I've read, agree to, and signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackhq/slack-astra-app).
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ ci/
e2e-results/

/.idea
/slack-kaldb-app.zip
/slack-astra-app.zip
.DS_Store
23 changes: 18 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.6.0
### New features
* N/A

### Breaking changes
* Project name updated - this will require require re-creating any existing data sources
* Minimum Grafana version updated to 10.0

### Bugs squashed
* Resolved an issue where date time formatting was incorrectly handled after Astra updates to support ES datasources
* Resolved an issue where empty results would incorrectly render faux table contents
* Resolved an issue where empty results would not correctly clear previous result state

## 0.5.1
### New features
* N/A
Expand Down Expand Up @@ -112,19 +125,19 @@ N/A
N/A

### Bugs squashed
* Fixed an issue where the KalDB log UI would fail to render in Grafana 9.X versions
* Fixed an issue where we weren't properly mapping and parsing the dates returned by KalDB
* Fixed an issue where the Astra log UI would fail to render in Grafana 9.X versions
* Fixed an issue where we weren't properly mapping and parsing the dates returned by Astra
* Fixed an issue where we still allowed folks to select "PPL" as a query type, despite it not being (currently)
supported

## 0.0.2

### New features
* Initial release of KalDB backend datasource
* Shard count (total, failed) from KalDB explore page
* Initial release of Astra backend datasource
* Shard count (total, failed) from Astra explore page

### Breaking changes
* Elasticsearch is no longer a supported datasource from KalDB explore UI
* Elasticsearch is no longer a supported datasource from Astra explore UI

## 0.0.1

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To get started [install](https://grafana.com/docs/grafana/latest/plugins/install
the Grafana plugins page under "Astra by Slack". Once installed a new datasource type will be available, and Astra will
appear in the navigation under Apps.

![Astra explore](src/img/kaldb_explore.png)
![Astra explore](src/img/explore.png)

## Other resources
* [Getting started with development](.github/CONTRIBUTING.md#getting-started-with-development)
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: '3.0'

services:
grafana:
container_name: 'slack-kaldb-app'
container_name: 'slack-astra-app'
build:
context: ./.config
args:
grafana_version: ${GRAFANA_VERSION:-10.3.1}
ports:
- 3000:3000/tcp
volumes:
- ./dist:/var/lib/grafana/plugins/slack-kaldb-app
- ./dist:/var/lib/grafana/plugins/slack-astra-app
- ./provisioning:/etc/grafana/provisioning
environment:
GF_LOG_MODE: "console file"
Expand All @@ -19,5 +19,5 @@ services:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_PATHS_PLUGINS: "/var/lib/grafana/plugins"
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: "slack-kaldb-app,slack-kaldb-app-backend-datasource"
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: "slack-astra-app,slack-astra-app-backend-datasource"
GF_SERVER_ENABLE_GZIP: "true"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/slackhq/slack-kaldb-app
module github.com/slackhq/slack-astra-app

go 1.14

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slack-kaldb-app",
"version": "0.5.1",
"description": "Grafana KalDB App",
"name": "slack-astra-app",
"version": "0.6.0",
"description": "Grafana Astra App",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"build-go": "mage buildAll && mv dist/gpx* dist/datasource",
Expand All @@ -16,7 +16,7 @@
"test": "jest --watch --onlyChanged",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"typecheck": "tsc --noEmit",
"zip": "zip slack-kaldb-app.zip dist/ -rj"
"zip": "zip slack-astra-app.zip dist/ -rj"
},
"author": "Slack",
"license": "Apache-2.0",
Expand Down
18 changes: 9 additions & 9 deletions pkg/kaldb/kaldb.go → pkg/astra/astra.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"context"
Expand All @@ -8,11 +8,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/opensearch-datasource/pkg/tsdb"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

// KalDbExecutor represents a handler for handling KalDb datasource request
type KalDbExecutor struct{}
// AstraExecutor represents a handler for handling Astra datasource request
type AstraExecutor struct{}

var (
intervalCalculator tsdb.IntervalCalculator
Expand All @@ -22,14 +22,14 @@ type TsdbQueryEndpoint interface {
Query(ctx context.Context, ds *backend.DataSourceInstanceSettings, query *tsdb.TsdbQuery) (*tsdb.Response, error)
}

type KalDbDatasource struct {
type AstraDatasource struct {
dsInfo *backend.DataSourceInstanceSettings
}

func NewKalDbDatasource(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
func NewAstraDatasource(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
log.DefaultLogger.Debug("Initializing new data source instance")

return &KalDbDatasource{
return &AstraDatasource{
dsInfo: &settings,
}, nil
}
Expand All @@ -38,7 +38,7 @@ func NewKalDbDatasource(settings backend.DataSourceInstanceSettings) (instancemg
// The main use case for these health checks is the test button on the
// datasource configuration page which allows users to verify that
// a datasource is working as expected.
func (ds *KalDbDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) {
func (ds *AstraDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) {
res := &backend.CheckHealthResult{}

res.Status = backend.HealthStatusOk
Expand All @@ -50,7 +50,7 @@ func (ds *KalDbDatasource) CheckHealth(ctx context.Context, req *backend.CheckHe
// req contains the queries []DataQuery (where each query contains RefID as a unique identifier).
// The QueryDataResponse contains a map of RefID to the response for each query, and each response
// contains Frames ([]*Frame).
func (ds *KalDbDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
func (ds *AstraDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
if len(req.Queries) == 0 {
return nil, fmt.Errorf("query contains no queries")
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/kaldb/lucene_handler.go → pkg/astra/lucene_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"fmt"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/opensearch-datasource/pkg/tsdb"
"github.com/grafana/opensearch-datasource/pkg/utils"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

type luceneHandler struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kaldb/models.go → pkg/astra/models.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"github.com/bitly/go-simplejson"
Expand Down
4 changes: 2 additions & 2 deletions pkg/kaldb/ppl_handler.go → pkg/astra/ppl_handler.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package kaldb
package astra

import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

type pplHandler struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"errors"
Expand All @@ -10,7 +10,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/opensearch-datasource/pkg/null"
"github.com/grafana/opensearch-datasource/pkg/utils"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

type pplResponseParser struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"encoding/json"
Expand All @@ -7,7 +7,7 @@ import (
"time"

"github.com/grafana/grafana-plugin-sdk-go/data"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"

. "github.com/smartystreets/goconvey/convey"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/kaldb/response_parser.go → pkg/astra/response_parser.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"errors"
Expand All @@ -15,7 +15,7 @@ import (
"github.com/grafana/opensearch-datasource/pkg/null"
"github.com/grafana/opensearch-datasource/pkg/tsdb"
"github.com/grafana/opensearch-datasource/pkg/utils"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
"github.com/grafana/es-open-distro-datasource/pkg/null"
"github.com/grafana/grafana-plugin-sdk-go/backend"
. "github.com/smartystreets/goconvey/convey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"strconv"
Expand All @@ -7,7 +7,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/opensearch-datasource/pkg/tsdb"
"github.com/grafana/opensearch-datasource/pkg/utils"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
)

type timeSeriesQuery struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kaldb
package astra

import (
"fmt"
Expand All @@ -7,8 +7,8 @@ import (

"github.com/Masterminds/semver"
"github.com/grafana/grafana-plugin-sdk-go/backend"
es "github.com/slackhq/slack-kaldb-app/pkg/kaldb/client"
"github.com/grafana/opensearch-datasource/pkg/tsdb"
es "github.com/slackhq/slack-astra-app/pkg/astra/client"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
8 changes: 4 additions & 4 deletions pkg/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
astra "github.com/slackhq/slack-astra-app/pkg/astra"
"os"

"github.com/grafana/grafana-plugin-sdk-go/backend/datasource"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/slackhq/slack-kaldb-app/pkg/kaldb"
)

func main() {
Expand All @@ -14,10 +14,10 @@ func main() {
// to exit by itself using os.Exit. Manage automatically manages life cycle
// of datasource instances. It accepts datasource instance factory as first
// argument. This factory will be automatically called on incoming request
// from Grafana to create different instances of KalDbDatasource (per datasource
// from Grafana to create different instances of AstraDatasource (per datasource
// ID). When datasource configuration changed Dispose method will be called and
// new datasource instance created using NewKalDbDatasource factory.
if err := datasource.Manage("slack-kaldb-app-backend-datasource", kaldb.NewKalDbDatasource, datasource.ManageOpts{}); err != nil {
// new datasource instance created using NewAstraDatasource factory.
if err := datasource.Manage("slack-astra-app-backend-datasource", astra.NewAstraDatasource, datasource.ManageOpts{}); err != nil {
log.DefaultLogger.Error(err.Error())
os.Exit(1)
}
Expand Down
Loading

0 comments on commit 142ab3c

Please sign in to comment.