Skip to content

Commit eb3426d

Browse files
authored
Add bra config for fire datasource grafana/phlare#139
Add bra config for fire datasource
2 parents 425cbdd + ef620af commit eb3426d

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

grafana/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
This directory contains Fire datasource and the FlameGraph panel.
22

3-
To be able to test both in Grafana you have to setup your environment in a specific way.
3+
To be able to test both in Grafana you have to set up your environment in a specific way.
44

55
#### Setup Grafana
66
- Checkout https://github.com/grafana/grafana/pull/52057 in Grafana repo.
77
- In grafana repo packages/grafana-data/package.json, change `"@grafana/schema": "9.1.0-pre",` to `"@grafana/schema": "9.0.4",`. We will link @grafana/data later on and the `9.1.0-pre` version would not be recognized from Fire repo
88
#### Create symbolic links:
9+
Create a links in your Grafana plugin directory so Grafana will lead the plugins on startup.
910
- `cd $GRAFANA_REPO/data/plugins`
1011
- `ln -s $FIRE_REPO/grafana/flamegraph`
1112
- `ln -s $FIRE_REPO/grafana/fire-datasource`
@@ -14,9 +15,9 @@ To be able to test both in Grafana you have to setup your environment in a speci
1415
- `cd $FIRE_REPO/grafana/flamegraph`
1516
- `yarn link grafana/packages/grafana-data` this will change the `resolutions` part in package.json TODO: check if this can be relative path or how to prevent rewriting this all the time.
1617
- `yarn install`
17-
- `yarn build`
18+
- `yarn build` or `yarn watch`
1819
- `cd $FIRE_REPO/grafana/fire-datasource`
1920
- `yarn install`
20-
- `yarn build`
21-
- `mage -v`
22-
- Restart Grafana if it was already running to pick up new plugin state.
21+
- `yarn build` or `yarn watch`
22+
- `mage -v` or `bra run`
23+
- `bra run` will also reload the plugin in your running grafana instance, if you don't use it restart Grafana if it was already running to pick up new plugin state.

grafana/fire-datasource/.bra.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
init_cmds = [
3+
["mage", "-v", "build:debug"],
4+
["mage", "-v", "reloadPlugin"]
5+
]
6+
watch_all = true
7+
follow_symlinks = true
8+
watch_dirs = [
9+
"$WORKDIR/pkg",
10+
]
11+
# Not sure why but this file is created and deleted, which otherwise trigger a loop
12+
ignore_files = ["mage_output_file.go"]
13+
watch_exts = [".go"]
14+
build_delay = 1500
15+
cmds = [
16+
["mage", "-v", "build:debug"],
17+
["mage", "-v", "reloadPlugin"]
18+
]

grafana/fire-datasource/Magefile.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
package main
55

66
import (
7-
"fmt"
87
// mage:import
98
build "github.com/grafana/grafana-plugin-sdk-go/build"
109
)
1110

12-
// Hello prints a message (shows that you can define custom Mage targets).
13-
func Hello() {
14-
fmt.Println("hello plugin developer!")
15-
}
16-
1711
// Default configures the default target.
1812
var Default = build.BuildAll

0 commit comments

Comments
 (0)