Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 3.15 KB

CONTRIBUTING.md

File metadata and controls

83 lines (55 loc) · 3.15 KB

How to Contribute

We'd love to accept your patches and contributions to this project.

Before you begin

Sign our Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.

If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again.

Visit https://cla.developers.google.com/ to see your current agreements or to sign a new one.

Review our Community Guidelines

This project follows Google's Open Source Community Guidelines.

Contribution process

Download

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.

Build the plugin

If you download the source, you need to build the plugin. Make sure you have all the prerequisites installed and configured:

  • Grafana 9.0
  • Go 1.16+
  • Mage
  • NodeJS
  • yarn

Under the source directory, run the following commands:

yarn install
yarn build

#Run the following to update Grafana plugin SDK for Go dependency to the latest minor version:

go get -u github.com/grafana/grafana-plugin-sdk-go
go mod tidy

#Build backend plugin binaries for Linux, Windows and Darwin to dist directory:
mage -v

More details, please read the doc.

Grafana Configuration

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 for more details, including the default location of the config file depending on platform.

First, set paths.plugins to point to where this repo has been downloaded locally. The final build artifacts will be under the dist directory:

[paths]
plugins = /Users/alice/grafana/googlecloud-logging-datasource/dist

Next, update plugins.allow_loading_unsigned_plugins so that this plugin's ID is in the list:

[plugins]
allow_loading_unsigned_plugins = googlecloud-logging-datasource

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.

Code Reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.