Contributing to Thanos

This guide outlines how to contribute to the Thanos project.

Setting up your development environment

  1. Fork the repository: Create a fork of the official Thanos repository on GitHub.
  2. Clone your fork: Clone your forked repository to your local machine.
  3. Install Go: Ensure you have Go installed. The project uses Go version 1.18 or later. https://go.dev/doc/install
  4. Install dependencies: Run make install-tool-deps to install necessary tools.
  5. Run tests: Run make test to verify that your environment is set up correctly.

Finding issues to work on

  1. Browse the issue tracker: Find issues marked as “good first issue” or “help wanted” in the Thanos repository. https://github.com/thanos-io/thanos/issues
  2. Check the project roadmap: Review the project roadmap to identify areas where your contributions would be most valuable. https://github.com/thanos-io/thanos/projects
  3. Participate in discussions: Engage in discussions on GitHub issues and pull requests to understand the project’s needs and priorities.

Making contributions

  1. Create a new branch: Create a new branch from the main branch for your changes.
  2. Implement your changes: Follow the project’s coding style and best practices.
  3. Write unit tests: Ensure your changes are covered by appropriate tests.
  4. Document your changes: Update relevant documentation to reflect your contributions.
  5. Submit a pull request: Create a pull request to the official Thanos repository, referencing the relevant issue.

Coding style and best practices

Building and testing your changes

  • Building: Use make to build all Thanos components.
  • Testing: Run make test to execute unit and integration tests.
  • Docker images: Use make docker to build Docker images for Thanos.
  • End-to-end tests: Run make test-e2e for end-to-end testing.

Reviewing and merging your contributions

  • Code review: Once your pull request is submitted, it will be reviewed by the project maintainers.
  • Addressing feedback: Respond to comments and address any feedback provided during the review.
  • Merging: Once your changes are approved, they will be merged into the main branch.

Getting help

Additional tips

  • Start small: Begin by contributing small fixes or improvements to gain familiarity with the project.
  • Be patient: The review process can take time, so be patient and responsive to feedback.
  • Enjoy the process: Contributing to open-source projects is a rewarding experience.