Skip to content

Commit

Permalink
Merge branch 'main' into issue-234/fix-monaco-loading
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Loori-R committed Jan 23, 2025
2 parents 5eaef56 + 81039d0 commit cc2c0c4
Show file tree
Hide file tree
Showing 1,230 changed files with 88,143 additions and 41,222 deletions.
2 changes: 1 addition & 1 deletion .config/webpack/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const SOURCE_DIR = 'src';
export const DIST_DIR = 'plugins/victoriametrics-datasource';
export const DIST_DIR = 'plugins/victoriametrics-metrics-datasource';
export const ENTRY_FILE = `${SOURCE_DIR}/module.ts`;
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ jobs:
export CL_BRANCH="changelog-update-$(date +%s)"
git checkout -b "${CL_BRANCH}"
git add CHANGELOG.md
git commit -S -m "Automatic update CHANGELOG"
git commit -S -m "Automatic CHANGELOG update"
git push origin ${CL_BRANCH}
gh pr create -f
gh pr create \
-H $(git branch --show-current) \
-t "Automatic CHANGELOG update" \
-b "Automatic CHANGELOG update"
env:
GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"
34 changes: 31 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,35 @@

## tip

BUGFIX: fix plugin loading for query formatting in the editor. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/234).
* BUGFIX: fix issue with including the lezer-metricsql package to the build and fix public folder. See [this PR](https://github.com/VictoriaMetrics/victoriametrics-datasource/pull/256).
* BUGFIX: fix plugin loading for query formatting in the editor. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/234).

## v0.12.0

⚠️ **Breaking Change: Plugin ID Updated**
**Update Note 1:**
In the new version of the plugin, the plugin ID has been updated. The new plugin ID is `victoriametrics-metrics-datasource`. **This is a breaking change**: Grafana will treat this as a new plugin.
- You must update the `allow_loading_unsigned_plugins` field in the `grafana.ini` or `defaults.ini` configuration file.
**Example:**
```ini
allow_loading_unsigned_plugins = victoriametrics-metrics-datasource
```
- If you are using provisioning, update the `type` field to `victoriametrics-metrics-datasource` in your provisioning configuration.
- After making these changes, you must restart the Grafana server for the updates to take effect.

* FEATURE: update plugin id name to `victoriametrics-metrics-datasource` after the review while sign procedure. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/233).

## v0.11.1

* BUGFIX: fix checksum calculation for release files.

## v0.11.0

* FEATURE: include request url in the `got unexpected response status code` error message for troubleshooting.
Thanks to @chenlujjj for [the pull request](https://github.com/VictoriaMetrics/victoriametrics-datasource/pull/243).

* BUGFIX: fix issue with variables not working in adhoc filters. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/235).
* BUGFIX: fix query type switching when creating alerts in Grafana. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/237)

## [v0.10.3](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.10.3)

Expand All @@ -22,7 +50,7 @@ BUGFIX: fix plugin loading for query formatting in the editor. See [this issue](

* BUGFIX: fixed healthcheck

## [v0.10.0](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.10.0)
## [v0.10.0](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.10.0)

* FEATURE: set the default query type to `instant` when creating alerting rules. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/205).

Expand All @@ -40,7 +68,7 @@ BUGFIX: fix plugin loading for query formatting in the editor. See [this issue](
## [v0.8.5](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.8.5)

* BUGFIX: restore support for Grafana versions below `10.0.0`. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/159).
* BUGFIX: fix issue with forwarding headers from datasource to the backend or proxy.
* BUGFIX: fix issue with forwarding headers from datasource to the backend or proxy.
It might be helpful if a user wants to use some kind of authentication. See [this issue](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/54).

## [v0.8.4](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.8.4)
Expand Down
2 changes: 1 addition & 1 deletion Magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func init() {
build.SetBeforeBuildCallback(func(cfg build.Config) (build.Config, error) {
// Do something before building
cfg.OutputBinaryPath = "plugins/victoriametrics-datasource"
cfg.OutputBinaryPath = "plugins/victoriametrics-metrics-datasource"
return cfg, nil
})
}
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ifeq ($(PKG_TAG),)
PKG_TAG := $(BUILDINFO_TAG)
endif

