Skip to content

How-to install Prometheus Client in the C++ SDK CI Environment #291

@CunjunWang

Description

@CunjunWang

Is your feature request related to a problem?
Yes it is. The C++ Prometheus Exporter uses the Prometheus client as a project dependency, so we need to install it in the CI environment to build the project. Currently we have found three ways to address this issue:

  1. Install the Prometheus Client in a Windows/Visual Studio IDE environment with vcpkg, and write similar scripts to install and setup in Linux and MacOS.
  2. Use git submodule and include Prometheus client as a submodule of the OpenTelemetry-cpp project.
  3. Use a Github Actions to add a linux container and install the dependencies for testing.

We would like to get definitive guidance on the best way to install the Prometheus client specific to the OpenTelemetry C++ environment. Currently this is a blocker for us to complete our Prometheus exporter (#280) project.

Describe the solution you'd like
We have provided the pros and cons of all three solutions.

1: Using vcpkg for Windows and writing additional scripts for Linux and MacOS:

  • Pros:
    • Conforms to the current process in the project to add new dependencies.
  • Cons:
    • Maintaining multiple scripts customized for each OS is not ideal from a maintainability pov. As the project adds more functionality, it may add more dependencies too. Having multiple scripts for each OS will increase maintenance (CI and testing).
    • Lack of familiarity with C++ repo CI configurations needs maintainer guidance on instructions on CI scripts.

2: Using git submodule

  • Pros:
    • This is an organized and elegant way to manager third-party dependencies for C++ projects.
    • OpenTelemetry Java also uses this solution.
  • Cons:
    • The environment for using git submodule is not setup yet in the project and may require some major changes in the project structure.
    • The CI setup may need to change accordingly. This is something we as members don’t have rights to do.

3: Using GitHub Actions

  • Pros:
    • There are some examples in the OpenTelemetry-dotnet repo.
  • Cons:
    • This needs familiarity on Docker and container setup.
    • Need more documentation to understand the workflow.
      • Is this container still a part of the CI test?
      • If the Prometheus client is installed in the container, how other CI tests pass when they are also dependent it to build?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions