Skip to content

Latest commit

 

History

History
95 lines (57 loc) · 3.72 KB

CONTRIBUTING.md

File metadata and controls

95 lines (57 loc) · 3.72 KB

Contributing

Prometheus RDS exporter uses GitHub to manage reviews of pull requests.

Steps to Contribute

Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.

All our issues are regularly tagged so you can filter down the issues involving the components you want to work on.

For quickly compiling and testing your changes do:

# For building.
make build
./prometheus-rds-exporter

# For testing.
make test         # Make sure all the tests pass before you commit and push :)

We use:

  • pre-commit to make right first time changes. Enable it for this repository with pre-commit install.

  • golangci-lint for linting the code. If it reports an issue and you think that the warning needs to be disregarded or is a false-positive, you can add a special comment //nolint:linter1[,linter2,...] before the offending line. Use this sparingly though, fixing the code to comply with the linter's recommendation is in general the preferred course of action.

  • markdownlint-cli2 for linting the Markdown documents.

  • yamllint for linting the YAML documents.

Pull Request Checklist

  • Branch from the main branch and, if needed, rebase to the current main branch before submitting your pull request. If it doesn't merge cleanly with main you may be asked to rebase your changes.

  • Commits should be as small as possible while ensuring each commit is correct independently (i.e., each commit should compile and pass tests).

  • Add tests relevant to the fixed bug or new feature.

  • New Prometheus metrics must follow the metric and label naming guidelines and be added in the README.md.

Dependency management

Project uses Go modules to manage dependencies on external packages.

To add or update a new dependency, use the go get command:

# Pick the latest tagged release.
go get example.com/some/module/pkg@latest

# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z

Tidy up the go.mod and go.sum files:

# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy

You have to commit the changes to go.mod and go.sum before submitting the pull request.

Install pre-commit

  1. Install pre-commit

  2. Install markdownlint-cli2

  3. Install go-jsonnet to build Grafana dashboards

  4. Enable pre-commit for the repository

    pre-commit install

Update dashboard

Please open a Github issue with your suggestion if you want to change dashboards (feel free to attach your changes in as JSON dashboard).

For project's maintainers, look at Grafana dashboard update