Process
This outline covers the release process for the Jaeger library.
Release Process
- Create a new branch from
main
for the release, e.g.release/v1.23.0
. - Update the version in
Gopkg.toml
andREADME.md
for the new release. - Run tests and ensure code coverage is satisfactory.
- Code coverage is monitored by Coveralls.
- 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.
- Merge the PR to
main
. - 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.
- 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.
- Source: DCO
Example Commit:
git commit -s -m "Fix: Update documentation for v1.23.0"
Versioning
The library uses semantic versioning.
- Source: README.md
Dependencies
Dependencies are managed using Gopkg.toml
.
- Source: Gopkg.toml
Build & Test
- The project is built and tested using
go
andmake
. - Unit tests are run using
go test
. - Code linting is done using
golint
. - Code formatting is checked using
gofmt
.
- Source: Makefile
Metrics
The Jaeger library provides a comprehensive metrics system built on top of the Go kit library.
- Source: metrics
- Timer: metrics/timer.go
- Metrics Tests: metrics/metricstest/local.go
- Example: metrics/go-kit/influx/factory_test.go
- Init Metrics: metrics/metrics_test.go
- Adapters: metrics/adapters/factory_test.go
- Factory: metrics/go-kit/influx/factory.go
- Prometheus: metrics/prometheus/factory_test.go
- Tally: metrics/tally/factory_test.go
Contribution Guidelines
- Please see CONTRIBUTING.md for detailed 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)
}
- Source: metrics/timer.go
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)
}
- Source: metrics/metricstest/local.go
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
}
}
}
- Source: metrics/metricstest/local.go
Metrics Backend Stop Function
// Stop cleanly closes the background goroutine spawned by NewBackend.
func (b *Backend) Stop() {
close(b.stop)
b.wg.Wait()
}
- Source: metrics/metricstest/local.go
License
The Jaeger library is licensed under the Apache 2.0 License.
- Source: README.md
## 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.