Skip to content

Add Prometheus labels for Cardano build info display #646

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

Merged
merged 2 commits into from
May 13, 2024

Conversation

jutaro
Copy link
Contributor

@jutaro jutaro commented May 13, 2024

This pull request enhances the Cardano build info display by adding support for Prometheus labels. By incorporating Prometheus labels into the build info metrics, we improve monitoring and observability capabilities for Cardano nodes.

This is a restricted solution, which allows metrics with labels only with a value of 1.

@jutaro jutaro requested a review from erikd as a code owner May 13, 2024 12:00
Label l -> trace ("renderSamples " <> T.unpack l) $
if "{" `T.isPrefixOf` l
then renderLabel sk l
else renderNamedValue sk (byteString $ encodeUtf8 l)
_ -> mempty
Copy link

@mgmeier mgmeier May 13, 2024

Choose a reason for hiding this comment

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

Please remove debug code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, sorry

Label l -> if isFloat l
then renderNamedValue sk (byteString $ encodeUtf8 l)
else mempty
Label l -> trace ("renderSamples " <> T.unpack l) $
Copy link

@mgmeier mgmeier May 13, 2024

Choose a reason for hiding this comment

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

What happened to the mempty result when isFloat is False? We should leave that behaviour unchanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I revert it (so the secret treasures will never be seen :)

Copy link

@Icelandjack Icelandjack 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

Copy link

@mgmeier mgmeier left a comment

Choose a reason for hiding this comment

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

LGTM thanks @jutaro

@disassembler disassembler merged commit 998ce32 into master May 13, 2024
11 of 12 checks passed
@disassembler disassembler deleted the jutaro/ekg-labels branch May 13, 2024 17:25
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.

4 participants