Skip to content

Comments

feat: metric for own version and startup timestamp#673

Merged
mergify[bot] merged 1 commit intosigp:release-v1.0.0from
dknopik:own-version-metric
Oct 9, 2025
Merged

feat: metric for own version and startup timestamp#673
mergify[bot] merged 1 commit intosigp:release-v1.0.0from
dknopik:own-version-metric

Conversation

@dknopik
Copy link
Member

@dknopik dknopik commented Oct 9, 2025

Issue Addressed

Proposed Changes

Steal some code from LH for version exposure via metrics. While I am at it I also took some code for startup timestamp, because why not.

@dknopik dknopik requested a review from petarjuki7 October 9, 2025 09:14
@dknopik dknopik added ready-for-review This PR is ready to be reviewed metrics v1.0.0 First Mainnet-release labels Oct 9, 2025
});

pub fn expose_process_start_time() {
match SystemTime::now().duration_since(UNIX_EPOCH) {
Copy link
Member

Choose a reason for hiding this comment

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

So we just expose the process start time (Unix timestamp) and then Prometheus / Grafana calculates the actual uptime / other metrics?

Copy link
Member Author

Choose a reason for hiding this comment

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

I assume grafana has some way to integrate current time into queries, so yeah!

As mentioned, this is how LH does it, so I assume it is possible to do something useful with this :D

@dknopik dknopik added ready-for-merge and removed ready-for-review This PR is ready to be reviewed labels Oct 9, 2025
@mergify mergify bot merged commit 31108ce into sigp:release-v1.0.0 Oct 9, 2025
15 checks passed
petarjuki7 pushed a commit to petarjuki7/anchor that referenced this pull request Oct 16, 2025
- sigp#652


  Steal some code from LH for version exposure via metrics. While I am at it I also took some code for startup timestamp, because why not.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants