Skip to content
Snippets Groups Projects
After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.
CONTRIBUTING.md 15.82 KiB

Contributing to opentelemetry-go

The Go special interest group (SIG) meets regularly. See the OpenTelemetry community repo for information on this and other language SIGs.

See the public meeting notes for a summary description of past meetings. To request edit access, join the meeting or get in touch on Slack.

Development

You can view and edit the source code by cloning this repository:

git clone https://github.com/open-telemetry/opentelemetry-go.git

Run make test to run the tests instead of go test.

There are some generated files checked into the repo. To make sure that the generated files are up-to-date, run make (or make precommit - the precommit target is the default).

The precommit target also fixes the formatting of the code and checks the status of the go module files.

If after running make precommit the output of git status contains nothing to commit, working tree clean then it means that everything is up-to-date and properly formatted.

Pull Requests

How to Send Pull Requests

Everyone is welcome to contribute code to opentelemetry-go via GitHub pull requests (PRs).

To create a new PR, fork the project in GitHub and clone the upstream repo:

go get -d go.opentelemetry.io/otel

(This may print some warning about "build constraints exclude all Go files", just ignore it.)

This will put the project in ${GOPATH}/src/go.opentelemetry.io/otel. You can alternatively use git directly with:

git clone https://github.com/open-telemetry/opentelemetry-go

(Note that git clone is not using the go.opentelemetry.io/otel name - that name is a kind of a redirector to GitHub that go get can understand, but git does not.)

This would put the project in the opentelemetry-go directory in current working directory.

Enter the newly created directory and add your fork as a new remote:

git remote add <YOUR_FORK> git@github.com:<YOUR_GITHUB_USERNAME>/opentelemetry-go

Check out a new branch, make modifications, run linters and tests, update CHANGELOG.md, and push the branch to your fork:

git checkout -b <YOUR_BRANCH_NAME>
# edit files
# update changelog
make precommit
git add -p
git commit
git push <YOUR_FORK> <YOUR_BRANCH_NAME>

Open a pull request against the main opentelemetry-go repo. Be sure to add the pull request ID to the entry you added to CHANGELOG.md.

How to Receive Comments

  • If the PR is not ready for review, please put [WIP] in the title, tag it as work-in-progress, or mark it as draft.
  • Make sure CLA is signed and CI is clear.

How to Get PRs Merged

A PR is considered to be ready to merge when:

  • It has received two approvals from Collaborators/Maintainers (at different companies). This is not enforced through technical means and a PR may be ready to merge with a single approval if the change and its approach have been discussed and consensus reached.
  • Feedback has been addressed.
  • Any substantive changes to your PR will require that you clear any prior Approval reviews, this includes changes resulting from other feedback. Unless the approver explicitly stated that their approval will persist across changes it should be assumed that the PR needs their review again. Other project members (e.g. approvers, maintainers) can help with this if there are any questions or if you forget to clear reviews.
  • It has been open for review for at least one working day. This gives people reasonable time to review.
  • Trivial changes (typo, cosmetic, doc, etc.) do not have to wait for one day and may be merged with a single Maintainer's approval.
  • CHANGELOG.md has been updated to reflect what has been added, changed, removed, or fixed.
  • README.md has been updated if necessary.
  • Urgent fix can take exception as long as it has been actively communicated.

Any Maintainer can merge the PR once it is ready to merge.

Design Choices

As with other OpenTelemetry clients, opentelemetry-go follows the opentelemetry-specification.

It's especially valuable to read through the library guidelines.

Focus on Capabilities, Not Structure Compliance

OpenTelemetry is an evolving specification, one where the desires and use cases are clear, but the method to satisfy those uses cases are not.

As such, Contributions should provide functionality and behavior that conforms to the specification, but the interface and structure is flexible.

It is preferable to have contributions follow the idioms of the language rather than conform to specific API names or argument patterns in the spec.

For a deeper discussion, see this.

Documentation