You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,52 @@ This project follows
25
25
26
26
## Contribution process
27
27
28
+
### Build the plugin
29
+
30
+
If you download the source, you need to build the plugin. Make sure you have all the prerequisites installed and configured:
31
+
32
+
- Grafana 9.0
33
+
- Go 1.16+
34
+
- Mage
35
+
- NodeJS
36
+
- yarn
37
+
38
+
Under the source directory, run the following commands:
39
+
40
+
```bash
41
+
yarn install
42
+
yarn build
43
+
44
+
#Run the following to update Grafana plugin SDK for Go dependency to the latest minor version:
45
+
46
+
go get -u github.com/grafana/grafana-plugin-sdk-go
47
+
go mod tidy
48
+
49
+
#Build backend plugin binaries for Linux, Windows and Darwin to dist directory:
50
+
mage -v
51
+
```
52
+
53
+
More details, please read [the doc](https://grafana.com/tutorials/build-a-data-source-backend-plugin/).
54
+
### Grafana Configuration
55
+
56
+
To have Grafana detect this plugin and make it available for use, two entries must be modified in the Grafana config file. See [Grafana's Documentation](https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/) for more details, including the default location of the config file depending on platform.
57
+
58
+
First, set `paths.plugins` to point to where this repo has been downloaded locally. The final build artifacts will be under the `dist` directory:
With these settings updated, we can now restart Grafana and expect the plugin to be available. The specific command to restart Grafana will depend on what platform it's running on, with the various options documented by [Grafana](https://grafana.com/docs/grafana/v9.0/setup-grafana/restart-grafana/).
73
+
28
74
### Code Reviews
29
75
30
76
All submissions, including submissions by project members, require review. We
Copy file name to clipboardExpand all lines: README.md
+14-40Lines changed: 14 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,54 +11,28 @@ which allows users to query and visualize their Google Cloud logs in Grafana.
11
11
12
12
Download this plugin to the machine Grafana is running on, either using `git clone` or simply downloading it as a ZIP file. For the purpose of this guide, we'll assume the user "alice" has downloaded it into their local directory "/Users/alice/grafana/". If you are running the Grafana server using a user such as `grafana`, make sure the user has access to the directory.
13
13
14
-
### Build the plugin
14
+
### Enable Cloud Resource Manager API
15
15
16
-
If you download the source, you need to build the plugin. Make sure you have all the prerequisites installed and configured:
16
+
You need to enable the resource manager API. Otherwise, your cloud projects will not be displayed in the dropdown menu.
17
17
18
-
- Grafana 9.0
19
-
- Go 1.16+
20
-
- Mage
21
-
- NodeJS
22
-
- yarn
18
+
You can following the those steps to enable it:
23
19
24
-
Under the source directory, run the following commands:
20
+
1. Navigate to the [cloud resource manager API page](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com]) in GCP and select your project
21
+
2. Press the `Enable` button
25
22
26
-
```bash
27
-
yarn install
28
-
yarn build
23
+
### Generate a JWT file
29
24
30
-
#Run the following to update Grafana plugin SDK for Go dependency to the latest minor version:
25
+
1. If you don't have gcp project, add new gcp project. [link](https://cloud.google.com/resource-manager/docs/creating-managing-projects#console)
26
+
2. Open the [Credentials](https://console.developers.google.com/apis/credentials) page in the Google API Console.
27
+
3. Click **Create Credentials** then click **Service account**.
28
+
4. On the Create service account page, enter the Service account details.
29
+
5. On the `Create service account` page, fill in the `Service account details` and then click `Create and Continue`
30
+
6. On the `Grant this service account access to project` section, select the `Logs Viewer` role under `Logging` to the service account. Click `Done`
31
+
7. In the next step, click the service account you just created. Under the `Keys` tabl and select `Add key` and `Create new key`
32
+
8. Choose key type `JSON` and click `Create`. A JSON key file will be created and downloaded to your computer
31
33
32
-
go get -u github.com/grafana/grafana-plugin-sdk-go
33
-
go mod tidy
34
-
35
-
#Build backend plugin binaries for Linux, Windows and Darwin to dist directory:
36
-
mage -v
37
-
```
38
-
39
-
More details, please read [the doc](https://grafana.com/tutorials/build-a-data-source-backend-plugin/).
40
34
### Grafana Configuration
41
35
42
-
To have Grafana detect this plugin and make it available for use, two entries must be modified in the Grafana config file. See [Grafana's Documentation](https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/) for more details, including the default location of the config file depending on platform.
43
-
44
-
First, set `paths.plugins` to point to where this repo has been downloaded locally. The final build artifacts will be under the `dist` directory:
With these settings updated, we can now restart Grafana and expect the plugin to be available. The specific command to restart Grafana will depend on what platform it's running on, with the various options documented by [Grafana](https://grafana.com/docs/grafana/v9.0/setup-grafana/restart-grafana/).
59
-
60
-
## Configuration
61
-
62
36
1. With Grafana restarted, navigate to `Configuration -> Data sources` (or the route `/datasources`)
0 commit comments