Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions grafana/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
This directory contains Fire datasource and the FlameGraph panel.

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

#### Setup Grafana
- Checkout https://github.com/grafana/grafana/pull/52057 in Grafana repo.
- 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
#### Create symbolic links:
Create a links in your Grafana plugin directory so Grafana will lead the plugins on startup.
- `cd $GRAFANA_REPO/data/plugins`
- `ln -s $FIRE_REPO/grafana/flamegraph`
- `ln -s $FIRE_REPO/grafana/fire-datasource`
Expand All @@ -14,9 +15,9 @@ To be able to test both in Grafana you have to setup your environment in a speci
- `cd $FIRE_REPO/grafana/flamegraph`
- `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.
- `yarn install`
- `yarn build`
- `yarn build` or `yarn watch`
- `cd $FIRE_REPO/grafana/fire-datasource`
- `yarn install`
- `yarn build`
- `mage -v`
- Restart Grafana if it was already running to pick up new plugin state.
- `yarn build` or `yarn watch`
- `mage -v` or `bra run`
- `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.
18 changes: 18 additions & 0 deletions grafana/fire-datasource/.bra.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[run]
init_cmds = [
["mage", "-v", "build:debug"],
["mage", "-v", "reloadPlugin"]
]
watch_all = true
follow_symlinks = true
watch_dirs = [
"$WORKDIR/pkg",
]
# Not sure why but this file is created and deleted, which otherwise trigger a loop
ignore_files = ["mage_output_file.go"]
watch_exts = [".go"]
build_delay = 1500
cmds = [
["mage", "-v", "build:debug"],
["mage", "-v", "reloadPlugin"]
]
6 changes: 0 additions & 6 deletions grafana/fire-datasource/Magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
package main

import (
"fmt"
// mage:import
build "github.com/grafana/grafana-plugin-sdk-go/build"
)

// Hello prints a message (shows that you can define custom Mage targets).
func Hello() {
fmt.Println("hello plugin developer!")
}

// Default configures the default target.
var Default = build.BuildAll