-
Notifications
You must be signed in to change notification settings - Fork 500
[EXPORTER] bump prometheus to v1.3.0 #3122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a0fc98a
bump prometheus to v1.3.0
esigo 2839ae5
chnagelog
esigo 051f89a
Merge branch 'main' into bump-prometheus-1.3.0
esigo 12fe684
Merge branch 'main' into bump-prometheus-1.3.0
marcalff 42d4950
review comment
esigo a3150c8
Apply suggestions from code review
marcalff c35b593
Merge branch 'main' into bump-prometheus-1.3.0
ThomsonTan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -442,3 +442,155 @@ Last, in some special case like name collisions for a given symbol, | |
the template itself may need to be adjusted for special logic. | ||
|
||
See for example how `messaging.client_id` is treated. | ||
|
||
## prometheus-cpp | ||
|
||
### Comments (prometheus-cpp) | ||
|
||
The `prometheus-cpp` library provides a C++ client for Prometheus, facilitating the creation and registration of metrics that Prometheus scrapes. `prometheus-cpp` is used as a git submodule under the `third_party` directory for ease of inclusion in build system. | ||
|
||
### Origin (prometheus-cpp) | ||
|
||
The repository for `prometheus-cpp` can be found here: | ||
|
||
- [repository](https://github.com/jupp0r/prometheus-cpp) | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Check release notes at: | ||
|
||
- [release-notes](https://github.com/jupp0r/prometheus-cpp/releases) | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### Upgrade (prometheus-cpp) | ||
|
||
When upgrading `prometheus-cpp` to a newer release, you’ll need to update a few key files in the codebase to reflect the new version. | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
In this example, we upgrade from `v1.2.3` to `v1.2.4`. | ||
|
||
#### Directory `third_party/prometheus-cpp` | ||
|
||
`prometheus-cpp` is a `git submodule`, so it needs to be pointed to the new release tag. | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```shell | ||
cd third_party/prometheus-cpp | ||
git log -1 | ||
``` | ||
|
||
The current submodule should show something like: | ||
|
||
```shell | ||
commit abcdef1234567890abcdef1234567890abcdef12 (HEAD, tag: v1.2.3) | ||
Author: John Doe <[email protected]> | ||
Date: Fri Apr 25 17:55:35 2024 +0200 | ||
|
||
Minor fixes for performance and compatibility | ||
``` | ||
|
||
Pull new tags: | ||
|
||
```shell | ||
git pull --tag origin | ||
``` | ||
|
||
Upgrade to the new tag: | ||
|
||
```shell | ||
git pull origin v1.2.4 | ||
``` | ||
|
||
Verify the new commit: | ||
|
||
```shell | ||
git log -1 | ||
commit 1234567890abcdef1234567890abcdef12345678 (HEAD, tag: v1.2.4) | ||
Author: Jane Doe <[email protected]> | ||
Date: Thu Jun 28 08:19:11 2024 -0500 | ||
|
||
Improved metrics handling for high concurrency | ||
``` | ||
|
||
Return to the root directory: | ||
|
||
```shell | ||
cd ../.. | ||
git status | ||
``` | ||
|
||
The status should display: | ||
|
||
```shell | ||
On branch upgrade_prometheus_1.2.4 | ||
Changes not staged for commit: | ||
(use "git add <file>..." to update what will be committed) | ||
(use "git restore <file>..." to discard changes in working directory) | ||
modified: third_party/prometheus-cpp (new commits) | ||
``` | ||
|
||
Add the upgraded submodule: | ||
|
||
```shell | ||
git add third_party/prometheus-cpp | ||
``` | ||
|
||
File third_party_release | ||
Update the line referencing the prometheus-cpp version. | ||
|
||
```shell | ||
prometheus-cpp=v1.2.4 | ||
``` | ||
|
||
Example change: | ||
|
||
```shell | ||
$ git diff third_party_release | ||
diff --git a/third_party_release b/third_party_release | ||
index abc1234..def5678 100644 | ||
--- a/third_party_release | ||
+++ b/third_party_release | ||
@@ -19,7 +19,7 @@ some-dependency=v0.8.3 | ||
another-dependency=1.14.0 | ||
prometheus-cpp=v1.2.3 | ||
+prometheus-cpp=v1.2.4 | ||
``` | ||
|
||
In file bazel/repository.bzl locate the entry for prometheus-cpp: | ||
|
||
```shell | ||
# C++ Prometheus Client library. | ||
maybe( | ||
http_archive, | ||
name = "com_github_jupp0r_prometheus_cpp", | ||
sha256 = "ac6e958405a29fbbea9db70b00fa3c420e16ad32e1baf941ab233ba031dd72ee", | ||
strip_prefix = "prometheus-cpp-1.2.3", | ||
urls = [ | ||
"https://github.com/jupp0r/prometheus-cpp/archive/refs/tags/v1.2.3.tar.gz", | ||
], | ||
) | ||
``` | ||
|
||
Update the URL to the new tag: | ||
|
||
```shell | ||
urls = [ | ||
"https://github.com/jupp0r/prometheus-cpp/archive/v1.2.4.tar.gz", | ||
], | ||
``` | ||
|
||
Update strip_prefix to match the new version: | ||
|
||
```shell | ||
strip_prefix = "prometheus-cpp-1.2.4", | ||
``` | ||
|
||
Download the new URL: | ||
|
||
```shell | ||
wget https://github.com/jupp0r/prometheus-cpp/archive/v1.2.4.tar.gz | ||
``` | ||
|
||
Calculate the checksum: | ||
|
||
```shell | ||
sha256sum v1.2.4.tar.gz | ||
abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234 v1.2.4.tar.gz | ||
``` | ||
|
||
Update the `sha256`. |
Submodule prometheus-cpp
updated
27 files
+5 −2 | .bazelrc | |
+1 −1 | .github/workflows/bazel-ci.yml | |
+3 −3 | .github/workflows/cmake-ci.yml | |
+2 −2 | .github/workflows/coverage.yml | |
+1 −1 | .github/workflows/doxygen.yml | |
+2 −2 | .github/workflows/linting.yml | |
+1 −1 | .github/workflows/release.yml | |
+8 −2 | CMakeLists.txt | |
+7 −11 | MODULE.bazel | |
+423 −1,678 | MODULE.bazel.lock | |
+22 −38 | README.md | |
+3 −3 | bazel/civetweb.BUILD | |
+1 −0 | bazel/curl.bzl | |
+6 −15 | bazel/repositories.bzl | |
+4 −0 | cmake/project-import-cmake/CMakeLists.txt | |
+2 −2 | cmake/prometheus-cpp-push.pc.in | |
+3 −3 | core/CMakeLists.txt | |
+1 −13 | pull/BUILD.bazel | |
+1 −4 | pull/tests/unit/BUILD.bazel | |
+1 −1 | push/CMakeLists.txt | |
+12 −1 | push/include/prometheus/gateway.h | |
+11 −14 | push/src/detail/curl_wrapper.cc | |
+4 −3 | push/src/detail/curl_wrapper.h | |
+53 −11 | push/src/gateway.cc | |
+1 −4 | push/tests/internal/BUILD.bazel | |
+1 −7 | util/BUILD.bazel | |
+1 −4 | util/tests/unit/BUILD.bazel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.