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

docs: generate admin/prometheus.md dynamically #13223

Open
dannykopping opened this issue May 10, 2024 · 1 comment
Open

docs: generate admin/prometheus.md dynamically #13223

dannykopping opened this issue May 10, 2024 · 1 comment
Labels
chore Non-customer facing refactors, cleanup, or technical debt. docs Area: docs

Comments

@dannykopping
Copy link
Contributor

scripts/metricsdocgen generates this list of available metrics. However, it relies on a static dump of metrics from scripts/metricsdocgen/metrics; this means that new metrics are not automatically detected.

We can generate this list of metrics more reliably by calling CODER_PROMETHEUS_ENABLE=true coder server and add some kind of flag to force a dump of metrics like so:

--- a/cli/server.go
+++ b/cli/server.go
@@ -1016,6 +1016,8 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
                                }
                        }
 
+                       prometheus.WriteToTextfile("./scripts/metricsdocgen/metrics", promRegistry)
+
                        eg := errgroup.Group{}
                        eg.Go(func() error {
                                defer closeListenersNow()

This won't catch any metrics for which there have not been any collected values yet, however, but it's a step closer.

@mtojek what do you think?

@coder-labeler coder-labeler bot added chore Non-customer facing refactors, cleanup, or technical debt. docs Area: docs labels May 10, 2024
@mtojek
Copy link
Member

mtojek commented May 10, 2024

AFAIR It was the original idea, but too many metrics were skipped. It might be hard to decide when is the cut-off point, so the list is stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Non-customer facing refactors, cleanup, or technical debt. docs Area: docs
Projects
None yet
Development

No branches or pull requests

2 participants