prometheus-go-code-review
Reviews Prometheus instrumentation in Go code for proper metric types, labels, and patterns. Use when reviewing code with prometheus/client_golang metrics.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/prometheus-go-code-reviewWhat This Skill Does
The prometheus-go-code-review skill is a specialized diagnostic tool designed to analyze your Go source code for adherence to Prometheus instrumentation best practices. It automatically scans your implementation for common pitfalls, such as the use of high-cardinality labels which can lead to memory exhaustion in your TSDB, incorrect selection of metric types like Gauges versus Counters, and performance issues caused by registering metrics inside request handlers. By leveraging this skill, developers ensure their observability stack remains performant, scalable, and compliant with Prometheus naming conventions, specifically regarding snake_case and mandatory unit suffixes.
Installation
You can install the skill by running the following command in your terminal:
clawhub install openclaw/skills/skills/anderskev/prometheus-go-code-review
Use Cases
Use this skill during pull request reviews or when refactoring microservices. It is particularly valuable when:
- Onboarding new engineers who are unfamiliar with Prometheus standards.
- Auditing existing codebases for potential memory leaks caused by unbounded label sets.
- Preparing a service for high-traffic production environments where efficient metric ingestion is critical.
- Standardizing metrics across multiple microservices to ensure consistent alerting and dashboarding.
Example Prompts
- "Review this code snippet to ensure my Prometheus metrics are registered correctly and won't cause panic on multiple calls: [paste code]"
- "Can you audit these custom metrics for potential high-cardinality label issues? I'm seeing ballooning memory usage in my Prometheus server."
- "Check if these histogram bucket boundaries are appropriate for a service with latency in the millisecond range."
Tips & Limitations
- Tips: Always define your metrics as global variables or within a struct initialized during application startup to avoid registration race conditions. Use the
promautopackage to simplify registration, but be wary of where those metrics are instantiated. Ensure your metrics have clear, descriptive help text for other developers. - Limitations: This skill focuses on static code analysis and cannot identify runtime-specific label cardinality issues occurring within complex production traffic patterns. It also assumes you are using the standard
prometheus/client_golanglibrary and may not fully account for custom wrappers or alternative observability providers.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-prometheus-go-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Related Skills
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
reference-docs
Reference documentation patterns for API and symbol documentation. Use when writing reference docs, API docs, parameter tables, or technical specifications. Triggers on reference docs, API reference, function reference, parameters table, symbol documentation.
serde-code-review
Reviews serde serialization code for derive patterns, enum representations, custom implementations, and common serialization bugs. Use when reviewing Rust code that uses serde, serde_json, toml, or any serde-based serialization format. Covers attribute macros, field renaming, and format-specific pitfalls.