Production Deployment

Prerequisites

Before deploying jaeger-lib in a production environment, ensure the following dependencies are addressed:

  1. Go environment setup: Ensure you have Go installed and properly configured.
  2. Dependencies: Verify all dependencies listed in Gopkg.toml are available. The libraries include go-kit, hdrhistogram-go, tally, prometheus/client_golang, and testify.

Step-by-Step Deployment

  1. Clone the repository:

    git clone https://github.com/jaegertracing/jaeger-lib.git
    cd jaeger-lib
    
  2. Install Dependencies:

    Use the provided Makefile to install any necessary dependencies before building:

    make install-dep
    
  3. 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 as GOTEST, GOLINT, GOVET, and GOFMT to facilitate this step:

    .PHONY: test-and-lint
    test-and-lint: test fmt lint
    
  4. 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 from jaeger-lib:

    import "github.com/uber/jaeger-lib"
    

    Then, you can compile your application normally:

    go build ./...
    
  5. 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.

  6. 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.

  7. Verification:

    After deployment, monitor the application for any issues. Ensure tracing is functioning as expected, and metrics are being collected correctly.

  8. 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)