@@ -21,6 +21,10 @@ pub const VERGEN_CARGO_TARGET_TRIPLE: &str = env!("VERGEN_CARGO_TARGET_TRIPLE");
2121/// The build features.
2222pub const VERGEN_CARGO_FEATURES : & str = env ! ( "VERGEN_CARGO_FEATURES" ) ;
2323
24+ /// The latest commit message and author name and email.
25+ pub const VERGEN_GIT_AUTHOR : & str = env ! ( "VERGEN_GIT_COMMIT_AUTHOR" ) ;
26+ pub const VERGEN_GIT_COMMIT_MESSAGE : & str = env ! ( "VERGEN_GIT_COMMIT_MESSAGE" ) ;
27+
2428/// The build profile name.
2529pub const BUILD_PROFILE_NAME : & str = env ! ( "OP_RBUILDER_BUILD_PROFILE" ) ;
2630
@@ -38,6 +42,8 @@ pub const LONG_VERSION: &str = concat!(
3842 env!( "OP_RBUILDER_LONG_VERSION_3" ) ,
3943 "\n " ,
4044 env!( "OP_RBUILDER_LONG_VERSION_4" ) ,
45+ "\n " ,
46+ env!( "OP_RBUILDER_LONG_VERSION_5" ) ,
4147) ;
4248
4349pub const VERSION : VersionInfo = VersionInfo {
@@ -47,6 +53,8 @@ pub const VERSION: VersionInfo = VersionInfo {
4753 git_sha : VERGEN_GIT_SHA ,
4854 target_triple : VERGEN_CARGO_TARGET_TRIPLE ,
4955 build_profile : BUILD_PROFILE_NAME ,
56+ commit_author : VERGEN_GIT_AUTHOR ,
57+ commit_message : VERGEN_GIT_COMMIT_MESSAGE ,
5058} ;
5159
5260/// op-rbuilder metrics
@@ -198,18 +206,24 @@ pub struct VersionInfo {
198206 pub target_triple : & ' static str ,
199207 /// The build profile (e.g., debug or release).
200208 pub build_profile : & ' static str ,
209+ /// The author of the latest commit.
210+ pub commit_author : & ' static str ,
211+ /// The message of the latest commit.
212+ pub commit_message : & ' static str ,
201213}
202214
203215impl VersionInfo {
204- /// This exposes reth 's version information over prometheus.
216+ /// This exposes op-rbuilder 's version information over prometheus.
205217 pub fn register_version_metrics ( & self ) {
206- let labels: [ ( & str , & str ) ; 6 ] = [
218+ let labels: [ ( & str , & str ) ; 8 ] = [
207219 ( "version" , self . version ) ,
208220 ( "build_timestamp" , self . build_timestamp ) ,
209221 ( "cargo_features" , self . cargo_features ) ,
210222 ( "git_sha" , self . git_sha ) ,
211223 ( "target_triple" , self . target_triple ) ,
212224 ( "build_profile" , self . build_profile ) ,
225+ ( "commit_author" , self . commit_author ) ,
226+ ( "commit_message" , self . commit_message ) ,
213227 ] ;
214228
215229 let gauge = gauge ! ( "builder_info" , & labels) ;
0 commit comments