Prometheus RDS exporter uses GitHub to manage reviews of pull requests.
-
If you are a new contributor, see: Steps to Contribute
-
If you have a trivial fix or improvement, go ahead and create a pull request
-
Relevant coding style guidelines are the Go Code Review Comments and the Formatting and style section of Peter Bourgon's Go: Best Practices for Production Environments.
-
Be sure to enable signed commits
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 withpre-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.
-
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
.
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
-
Install markdownlint-cli2
-
Install go-jsonnet to build Grafana dashboards
-
Enable pre-commit for the repository
pre-commit install
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