Conversation
WalkthroughBroadened README to generalize the "tool-backed API" pattern beyond databases and clarified MCP's provision of a constrained tool surface. Added a new Grafana starter with a Debian-based Dockerfile and a detailed README describing Loki and Tempo incident-triage tools, usage, and query recipes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/statespace-templates/src/starters/grafana/Dockerfile`:
- Around line 1-5: The Dockerfile currently uses the root user; modify it to
create a non-root user and switch to it before finishing the image: add steps to
create a dedicated user/group (e.g., "grafana" or "appuser"), create a home
directory, set appropriate ownership on any created directories or files from
the RUN step (ensure ca-certificates/curl artifacts are accessible), and add a
USER directive to run the container as that non-root user; ensure any subsequent
file operations in the Dockerfile use chown/chmod so the non-root user has
needed permissions.
In `@crates/statespace-templates/src/starters/grafana/README.md`:
- Around line 3-4: The frontmatter tool command arrays in the Grafana README
(the curl entries that reference $GRAFANA_TOKEN, $LOKI_QUERY_RANGE_URL, and
$TEMPO_SEARCH_URL) must not use shell-style expansions; replace those array
entries with calls to a wrapper CLI script or executable (e.g.,
./scripts/grafana_query) that resolves environment variables internally, or with
a literal command that accepts explicit placeholders (no $... usage). Update the
tool declarations to call the wrapper/script name and pass any static args, and
move the environment resolution logic into that script (or into a templating
step) so the frontmatter contains only non-shell-expanded CLI arguments.
In `@README.md`:
- Around line 128-130: The "Self-describing" feature line still says "for your
databases" and needs to be generalized to match the repo's new "tool-backed"
positioning; update the bullet "🧠 **Self-describing** — APIs are both the
documentation and the interface for your databases" to use a broader term such
as "for your tools and services" or "for your tool-backed systems" so it no
longer references only databases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3eed1f0f-ce5d-4bd5-8ad4-f9d62af1c3fc
📒 Files selected for processing (3)
README.mdcrates/statespace-templates/src/starters/grafana/Dockerfilecrates/statespace-templates/src/starters/grafana/README.md
There was a problem hiding this comment.
♻️ Duplicate comments (2)
crates/statespace-templates/src/starters/grafana/README.md (1)
3-4:⚠️ Potential issue | 🟠 MajorRemove shell variable expansion from frontmatter tool declarations.
The tool command arrays use
$GRAFANA_TOKEN,$LOKI_QUERY_RANGE_URL, and$TEMPO_SEARCH_URL. Per the coding guideline, frontmatter tool declarations must not include shell-style expansions. Replace these with calls to a wrapper script (e.g.,./scripts/loki_query,./scripts/tempo_search) that resolves environment variables internally, or use a non-shell-expanded approach.As per coding guidelines: "Declare tools in page frontmatter as CLI commands in array format without shell expansion, pipes, or globbing."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/statespace-templates/src/starters/grafana/README.md` around lines 3 - 4, The frontmatter tool command arrays currently include shell-style expansions ($GRAFANA_TOKEN, $LOKI_QUERY_RANGE_URL, $TEMPO_SEARCH_URL); replace those array entries with calls to wrapper scripts that resolve env vars internally (e.g., use ./scripts/loki_query and ./scripts/tempo_search instead of the curl arrays containing $GRAFANA_TOKEN, $LOKI_QUERY_RANGE_URL, $TEMPO_SEARCH_URL) so the frontmatter declares plain CLI commands without shell expansion or globbing; implement and reference the wrapper scripts to perform the curl calls and environment lookup.README.md (1)
128-128:⚠️ Potential issue | 🟡 MinorAlign the "Self-describing" bullet with the broadened scope.
Line 128 still references "for your databases," which conflicts with the generalized positioning introduced in this PR (lines 34, 126). Update it to match the new "tool-backed" framing.
✏️ Suggested rewording
-- 🧠 **Self-describing** — APIs are both the documentation and the interface for your databases +- 🧠 **Self-describing** — APIs are both the documentation and the interface for your tools and services🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 128, Update the "🧠 **Self-describing**" bullet so its ending matches the PR's broadened "tool-backed" framing: replace the phrase "for your databases" with wording like "for your tool-backed interfaces" (or "for your tools") so the line reads e.g. "🧠 **Self-describing** — APIs are both the documentation and the interface for your tool-backed interfaces"; edit the bullet starting with "🧠 **Self-describing**" to use this new phrasing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@crates/statespace-templates/src/starters/grafana/README.md`:
- Around line 3-4: The frontmatter tool command arrays currently include
shell-style expansions ($GRAFANA_TOKEN, $LOKI_QUERY_RANGE_URL,
$TEMPO_SEARCH_URL); replace those array entries with calls to wrapper scripts
that resolve env vars internally (e.g., use ./scripts/loki_query and
./scripts/tempo_search instead of the curl arrays containing $GRAFANA_TOKEN,
$LOKI_QUERY_RANGE_URL, $TEMPO_SEARCH_URL) so the frontmatter declares plain CLI
commands without shell expansion or globbing; implement and reference the
wrapper scripts to perform the curl calls and environment lookup.
In `@README.md`:
- Line 128: Update the "🧠 **Self-describing**" bullet so its ending matches the
PR's broadened "tool-backed" framing: replace the phrase "for your databases"
with wording like "for your tool-backed interfaces" (or "for your tools") so the
line reads e.g. "🧠 **Self-describing** — APIs are both the documentation and
the interface for your tool-backed interfaces"; edit the bullet starting with
"🧠 **Self-describing**" to use this new phrasing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2776c3bf-e9f4-476e-81d3-2e0bf1e08716
📒 Files selected for processing (2)
README.mdcrates/statespace-templates/src/starters/grafana/README.md
* Add a Grafana incident triage starter (#175) * docs: rewrite README hero and example * docs: update hero copy and sync index.md with README * docs: fix duplicate shareable bullet and add title to build it block * docs: restructure docs, update positioning, rename and reorganize pages * docs: refine filesystem and cli tools pages * docs: update hero copy * docs: fix statespace run → serve, broken anchor, double colon, add $ prompts * docs: revert statespace serve back to statespace run * docs: add nv link for transparent secret injection in coding agents * feat: use default README template on statespace init * docs: fix broken anchor in cloud deployment CLI link --------- Co-authored-by: gavin <antidmg@proton.me>
Summary
This adds a lightweight
grafanastarter template for incident triage using raw Loki and Tempo HTTP API calls viacurlSummary by CodeRabbit
Documentation
New Features