PLUGIN_ID=victoriametrics-datasource
APP_NAME=victoriametrics_backend_plugin
PLUGIN_ID=victoriametrics-metrics-datasource
APP_NAME=victoriametrics_metrics_backend_plugin

GO_BUILDINFO = -X '$(PKG_PREFIX)/victoriametrics-datasource/buildinfo.Version=$(APP_NAME)-$(DATEINFO_TAG)-$(BUILDINFO_TAG)'
GO_BUILDINFO = -X 'github.com/grafana/grafana-plugin-sdk-go/build.buildInfoJSON={\"time\":${DATEINFO_TAG},\"id\":\"${PLUGIN_ID}\",\"version\":\"${BUILDINFO_TAG}\",\"branch\":\"${PKG_TAG}\"}'

.PHONY: $(MAKECMDGOALS)

Expand All @@ -31,7 +31,7 @@ frontend-build: frontend-package-base-image
--user $(shell id -u):$(shell id -g) \
--env YARN_CACHE_FOLDER="/victoriametrics-datasource/.cache" \
--entrypoint=/bin/bash \
frontent-builder-image -c "yarn install --omit=dev && yarn build"
frontent-builder-image -c "yarn preinstall && yarn install --omit=dev && yarn build"

app-via-docker-local:
$(eval OS := $(shell docker run $(GO_BUILDER_IMAGE) go env GOOS))
Expand All @@ -54,8 +54,8 @@ vm-plugin-pack: vm-plugin-build
tar -czf ../dist/$(PACKAGE_NAME).tar.gz ./$(PLUGIN_ID) && \
zip -q -r ../dist/$(PACKAGE_NAME).zip ./$(PLUGIN_ID) && \
cd - && \
sha256sum dist/$(PACKAGE_NAME).zip > dist/$(PACKAGE_NAME)_checksums_zip.txt && \
sha256sum dist/$(PACKAGE_NAME).tar.gz > dist/$(PACKAGE_NAME)_checksums_tar.gz.txt
sha1sum dist/$(PACKAGE_NAME).zip > dist/$(PACKAGE_NAME)_checksums_zip.txt && \
sha1sum dist/$(PACKAGE_NAME).tar.gz > dist/$(PACKAGE_NAME)_checksums_tar.gz.txt

