Skip to content

docs: add Alloy guide for centralized Grafana Cloud telemetry push - #326

Merged
AgustinRamiroDiaz merged 1 commit into
genlayerlabs:mainfrom
Validatrium:main
Jan 22, 2026
Merged

docs: add Alloy guide for centralized Grafana Cloud telemetry push#326
AgustinRamiroDiaz merged 1 commit into
genlayerlabs:mainfrom
Validatrium:main

Conversation

@Validatrium

@ValidatriumValidatrium commented Jan 22, 2026

Copy link
Copy Markdown

Description

Summary by CodeRabbit

  • Documentation
    • Expanded validator setup guide with complete instructions for centralizing node metrics and logs collection via Grafana Cloud, including configuration, setup steps, and troubleshooting guidance.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercelBot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

@lembera is attempting to deploy a commit to the YeagerAI Team on Vercel.

A member of the Team first needs to authorize it.

@netlify

netlifyBot commented Jan 22, 2026

Copy link
Copy Markdown

Deploy Preview for genlayer-docs ready!

NameLink
🔨 Latest commitb735426
🔍 Latest deploy loghttps://app.netlify.com/projects/genlayer-docs/deploys/6971e678a8c1b300085d006a
😎 Deploy Previewhttps://deploy-preview-326--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitaiBot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A documentation update to the validator setup guide that adds comprehensive instructions for configuring centralized metrics and logs collection to GenLayer Grafana Cloud using the Alloy service, including prerequisites, Docker Compose configuration, and troubleshooting guidance.

Changes

