feat(scripts/metricsdocgen): add prometheus.NewDesc() pattern to metrics scanner - #21461
Conversation
95bcc37 to
c3053d7
Compare
f64fdaf to
d2a562c
Compare
c3053d7 to
c591965
Compare
d2a562c to
4340913
Compare
c591965 to
d253ee8
Compare
b52d9eb to
44b7bba
Compare
b487f0c to
aee2d85
Compare
70d2452 to
a14ee38
Compare
| // Example: | ||
| // - "coderd_" + "api_" + "requests": "coderd_api_requests" | ||
| // - namespace + "_" + metricName: resolved concatenation | ||
| func resolveBinaryExpr(expr *ast.BinaryExpr, decls declarations) string { |
There was a problem hiding this comment.
ugh... I trust you that it works the right way, although some tests would be helpful.
There was a problem hiding this comment.
Agree, but unfortunately didn't have time for tests. Tthis is currently working as seen by the generated file: scripts/metricsdocgen/generated_metrics. But yes, tests would be great for future metric changes on the codebase.
aee2d85 to
b8b4331
Compare
a14ee38 to
7464012
Compare
b8b4331 to
c6638df
Compare
7464012 to
0462360
Compare
Documentation CheckNo Changes NeededThis PR enhances the internal metrics scanner tool ( Since the PR updates the code generation tool (not user-facing features), and the generated metrics are already documented via the auto-generated table at lines 105-199 of The newly extracted metrics (pubsub, insights, license, and prebuilt workspace metrics) are already present in the generated table in the documentation. Automated review via Coder Tasks |
c6638df to
a370b3f
Compare
0462360 to
2caf0ad
Compare
Documentation CheckPrevious FeedbackThe previous review stated metrics were already documented, but this was inaccurate. The metrics will be documented when the stack completes. No Changes Needed (for this PR)This PR (#21461) is part of a stack that implements automatic metrics documentation generation:
The newly extracted metrics in
These metrics are not yet in the documentation because:
No documentation changes needed in this PR - the infrastructure PR is working as designed. The documentation will be automatically updated by the build process once the full stack lands. Automated review via Coder Tasks |
a370b3f to
ca70f52
Compare
2b637bb to
fd7a05c
Compare
65dbf29 to
0f1be8c
Compare
fd7a05c to
a65ba82
Compare
0f1be8c to
1bdb883
Compare
a65ba82 to
1ada5a6
Compare
1bdb883 to
f7f0213
Compare
36ce1aa to
27c0d16
Compare
Merge activity
|
27c0d16 to
f0cb7f3
Compare

Description
This PR implements extraction of metrics defined using the
prometheus.NewDesc()pattern.Changes
extractNewDescMetric()to extract metrics fromprometheus.NewDesc()callsscripts/metricsdocgen/generated_metricsfileRelated to: #13223
Disclosure: This PR was mainly developed with Claude Sonnet 4, with iterative review and refinement by @ssncferreira