-
Notifications
You must be signed in to change notification settings - Fork 39
Add header to metrics catalog #825
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
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
WalkthroughThis change adds a new introductory section to the top of the metrics catalog documentation and updates the documentation generator to include this section in its output. No changes were made to the actual metrics content or the structure of the generated table. Changes
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
doc/metrics_catalog.md(1 hunks)pkg/metrics/docs/generator.go(1 hunks)
🧰 Additional context used
🪛 GitHub Check: Lint-Go
pkg/metrics/docs/generator.go
[failure] 76-76:
File is not properly formatted (golines)
🪛 GitHub Actions: Lint
pkg/metrics/docs/generator.go
[error] 76-76: File is not properly formatted (golines)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd-cli)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
- GitHub Check: Upgrade Tests
- GitHub Check: Test (Node)
🔇 Additional comments (2)
pkg/metrics/docs/generator.go (1)
75-76: Header content added correctly.The new top-level heading and descriptive paragraph align perfectly with the PR’s objectives and mirror the manual changes in
doc/metrics_catalog.md. No concerns with the content or logic here.🧰 Tools
🪛 GitHub Check: Lint-Go
[failure] 76-76:
File is not properly formatted (golines)🪛 GitHub Actions: Lint
[error] 76-76: File is not properly formatted (golines)
doc/metrics_catalog.md (1)
1-4: Introductory section added as intended.The new heading and the link to the OpenMetrics spec satisfy the PR’s goal and are consistent with the generator update. Everything looks good here.
pkg/metrics/docs/generator.go
Outdated
| sb.WriteString("# xmptd OpenMetrics catalog\n\n") | ||
| sb.WriteString("This document catalogs the [OpenMetrics](https://prometheus.io/docs/specs/om/open_metrics_spec/) instrumentation for xmptd.\n\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting to satisfy golines.
The string literal in the WriteString call is too long and triggers the golines lint error. You can collapse both calls into a single raw string literal, for example:
-sb.WriteString("# xmptd OpenMetrics catalog\n\n")
-sb.WriteString("This document catalogs the [OpenMetrics](https://prometheus.io/docs/specs/om/open_metrics_spec/) instrumentation for xmptd.\n\n")
+sb.WriteString(`# xmptd OpenMetrics catalog
+
+This document catalogs the [OpenMetrics](https://prometheus.io/docs/specs/om/open_metrics_spec/) instrumentation for xmptd.
+
+`)Then run:
golines -w pkg/metrics/docs/generator.go
go fmt ./pkg/metrics/docs/generator.goto resolve the formatting error.
🧰 Tools
🪛 GitHub Check: Lint-Go
[failure] 76-76:
File is not properly formatted (golines)
🪛 GitHub Actions: Lint
[error] 76-76: File is not properly formatted (golines)
🤖 Prompt for AI Agents
In pkg/metrics/docs/generator.go around lines 75 to 76, the two consecutive
WriteString calls use string literals that are too long and cause golines lint
errors. Combine these two strings into a single raw string literal to reduce
line length and improve readability. After updating the code, run 'golines -w
pkg/metrics/docs/generator.go' and 'go fmt ./pkg/metrics/docs/generator.go' to
automatically format the file and fix the linting issues.
Add title and introduction to xmptd OpenMetrics catalog documentationThe changes add a header and introductory text to the metrics catalog documentation through two main updates:
📍Where to StartStart with the Macroscope summarized ab7fdfd. |
Add title and introductory text to xmptd OpenMetrics catalog documentation
Updates documentation generation by modifying the
dumpToMarkdownfunction in generator.go to include a header and introduction in the metrics catalog. The changes affect both the generated metrics_catalog.md and the documentation generation code.📍Where to Start
Start with the
dumpToMarkdownfunction in generator.go which contains the core changes to the documentation generation logic.Macroscope summarized 381b72e.
Summary by CodeRabbit