vm-plugin-cleanup:
rm -rf ./victoriametrics-datasource plugins
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ Installing VictoriaMetrics Grafana datasource [requires](https://grafana.com/doc

``` ini
[plugins]
allow_loading_unsigned_plugins = victoriametrics-datasource
allow_loading_unsigned_plugins = victoriametrics-metrics-datasource
```

For `grafana-operator` users, please adjust `config:` section in your `kind=Grafana` resource as below

```
config:
plugins:
allow_loading_unsigned_plugins: "victoriametrics-datasource"
allow_loading_unsigned_plugins: "victoriametrics-metrics-datasource"
```

See [why VictoriaMetrics datasource is unsigned](#why-victoriaMetrics-datasource-is-unsigned).
Expand Down Expand Up @@ -67,7 +67,7 @@ datasources:
# displayed in Grafana panels and queries.
- name: VictoriaMetrics
# <string, required> Sets the data source type.
type: victoriametrics-datasource
type: victoriametrics-metrics-datasource
# <string, required> Sets the access mode, either
# proxy or direct (Server or Browser in the UI).
# Some data sources are incompatible with any setting
Expand All @@ -83,7 +83,7 @@ datasources:
# displayed in Grafana panels and queries.
- name: VictoriaMetrics - cluster
# <string, required> Sets the data source type.
type: victoriametrics-datasource
type: victoriametrics-metrics-datasource
# <string, required> Sets the access mode, either
# proxy or direct (Server or Browser in the UI).
# Some data sources are incompatible with any setting
Expand All @@ -108,8 +108,8 @@ Please find the example of provisioning Grafana instance with VictoriaMetrics da
grafana:
image: grafana/grafana:11.0.0
environment:
- GF_INSTALL_PLUGINS=https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.10.3/victoriametrics-datasource-v0.10.3.zip;victoriametrics-datasource
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=victoriametrics-datasource
- GF_INSTALL_PLUGINS=https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.12.0/victoriametrics-metrics-datasource-v0.12.0.zip;victoriametrics-metrics-datasource
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=victoriametrics-metrics-datasource
ports:
- 3000:3000/tcp
volumes:
Expand All @@ -136,14 +136,14 @@ Option 1. Using Grafana provisioning:

``` yaml
env:
GF_INSTALL_PLUGINS: "https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.10.3/victoriametrics-datasource-v0.10.3.zip;victoriametrics-datasource"
GF_INSTALL_PLUGINS: "https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.12.0/victoriametrics-metrics-datasource-v0.12.0.zip;victoriametrics-metrics-datasource"
```

Option 2. Using Grafana plugins section in `values.yaml`:

``` yaml
plugins:
- https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.10.3/victoriametrics-datasource-v0.10.3.zip;victoriametrics-datasource
- https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/v0.12.0/victoriametrics-metrics-datasource-v0.12.0.zip;victoriametrics-metrics-datasource
```

Option 3. Using init container:
Expand All @@ -163,7 +163,7 @@ extraInitContainers:
set -ex
mkdir -p /var/lib/grafana/plugins/
ver=$(curl -s -L https://api.github.com/repos/VictoriaMetrics/victoriametrics-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-metrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
tar -xf /var/lib/grafana/plugins/vm-plugin.tar.gz -C /var/lib/grafana/plugins/
rm /var/lib/grafana/plugins/vm-plugin.tar.gz
volumeMounts:
Expand Down Expand Up @@ -223,15 +223,15 @@ spec:
set -ex
mkdir -p /var/lib/grafana/plugins/
ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victoriametrics-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-metrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
tar -xf /var/lib/grafana/plugins/vm-plugin.tar.gz -C /var/lib/grafana/plugins/
rm /var/lib/grafana/plugins/vm-plugin.tar.gz
volumeMounts:
- name: grafana-data
mountPath: /var/lib/grafana
config:
plugins:
allow_loading_unsigned_plugins: victoriametrics-datasource
allow_loading_unsigned_plugins: victoriametrics-metrics-datasource
```

See [Grafana operator reference](https://grafana-operator.github.io/grafana-operator/docs/grafana/) to find more about Grafana operator.
Expand All @@ -243,7 +243,7 @@ This example uses init container to download and install plugin.

```sh
ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victoriametrics-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
curl -L https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/download/$ver/victoriametrics-metrics-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vm-plugin.tar.gz
tar -xf /var/lib/grafana/plugins/vm-plugin.tar.gz -C /var/lib/grafana/plugins/
rm /var/lib/grafana/plugins/vm-plugin.tar.gz
```
Expand All @@ -263,7 +263,7 @@ plugins = {{path to directory with plugin}}

``` ini
[plugins]
allow_loading_unsigned_plugins = victoriametrics-datasource
allow_loading_unsigned_plugins = victoriametrics-metrics-datasource
```

### 2. Run the plugin
Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ services:
GF_AUTH_BASIC_ENABLED: "false"
GF_DEFAULT_APP_MODE: development
volumes:
- ./plugins/victoriametrics-datasource:/var/lib/grafana/plugins/victoriametrics-datasource
- ./plugins/victoriametrics-metrics-datasource:/var/lib/grafana/plugins/victoriametrics-metrics-datasource
- ./provisioning:/etc/grafana/provisioning
Loading

0 comments on commit cc2c0c4

Please sign in to comment.