Skip to content

Commit 33af35b

Browse files
authored
Fix build issue after renaming the plugin (#45)
* update plugin name * npx create-plugin update * update versions * update uid * update 2
1 parent d50e960 commit 33af35b

File tree

12 files changed

+238
-260
lines changed

12 files changed

+238
-260
lines changed

.config/.cprc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "4.3.0"
2+
"version": "4.4.4"
33
}

.config/supervisord/supervisord.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ user=root
55
[program:grafana]
66
user=root
77
directory=/var/lib/grafana
8-
command=/run.sh
8+
command=bash -c 'while [ ! -f /root/grafana-prometheusamazon-datasource/dist/gpx_prometheus_amazon* ]; do sleep 1; done; /run.sh'
99
stdout_logfile=/dev/fd/1
1010
stdout_logfile_maxbytes=0
1111
redirect_stderr=true
@@ -26,7 +26,7 @@ autorestart=true
2626

2727
[program:build-watcher]
2828
user=root
29-
command=/bin/bash -c 'while inotifywait -e modify,create,delete -r /var/lib/grafana/plugins/prometheus-amazon-datasource; do echo "Change detected, restarting delve...";supervisorctl restart delve; done'
29+
command=/bin/bash -c 'while inotifywait -e modify,create,delete -r /var/lib/grafana/plugins/grafana-prometheusamazon-datasource; do echo "Change detected, restarting delve...";supervisorctl restart delve; done'
3030
stdout_logfile=/dev/fd/1
3131
stdout_logfile_maxbytes=0
3232
redirect_stderr=true
@@ -37,8 +37,8 @@ autostart=true
3737
[program:mage-watcher]
3838
user=root
3939
environment=PATH="/usr/local/go/bin:/root/go/bin:%(ENV_PATH)s"
40-
directory=/root/prometheus-amazon-datasource
41-
command=/bin/bash -c 'git config --global --add safe.directory /root/prometheus-amazon-datasource && mage -v watch'
40+
directory=/root/grafana-prometheusamazon-datasource
41+
command=/bin/bash -c 'git config --global --add safe.directory /root/grafana-prometheusamazon-datasource && mage -v watch'
4242
stdout_logfile=/dev/fd/1
4343
stdout_logfile_maxbytes=0
4444
redirect_stderr=true

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
install-only: true
5252

5353
- name: Build binaries
54-
run: mage -v build:linux
54+
run: mage -v
5555

5656
- name: Build frontend
5757
run: yarn build

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ Read more about it here:
6363
5. Spin up a Grafana instance and run the plugin inside it (using Docker)
6464

6565
```bash
66-
yarn run server
66+
yarn run server:configured
6767
```
6868

6969
6. Run the E2E tests (using Playwright and @grafana/plugin-e2e)
7070