Cohort / File(s)Change Summary
Documentation
pages/validators/setup-guide.mdx
Added +227 lines describing centralized telemetry forwarding setup: rationale for metrics collection, prerequisites, step-by-step Docker Compose and Alloy configuration (including alloy-config.river example), environment variable setup, service start/verification instructions, troubleshooting section, and example commands for monitoring.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, skip, and metrics leap,
To Grafana's cloud they swiftly creep,
Alloy carries logs with care,
Through Docker flows the data rare,
Observability springs to life,
Free from debugging strife! 📊✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check nameStatusExplanationResolution
Description check⚠️ WarningThe pull request description consists only of the template text with no actual content, missing a detailed explanation of changes and any issue references that should have been provided.Replace template placeholder text with a detailed description of the Alloy documentation content, its purpose, and any related issues (if applicable). Provide substantive information about what the guide covers.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and specifically describes the main change: adding documentation for Alloy-based centralized telemetry push to Grafana Cloud, which matches the raw summary of +227 lines of documentation content.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@pages/validators/setup-guide.mdx`:
- Line 837: The step header "2. **Add or verify the Alloy service in
docker-compose.yaml (copy if missing):" is awkwardly phrased; update it to a
clearer imperative such as "2. Verify the Alloy service in docker-compose.yaml —
add it if missing" or "2. Add the Alloy service to docker-compose.yaml if it’s
missing" by replacing the existing header text in
pages/validators/setup-guide.mdx (the line containing the current step string).
- Around line 830-835: Update the NODE_METRICS_ENDPOINT example to use the
genlayer-node service name instead of localhost (set
NODE_METRICS_ENDPOINT=genlayer-node:9153) and add a short note near the example
explaining that Docker containers must use service names (e.g., genlayer-node)
rather than localhost so the Alloy container can reach the genlayer-node metrics
endpoint; update any surrounding docs that reference NODE_METRICS_ENDPOINT to
reflect this Docker networking guidance.
- Around line 1009-1023: Convert the "Troubleshooting" block into a properly
formatted Markdown subsection: change the plain "Troubleshooting" text to a
heading (e.g., "#### Troubleshooting"), wrap the curl invocation in a fenced
bash code block, and turn the following lines into bullet points with clear
emphasis and inline code where appropriate (e.g., **Authentication errors
(401/403):** Double-check `MONITORING_USERNAME` and `MONITORING_PASSWORD` in
`.env`, **No data pushed:** Ensure URLs in `.env` have no trailing slash, **Need
help?:** instruct users to run the docker logs command). Ensure the section ends
with a fenced bash code block containing `docker logs genlayer-node-alloy` so
the example is complete and consistent.
🧹 Nitpick comments (4)
pages/validators/setup-guide.mdx (4)

839-875: Consider adding depends_on and network configuration for reliable container communication.

The Alloy service needs to scrape metrics from the genlayer-node container. Without explicit network configuration or depends_on, the service may start before genlayer-node is ready, and network resolution might fail.

♻️ Suggested improvement
 alloy:
image: grafana/alloy:latest
container_name: genlayer-node-alloy
command:
- run
- /etc/alloy/config.river
- --server.http.listen-addr=0.0.0.0:12345
- --storage.path=/var/lib/alloy/data
volumes:
- ./alloy-config.river:/etc/alloy/config.river:ro
- ${NODE_LOGS_PATH:-./data/node/logs}:/var/log/genlayer:ro
- alloy_data:/var/lib/alloy
environment:
- CENTRAL_LOKI_URL=${CENTRAL_LOKI_URL}
# ... other env vars ...
ports:
- "12345:12345" # Alloy UI for debugging
restart: unless-stopped
+ depends_on:+ - genlayer-node
profiles:
- monitoring

939-944: Complex single-line expression reduces readability.

The json_decode(coalesce(env(...), format(...))) expression on line 940 is difficult to read and understand. While functional, it may confuse users trying to customize the configuration.

Consider adding a comment explaining what this line does, or breaking it into multiple lines for clarity:

// Scrape targets: uses SCRAPE_TARGETS_JSON if set, otherwise builds from individual env vars
prometheus.scrape "genlayer_node" {
targets = json_decode(coalesce(
env("SCRAPE_TARGETS_JSON"),
format("[{\"__address__\":\"%s\",\"instance\":\"%s\",\"validator_name\":\"%s\"}]",
coalesce(env("NODE_METRICS_ENDPOINT"), "localhost:9153"),
coalesce(env("NODE_ID"), "local"),
coalesce(env("VALIDATOR_NAME"), "default")
)
))
// ...
}

976-982: Self-monitoring metrics are collected but discarded.

The Alloy self-monitoring scrape has forward_to = [], meaning these metrics are collected but sent nowhere. If this is intentional (to avoid sending Alloy's own metrics to the central system), consider adding a comment explaining this design choice.

 prometheus.scrape "alloy" {
targets = prometheus.exporter.self.alloy.targets
- forward_to = []+ forward_to = [] // Intentionally empty: Alloy self-metrics are not forwarded to avoid noise
scrape_interval = coalesce(env("ALLOY_SELF_MONITORING_INTERVAL"), "60s")
}

820-826: Consider adding a security callout for credential handling.

The .env file contains sensitive Grafana Cloud API credentials. A brief security note would help users understand the importance of protecting these credentials.

Consider adding a Callout component:

<Callouttype="warning"emoji="🔐">
**Protect your credentials!** The `MONITORING_PASSWORD` is a Grafana Cloud API key with write access. Never commit your `.env` file to version control. Add `.env` to your `.gitignore` file.
</Callout>

Comment on lines +830 to +835

# Usually defaults are fine
NODE_METRICS_ENDPOINT=localhost:9153
LOG_FILE_PATTERN=/var/log/genlayer/node*.log
METRICS_SCRAPE_INTERVAL=15s
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Docker networking issue: localhost:9153 won't work from the Alloy container.

When the Alloy container tries to scrape metrics from localhost:9153, it will attempt to reach port 9153 on itself (the Alloy container), not the genlayer-node container. For Docker networking, the endpoint should use the container service name.

Based on learnings from this repository, Docker containers must use service names instead of localhost to communicate.

🔧 Suggested fix
 # Usually defaults are fine
-NODE_METRICS_ENDPOINT=localhost:9153+NODE_METRICS_ENDPOINT=genlayer-node:9153

Also add a note explaining this:

# For Docker deployments, use the container service name instead of localhost
NODE_METRICS_ENDPOINT=genlayer-node:9153
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Usually defaults are fine
NODE_METRICS_ENDPOINT=localhost:9153
LOG_FILE_PATTERN=/var/log/genlayer/node*.log
METRICS_SCRAPE_INTERVAL=15s
```
# Usually defaults are fine
NODE_METRICS_ENDPOINT=genlayer-node:9153
LOG_FILE_PATTERN=/var/log/genlayer/node*.log
METRICS_SCRAPE_INTERVAL=15s
🤖 Prompt for AI Agents
In `@pages/validators/setup-guide.mdx` around lines 830 - 835, Update the
NODE_METRICS_ENDPOINT example to use the genlayer-node service name instead of
localhost (set NODE_METRICS_ENDPOINT=genlayer-node:9153) and add a short note
near the example explaining that Docker containers must use service names (e.g.,
genlayer-node) rather than localhost so the Alloy container can reach the
genlayer-node metrics endpoint; update any surrounding docs that reference
NODE_METRICS_ENDPOINT to reflect this Docker networking guidance.

