Production Deployment
Prerequisites
Before deploying jaeger-lib
in a production environment, ensure the following dependencies are addressed:
- Go environment setup: Ensure you have Go installed and properly configured.
- Dependencies: Verify all dependencies listed in
Gopkg.toml
are available. The libraries includego-kit
,hdrhistogram-go
,tally
,prometheus/client_golang
, andtestify
.
Step-by-Step Deployment
Clone the repository:
git clone https://github.com/jaegertracing/jaeger-lib.git cd jaeger-lib
Install Dependencies:
Use the provided Makefile to install any necessary dependencies before building:
make install-dep
Run Tests and Lint:
It is essential to confirm the correct functionality of the library before deployment. Execute the following command to run tests and validate code formatting and linting:
make test-and-lint
This command leverages the default goal in the Makefile that includes running both tests and linters. The
Makefile
defines various commands, such asGOTEST
,GOLINT
,GOVET
, andGOFMT
to facilitate this step:.PHONY: test-and-lint test-and-lint: test fmt lint
Building the Library:
While
jaeger-lib
is not intended for standalone deployment, you may first build any components or services depending on it. Make sure to include proper imports in your application fromjaeger-lib
:import "github.com/uber/jaeger-lib"
Then, you can compile your application normally:
go build ./...
Prepare for Release:
If changes have been made to the library and you are preparing for a release, create a pull request with the changes made and title it appropriately, following the format: “Preparing release X.Y.Z”.
Add recent changes to the
CHANGELOG.md
using:git log --pretty=format:'- %s -- %an'
Upon merging the pull request, create a release on GitHub, e.g.,
v2.1.0
.Deployment:
To deploy
jaeger-lib
, integrate it with your application as needed. Ensure that your application can handle instrumentation and tracing, leveraging the capabilities of the library. Practically, this may involve:- Integration with
go-kit
metrics or other instrumentation tools. - Ensuring your application sends traces or metrics to the Jaeger backend.
If your application is structured properly with respect to Go conventions, deploying to a production environment can be done through Docker or directly on your host, depending on your deployment strategy.
- Integration with
Verification:
After deployment, monitor the application for any issues. Ensure tracing is functioning as expected, and metrics are being collected correctly.
Maintenance:
Regularly update the dependencies and review for any new features or critical updates provided by the
jaeger-lib
. This can help in ensuring that the production system is using the latest improvements and security patches.
Celebrating the successful deployment is always a good practice to encourage further contributions and improvements.
Conclusion
The process of deploying jaeger-lib
in a production environment entails preparation, a well-defined deployment strategy, and continuous monitoring to ensure that the application behaves as expected. Following these steps helps maintain a robust and resilient application using the tracing capabilities provided by jaeger-lib
.
(Information sourced from Makefile and RELEASE.md)