Process

This outline covers the release process for the Jaeger library.

Release Process

  1. Create a new branch from main for the release, e.g. release/v1.23.0.
  2. Update the version in Gopkg.toml and README.md for the new release.
  3. Run tests and ensure code coverage is satisfactory.
  4. Create a pull request to main.
    • Include a summary of changes and note the new version.
    • The PR should be reviewed and approved by other developers.
  5. Merge the PR to main.
  6. Create a new tag on main for the release, e.g. v1.23.0.
    • The tag should be annotated with a message describing the release.
  7. Publish the release to GitHub.
    • Ensure that the release notes describe the changes in the release.

Developer Certificate of Origin (DCO)

All contributors must sign off on their commits with a Developer Certificate of Origin (DCO) to confirm that they have the right to contribute their code to the project.

Example Commit:

git commit -s -m "Fix: Update documentation for v1.23.0"
          

Versioning

The library uses semantic versioning.

Dependencies

Dependencies are managed using Gopkg.toml.

Build & Test

  • The project is built and tested using go and make.
  • Unit tests are run using go test.
  • Code linting is done using golint.
  • Code formatting is checked using gofmt.

Metrics

The Jaeger library provides a comprehensive metrics system built on top of the Go kit library.

Contribution Guidelines

Code Snippets

Timer Implementation

// Timer accumulates observations about how long some operation took,
          // and also maintains a historgam of percentiles.
          type Timer interface {
              // Records the time passed in.
              Record(time.Duration)
          }
          

Metrics Backend Clear Function

// Clear discards accumulated stats
          func (b *Backend) Clear() {
              b.cm.Lock()
              defer b.cm.Unlock()
              b.gm.Lock()
              defer b.gm.Unlock()
              b.tm.Lock()
              defer b.tm.Unlock()
              b.hm.Lock()
              defer b.hm.Unlock()
              b.counters = make(map[string]*int64)
              b.gauges = make(map[string]*int64)
              b.timers = make(map[string]*localBackendTimer)
              b.histograms = make(map[string]*localBackendHistogram)
          }
          

Metrics Backend Run Loop

func (b *Backend) runLoop(collectionInterval time.Duration) {
              defer b.wg.Done()
              ticker := time.NewTicker(collectionInterval)
              for {
                  select {
                  case <-ticker.C:
                      b.tm.Lock()
                      timers := make(map[string]*localBackendTimer, len(b.timers))
                      for timerName, timer := range b.timers {
                          timers[timerName] = timer
                      }
                      b.tm.Unlock()
          
                      for _, t := range timers {
                          t.Lock()
                          t.hist.Rotate()
                          t.Unlock()
                      }
                  case <-b.stop:
                      ticker.Stop()
                      return
                  }
              }
          }
          

Metrics Backend Stop Function

// Stop cleanly closes the background goroutine spawned by NewBackend.
          func (b *Backend) Stop() {
              close(b.stop)
              b.wg.Wait()
          }
          

License

The Jaeger library is licensed under the Apache 2.0 License.


          ## Top-Level Directory Explanations
          
          <a class='local-link directory-link' data-ref="metrics/" href="#metrics/">metrics/</a> - This directory contains the metrics implementation for the Jaeger Tracing library.
          
          <a class='local-link directory-link' data-ref="metrics/adapters/" href="#metrics/adapters/">metrics/adapters/</a> - This subdirectory contains the various metric adapters for different backends.
          
          <a class='local-link directory-link' data-ref="metrics/expvar/" href="#metrics/expvar/">metrics/expvar/</a> - This subdirectory contains the implementation for exposing metrics as HTTP endpoints using the expvar package.
          
          <a class='local-link directory-link' data-ref="metrics/fork/" href="#metrics/fork/">metrics/fork/</a> - This subdirectory contains the implementation for forking metrics between processes.
          
          <a class='local-link directory-link' data-ref="metrics/go-kit/" href="#metrics/go-kit/">metrics/go-kit/</a> - This subdirectory contains the Go-Kit integration for the Jaeger Tracing library.
          
          <a class='local-link directory-link' data-ref="metrics/go-kit/influx/" href="#metrics/go-kit/influx/">metrics/go-kit/influx/</a> - This subdirectory contains the InfluxDB implementation for the Go-Kit integration.
          
          <a class='local-link directory-link' data-ref="metrics/metricstest/" href="#metrics/metricstest/">metrics/metricstest/</a> - This subdirectory contains the testing implementation for the metrics.
          
          <a class='local-link directory-link' data-ref="metrics/multi/" href="#metrics/multi/">metrics/multi/</a> - This subdirectory contains the implementation for collecting metrics from multiple sources.
          
          <a class='local-link directory-link' data-ref="metrics/prometheus/" href="#metrics/prometheus/">metrics/prometheus/</a> - This subdirectory contains the Prometheus implementation for the Jaeger Tracing library.
          
          <a class='local-link directory-link' data-ref="metrics/tally/" href="#metrics/tally/">metrics/tally/</a> - This subdirectory contains the implementation for counting metrics using the tally package.
          
          <a class='local-link directory-link' data-ref="scripts/" href="#scripts/">scripts/</a> - This directory contains various scripts for the project.