Skip to content
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

Add an outpack_server_build_info metric. #67

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

plietar
Copy link
Member

@plietar plietar commented Aug 28, 2024

This describes the server's version and build environment. For now it only contains the version number (as specified in the Cargo.toml), the git revision and the Rust version used in the build.

The versions are listed as labels, and the metric has a value of 1. This follows the convention that is widespread in the Prometheus ecosystem.

This is what the resulting metric might look like:

outpack_server_build_info{revision="dd6b97db1f52ece5ea4b635ec43655d005ad7627",rustc="1.78.0",version="0.3.0"} 1

@plietar plietar requested a review from M-Kusumgar August 28, 2024 19:16
@plietar plietar force-pushed the mrc-5004-buildinfo branch from b68feb1 to 42032c6 Compare August 28, 2024 20:03
Copy link
Contributor

@M-Kusumgar M-Kusumgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Comment on lines +234 to +236
env!("CARGO_PKG_VERSION"),
env!("VERGEN_GIT_SHA"),
env!("VERGEN_RUSTC_SEMVER"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are set by default im assuming?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CARGO_PKG_VERSION is set automatically by Cargo. The VERGEN_* ones are set by the build script, using the vergen crate.

Note that env! looks up environment variables at build time, not runtime.

@plietar plietar changed the base branch from mrc-5721-process-metrics to main August 29, 2024 12:20
This describes the server's version and build environment.
For now it only contains the version number (as specified in the
`Cargo.toml`), the git revision and the Rust version used in the build.

The versions are listed as labels, and the metric has a value of 1.
This follows the convention that is widespread in the Prometheus
ecosystem.

This is what the resulting metric might look like:
```
outpack_server_build_info{revision="dd6b97db1f52ece5ea4b635ec43655d005ad7627",rustc="1.78.0",version="0.3.0"} 1
```
@plietar plietar force-pushed the mrc-5004-buildinfo branch from 42032c6 to 0c7fb91 Compare August 29, 2024 12:24
@plietar plietar merged commit 1078d27 into main Aug 29, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants