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

feat: add ceramic_one_info metric #162

Merged
merged 3 commits into from
Nov 1, 2023
Merged

feat: add ceramic_one_info metric #162

merged 3 commits into from
Nov 1, 2023

Conversation

nathanielc
Copy link
Collaborator

@nathanielc nathanielc commented Oct 31, 2023

This adds an Info metric to ceramic so that we have no basic build/version information about the process.

Review Note

This change moves the one/src/main.rs to one/src/lib.rs so that we can export the Info type as needed. This makes the PR diff hard to read. But there are two separate commits, one where a git mv is used and another where the main.rs is added back in. This should mean reviewing the first commit only is what you really need to see.

one/src/lib.rs Show resolved Hide resolved
fn default() -> Self {
Self {
service_name: env!("CARGO_PKG_NAME").to_string(),
build: git_version::git_version!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a good or bad idea to have the binary hash itself and include the running bin hash in this info?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like it, its not a hash of the binary, but a hash of the git commit. Makes it very clear which exact commit of the code is being run.

Copy link
Contributor

Choose a reason for hiding this comment

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

I get that this is the commit.
My question was whether we want to also hash the binary at startup and also publish the bin hash with this info.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah I misread your comment. Let me try that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I got it working, turns out debug builds can be 1GB+ so I added logic to not hash for debug builds. Seems like a fair compromise as we likely only care about this for release builds.

Cargo.toml Outdated Show resolved Hide resolved
@nathanielc nathanielc changed the title feat: add cermaic_one_info metric feat: add ceramic_one_info metric Nov 1, 2023
@nathanielc nathanielc enabled auto-merge November 1, 2023 15:09
@nathanielc nathanielc added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit c9bd5f0 Nov 1, 2023
5 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