Add build info metric to pageserver, safekeeper and proxy (#2596)

* Test that we emit build info metric for pageserver, safekeeper and proxy with some non-zero length revision label

* Emit libmetrics_build_info on startup of pageserver, safekeeper and
proxy with label "revision" which tells the git revision.
This commit is contained in:
Lassi Pölönen
2022-10-11 09:54:32 +03:00
committed by GitHub
parent 241e549757
commit e520293090
6 changed files with 42 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ use anyhow::{bail, Context};
use clap::{self, Arg};
use config::ProxyConfig;
use futures::FutureExt;
use metrics::set_build_info_metric;
use std::{borrow::Cow, future::Future, net::SocketAddr};
use tokio::{net::TcpListener, task::JoinError};
use tracing::info;
@@ -166,6 +167,7 @@ async fn main() -> anyhow::Result<()> {
]
.map(flatten_err);
set_build_info_metric(GIT_VERSION);
// This will block until all tasks have completed.
// Furthermore, the first one to fail will cancel the rest.
let _: Vec<()> = futures::future::try_join_all(tasks).await?;