Skip to content

Document Prometheus metics #750

Merged
Choraden merged 6 commits intomainfrom
mmt/prom_docs
Mar 21, 2024
Merged

Document Prometheus metics #750
Choraden merged 6 commits intomainfrom
mmt/prom_docs

Conversation

@mmatczuk
Copy link
Contributor

@mmatczuk mmatczuk commented Mar 20, 2024

Sample page

image

Implementation based on parsing Desc.String() output due to lack of proper APIs.
Things could have been easier but Scanf is confused with {},.
Print prometheus metrics as JSON to stderr.
We use stderr to avoid conflict with logs.
@mmatczuk mmatczuk requested a review from Choraden as a code owner March 20, 2024 15:13

Labels:
- host
### `forwarder_dialer_dialed_total`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have an empty line between labels and new metric. It does not matter in the final md output, yet it just feels better.

}

fmt.Fprintf(f, "---\n")
fmt.Fprintf(f, "title: Metrics\n")
Copy link
Contributor

@Choraden Choraden Mar 21, 2024

Choose a reason for hiding this comment

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

Let's also add id: cmd.Name() +"metrics". It's needed for sc docs.

Copy link
Contributor

@Choraden Choraden left a comment

Choose a reason for hiding this comment

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

LGTM

@Choraden Choraden merged commit 5c80bb9 into main Mar 21, 2024
@Choraden Choraden deleted the mmt/prom_docs branch March 21, 2024 12:36
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