7171
```bash
72-
# Spins up a Grafana docker instance (port 3000) with an actual Prometheus instance (port 9090)
73-
yarn run server
72+
# Spins up a Grafana docker instance (v10.4.1) (port 3000) with an actual Prometheus instance (port 9090)
73+
yarn run server:configured
7474

7575
# Starts the e2e tests
7676
yarn run e2e

docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
1414
grafana:
1515
user: root
16-
container_name: 'prometheus-amazon-datasource'
16+
container_name: 'grafana-prometheusamazon-datasource'
1717

1818
depends_on:
1919
prometheus:
@@ -35,6 +35,6 @@ services:
3535
cap_add:
3636
- SYS_PTRACE
3737
volumes:
38-
- ./dist:/var/lib/grafana/plugins/prometheus-amazon-datasource
38+
- ./dist:/var/lib/grafana/plugins/grafana-prometheusamazon-datasource
3939
- ./provisioning:/etc/grafana/provisioning
40-
- .:/root/prometheus-amazon-datasource
40+
- .:/root/grafana-prometheusamazon-datasource

e2e/configuration.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ test.describe('Configuration tests', () => {
110110
const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
111111

112112
const configPage = await createDataSourceConfigPage({
113-
type: "prometheus-amazon-datasource",
113+
type: "grafana-prometheusamazon-datasource",
114114
name: DATA_SOURCE_NAME,
115115
});
116116

@@ -141,7 +141,7 @@ test.describe('Configuration tests', () => {
141141
// const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
142142

143143
const configPage = await createDataSourceConfigPage({
144-
type: "prometheus-amazon-datasource",
144+
type: "grafana-prometheusamazon-datasource",
145145
name: DATA_SOURCE_NAME + "check",
146146
});
147147

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "prometheus-amazon",
2+
"name": "grafana-prometheusamazon-datasource",
33
"version": "0.1.0",
44
"description": "A prometheus plugin for Amazon",
55
"scripts": {
@@ -11,7 +11,7 @@
1111
"typecheck": "tsc --noEmit",
1212
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
1313
"lint:fix": "yarn run lint --fix",
14-
"server": "docker-compose up --build",
14+
"server:configured": "GRAFANA_VERSION=10.4.1 GRAFANA_IMAGE=grafana-enterprise docker-compose up -d",
1515
"sign": "npx --yes @grafana/sign-plugin@latest --rootUrls https://github.com/grafana/prometheus-amazon"
1616
},
1717
"author": "Grafana Labs",
@@ -20,11 +20,11 @@
2020
"@emotion/eslint-plugin": "11.11.0",
2121
"@grafana/e2e": "11.0.0-162805",
2222
"@grafana/e2e-selectors": "11.0.0-162805",
23-
"@grafana/eslint-config": "6.0.1",
23+
"@grafana/eslint-config": "7.0.0",
2424
"@grafana/plugin-e2e": "0.19.0",
2525
"@grafana/tsconfig": "1.3.0-rc1",
2626
"@playwright/test": "^1.41.2",
27-
"@swc/core": "1.3.75",
27+
"@swc/core": "1.3.90",
2828
"@swc/helpers": "0.5.6",
2929
"@swc/jest": "0.2.26",
3030
"@testing-library/dom": "9.3.4",

pkg/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func main() {
1616
// from Grafana to create different instances of SampleDatasource (per datasource
1717
// ID). When datasource configuration changed Dispose method will be called and
1818
// new datasource instance created using NewSampleDatasource factory.
19-
if err := datasource.Manage("prometheus-amazon-datasource", NewDatasource, datasource.ManageOpts{}); err != nil {
19+
if err := datasource.Manage("grafana-prometheusamazon-datasource", NewDatasource, datasource.ManageOpts{}); err != nil {
2020
log.DefaultLogger.Error(err.Error())
2121
os.Exit(1)
2222
}

provisioning/dashboards/e2e-dashboard.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
},
1616
{
1717
"datasource": {
18-
"type": "prometheus-amazon-datasource",
19-
"uid": "prometheus-amazon"
18+
"type": "grafana-prometheusamazon-datasource",
19+
"uid": "grafana-prometheusamazon"
2020
},
2121
"enable": true,
2222
"expr": "go_goroutines",
@@ -38,8 +38,8 @@
3838
"panels": [
3939
{
4040
"datasource": {
41-
"type": "prometheus-amazon-datasource",
42-
"uid": "prometheus-amazon"
41+
"type": "grafana-prometheusamazon-datasource",
42+
"uid": "grafana-prometheusamazon"
4343
},
4444
"fieldConfig": {
4545
"defaults": {
@@ -119,7 +119,7 @@
119119
{
120120
"datasource": {
121121
"type": "prometheus",
122-
"uid": "prometheus-amazon"
122+
"uid": "grafana-prometheusamazon"
123123
},
124124
"disableTextWrap": false,
125125
"editorMode": "builder",
@@ -149,8 +149,8 @@
149149
"value": "__name__"
150150
},
151151
"datasource": {
152-
"type": "prometheus-amazon-datasource",
153-
"uid": "prometheus-amazon"
152+
"type": "grafana-prometheusamazon-datasource",
153+
"uid": "grafana-prometheusamazon"
154154
},
155155
"definition": "label_names()",
156156
"hide": 0,
@@ -178,7 +178,7 @@
178178
"timeRangeUpdatedDuringEditOrView": false,
179179
"timepicker": {},
180180
"timezone": "browser",
181-
"title": "prometheus-amazon",
181+
"title": "grafana-prometheusamazon",
182182
"uid": "fdewz0hu7qccge",
183183
"version": 2,
184184
"weekStart": ""

provisioning/datasources/code-editor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: 1
33
datasources:
44
- name: a-prometheus-code-editor
55
uid: a-prometheus-code-editor
6-
type: prometheus-amazon-datasource
6+
type: grafana-prometheusamazon-datasource
77
url: http://prometheus:9090
88
access: proxy
99
editable: true
@@ -16,4 +16,3 @@ datasources:
1616
# disableRecordingRules: false
1717
# incrementalQueryOverlapWindow: 10m
1818
defaultEditor: code
19-

0 commit comments

Comments
 (0)