METRICS_SCRAPE_INTERVAL=15s
```

2. **Add or verify the Alloy service in docker-compose.yaml (copy if missing):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor grammatical issue in the step header.

The sentence structure is slightly off - it starts with "Add or verify" but doesn't flow naturally as a step instruction.

📝 Suggested fix
-2. **Add or verify the Alloy service in docker-compose.yaml (copy if missing):+2. **Add the Alloy service to your docker-compose.yaml** (or verify it exists if using the provided tarball):
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
2.**Add or verify the Alloy service in docker-compose.yaml (copy if missing):
2.**Add the Alloy service to your docker-compose.yaml** (or verify it exists if using the provided tarball):
🤖 Prompt for AI Agents
In `@pages/validators/setup-guide.mdx` at line 837, The step header "2. **Add or
verify the Alloy service in docker-compose.yaml (copy if missing):" is awkwardly
phrased; update it to a clearer imperative such as "2. Verify the Alloy service
in docker-compose.yaml — add it if missing" or "2. Add the Alloy service to
docker-compose.yaml if it’s missing" by replacing the existing header text in
pages/validators/setup-guide.mdx (the line containing the current step string).

Comment on lines +1009 to +1023
Troubleshooting
- No local metrics:

```bash
curl http://localhost:9153/metrics
```

— it should return Prometheus-formatted data.
Authentication errors (401/403): Double-check MONITORING_USERNAME and MONITORING_PASSWORD in .env.
No data pushed: Ensure URLs in .env have no trailing slash.
Help: Share Alloy logs

```bash
docker logs genlayer-node-alloy
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Troubleshooting section has formatting issues.

The troubleshooting content lacks consistent Markdown formatting:

  • "Troubleshooting" should be a proper heading (e.g., **Troubleshooting** or #### Troubleshooting)
  • Lines 1017-1019 appear to be separate bullet points but are missing proper list formatting
  • The section ends abruptly
📝 Suggested formatting fix
-Troubleshooting-- No local metrics:+**Troubleshooting**++- **No local metrics:**
```bash
curl http://localhost:9153/metrics

-— it should return Prometheus-formatted data.
-Authentication errors (401/403): Double-check MONITORING_USERNAME and MONITORING_PASSWORD in .env.
-No data pushed: Ensure URLs in .env have no trailing slash.
-Help: Share Alloy logs

  • It should return Prometheus-formatted data.

+- Authentication errors (401/403): Double-check MONITORING_USERNAME and MONITORING_PASSWORD in .env.
+
+- No data pushed: Ensure URLs in .env have no trailing slash.
+
+- Need help? Share Alloy logs with the Foundation team:

docker logs genlayer-node-alloy

</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>

In @pages/validators/setup-guide.mdx around lines 1009 - 1023, Convert the
"Troubleshooting" block into a properly formatted Markdown subsection: change
the plain "Troubleshooting" text to a heading (e.g., "#### Troubleshooting"),
wrap the curl invocation in a fenced bash code block, and turn the following
lines into bullet points with clear emphasis and inline code where appropriate
(e.g., Authentication errors (401/403): Double-check MONITORING_USERNAME
and MONITORING_PASSWORD in .env, No data pushed: Ensure URLs in .env
have no trailing slash, Need help?: instruct users to run the docker logs
command). Ensure the section ends with a fenced bash code block containing
docker logs genlayer-node-alloy so the example is complete and consistent.


</details>
<!-- fingerprinting:phantom:poseidon:ocelot -->
<!-- This is an auto-generated comment by CodeRabbit -->

@AgustinRamiroDiazAgustinRamiroDiaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for the contribution! It really helps us ship things faster

@AgustinRamiroDiaz
AgustinRamiroDiaz merged commit dfd7f7d into genlayerlabs:mainJan 22, 2026
5 of 6 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Validatrium@AgustinRamiroDiaz@lembera