Skip to content

Commit

Permalink
Add streaming support based on Mongo Change streams (#31)
Browse files Browse the repository at this point in the history
* Add a POC mongo data stream

* Create docker-compose.test.yaml for CI

* Add stream conversion to table and ts types

* Add timestamp support

* Add Stream type

* UI update

* UI improvement

* Use Base64URLEncoded query text and collection in streaming path

* Update README

* Fix lint

* Fix lint

* Add `Timestamps` to supported types

* Update changelog

* Update version to 0.3.0

* [skip ci] Add quick start guide
  • Loading branch information
haohanyang authored Jan 11, 2025
1 parent ff3daa1 commit cbacd6b
Show file tree
Hide file tree
Showing 19 changed files with 801 additions and 208 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- '*'
- "*"
paths-ignore:
- README.md
pull_request:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.11"
- name: Update plugin.json
run: python3 scripts/update_plugin_metadata.py
env:
Expand All @@ -49,8 +49,8 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -76,7 +76,7 @@ jobs:
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"

- name: Test backend
if: steps.check-for-backend.outputs.has-backend == 'true'
Expand Down Expand Up @@ -172,21 +172,21 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"

- name: Install dev dependencies
run: npm ci

- name: Start Grafana
run: |
docker compose pull
DEVELOPMENT=false GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d
docker compose -f docker-compose.test.yaml pull
DEVELOPMENT=false GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker compose -f docker-compose.test.yaml up -d
- name: Wait for Grafana to start
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:3000/'
url: "http://localhost:3000/"
responseCode: 200
timeout: 60000
interval: 500
Expand All @@ -204,7 +204,7 @@ jobs:
docker logs mongodb-datasource-grafana >& grafana-server.log
- name: Stop grafana docker
run: docker compose down
run: docker compose -f docker-compose.test.yaml down

- name: Upload server log
uses: actions/upload-artifact@v4
Expand All @@ -222,4 +222,4 @@ jobs:
# with:
# name: playwright-report-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
# path: playwright-report/
# retention-days: 5
# retention-days: 5
46 changes: 35 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,56 @@
# Changelog

## 0.3.0 - 2025-01-11

### Added

- Added Live Streaming support based on [Mongo Change Streams](https://www.mongodb.com/docs/manual/changeStreams/)(https://github.com/haohanyang/mongodb-datasource/pull/31)

### Changed

- Removed "Query" button. Built-in Query/Refresh button is recommended instead(https://github.com/haohanyang/mongodb-datasource/pull/31)

## 0.2.1 - 2024-12-14

### Added
* Optional Mongo aggregate options(https://github.com/haohanyang/mongodb-datasource/pull/33)
* Query Button(https://github.com/haohanyang/mongodb-datasource/pull/35)

- Optional Mongo aggregate options(https://github.com/haohanyang/mongodb-datasource/pull/33)
- Query Button(https://github.com/haohanyang/mongodb-datasource/pull/35)

### Changed
* Query won't be executed automatically after focus changes. User needs to manually click buttons(https://github.com/haohanyang/mongodb-datasource/pull/35)
* UI improvement(https://github.com/haohanyang/mongodb-datasource/pull/33)

- Query won't be executed automatically after focus changes. User needs to manually click buttons(https://github.com/haohanyang/mongodb-datasource/pull/35)
- UI improvement(https://github.com/haohanyang/mongodb-datasource/pull/33)

## 0.2.0 - 2024-12-06

### Added
* Enabled Grafana Alerting([67358d5c](https://github.com/haohanyang/mongodb-datasource/commit/67358d5cb1ada5571697de21016f2acf5dbc1234))

- Enabled Grafana Alerting([67358d5c](https://github.com/haohanyang/mongodb-datasource/commit/67358d5cb1ada5571697de21016f2acf5dbc1234))

### Changed
* Improved query variable([#28](https://github.com/haohanyang/mongodb-datasource/pull/28))

- Improved query variable([#28](https://github.com/haohanyang/mongodb-datasource/pull/28))

## 0.1.2 - 2024-11-10

### Changed
* Increased code editor's font size([84c7de5d](https://github.com/haohanyang/mongodb-datasource/commit/84c7de5df5035bd4c3214908eb6a389b53732cde))
* Make `_id` the first column in the table if exists([#26](https://github.com/haohanyang/mongodb-datasource/pull/26))
* Fix BSON array conversion to JSON([#25](https://github.com/haohanyang/mongodb-datasource/pull/25))

- Increased code editor's font size([84c7de5d](https://github.com/haohanyang/mongodb-datasource/commit/84c7de5df5035bd4c3214908eb6a389b53732cde))
- Make `_id` the first column in the table if exists([#26](https://github.com/haohanyang/mongodb-datasource/pull/26))
- Fix BSON array conversion to JSON([#25](https://github.com/haohanyang/mongodb-datasource/pull/25))

## 0.1.1 - 2024-10-25
### Added

### Added

- [Query Variable](https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#add-a-query-variable) support
- A quick start script `quick_start.py` to quickly start Grafana and MongoDB containers

### Changed
* Added "(Optinal)" to connection string configuration tooltip

- Added "(Optinal)" to connection string configuration tooltip

## 0.1.0 - 2024-10-13

Initial release.
Loading

0 comments on commit cbacd6b

Please sign in to comment.