Skip to content

Conversation

amotl
Copy link
Member

@amotl amotl commented Sep 14, 2025

About

Continue adding integration guides from the community forum.

Preview

References

Copy link

coderabbitai bot commented Sep 14, 2025

Walkthrough

Added a new ignore pattern to docs linkcheck, relabeled sections and links in the Prometheus integration index, and added a new Prometheus "Usage" guide documenting a Docker Compose setup for Prometheus → CrateDB ingestion.

Changes

Cohort / File(s) Summary
Docs linkcheck config
docs/conf.py
Appends r"https://www.computerhope.com/.*" to linkcheck_ignore (added alongside existing 403/Forbidden entry); no other config changes.
Prometheus integration docs
docs/integrate/prometheus/index.md, docs/integrate/prometheus/usage.md
Relabels rubric from "Guides" to "Learn", updates card/link text to "Store Prometheus long-term metrics into CrateDB" and converts one link to a ref, changes "tutorial." to "article.", adds a toctree entry for Usage, and adds a new Usage guide with Docker Compose, Prometheus, and CrateDB/adapter configuration and examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

cross linking

Suggested reviewers

  • hammerhead
  • kneth

Poem

A rabbit taps the keys—hop, hop, hop,
Docs sprout paths where metrics stop.
Prometheus and CrateDB meet,
Compose brings them both to greet.
One link ignored, the rest in play—🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Prometheus: Usage guide” clearly and concisely summarizes the primary change in this pull request, namely the addition of a Prometheus usage guide, without extraneous details or ambiguity. It directly reflects the main objective of the changeset and is appropriately focused for a teammate scanning the commit history.
Description Check ✅ Passed The description explains the purpose of the pull request by stating its goal to continue adding community integration guides, provides a live preview link for the new Prometheus usage documentation, and references the related issue, which directly corresponds to the changes in this PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prometheus

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 596c780 and 77abeea.

📒 Files selected for processing (3)
  • docs/conf.py (1 hunks)
  • docs/integrate/prometheus/index.md (3 hunks)
  • docs/integrate/prometheus/usage.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/conf.py
  • docs/integrate/prometheus/usage.md
  • docs/integrate/prometheus/index.md

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@amotl amotl force-pushed the prometheus branch 2 times, most recently from 8ed9a9a to efb7776 Compare September 15, 2025 20:51
@amotl amotl marked this pull request as ready for review September 15, 2025 20:51
@amotl
Copy link
Member Author

amotl commented Sep 15, 2025

@coderabbitai review and please refactor to active voice.

Copy link

coderabbitai bot commented Sep 15, 2025

@amotl I'll review the PR and focus on identifying passive voice constructions that should be refactored to active voice, as per your previous guidance.


🧠 Learnings used
Learnt from: amotl
PR: crate/cratedb-guide#0
File: :0-0
Timestamp: 2025-09-15T17:42:25.449Z
Learning: When suggesting changes in reviews, use active voice instead of passive or ego voice.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (16)
docs/conf.py (1)

74-76: Drop the ComputerHope ignore (remove the brittle external link instead).

You added this ignore only to accommodate an external “text editor” link in the tutorial. Replace that link in the tutorial (see my comment there) and remove this ignore to keep linkcheck strict.

-    # 403 Client Error: Forbidden for url
-    r"https://www.computerhope.com/",

After applying the tutorial change, run Sphinx linkcheck to confirm it passes without this ignore.

docs/integrate/prometheus/tutorial.md (15)

4-4: Remove ego voice in the intro.

Switch to neutral, active voice.

-In this tutorial, I show how to
+This tutorial shows how to:

9-9: Tighten version note; use active voice.

-*Note: this blog post uses CrateDB 4.7.0, Prometheus 2.33.3 and CrateDB Prometheus Adapter 0.4.0*
+*Note: These examples use CrateDB 4.7.0, Prometheus 2.33.3, and the CrateDB Prometheus Adapter 0.4.0.*

Consider pinning the same versions in the docker-compose snippet below for consistency.


21-27: Rewrite setup paragraphs to active voice and remove the brittle external “text editor” link.

-Both CrateDB, Prometheus, and the CrateDB Prometheus Adapter applications can be run as [Docker containers](https://www.docker.com/resources/what-container). To then centralize the container management I use [Docker Compose](https://docs.docker.com/compose/), this way I can build and run all the containers with a single command and set up the connections between them in a YAML file.
-
-Before anything else, I follow the [Docker Installation Tutorial](https://docs.docker.com/get-docker/) to get Docker in my local machine.
-
-Then, I create a directory in my local machine to host the necessary configuration files.
-I’ll have a total of three of them, all following the YAML format. They can be easily created using any [text editor](https://www.computerhope.com/jargon/e/editor.htm), like TextEdit on a Mac, and then saved with the `.yml` format.
+Run CrateDB, Prometheus, and the CrateDB Prometheus Adapter as [Docker containers](https://www.docker.com/resources/what-container).
+Use [Docker Compose](https://docs.docker.com/compose/) to centralize container management so you can build and run all containers with one command and define their connections in a YAML file.
+
+Install Docker by following the [Docker installation guide](https://docs.docker.com/get-docker/).
+
+Create a directory on your machine to host the configuration files.
+Create three YAML files with your preferred editor and save them with the `.yml` extension.

If you prefer keeping a “what is a text editor” link, point to a more stable source (or omit the link).


30-33: Remove first person; keep instructions direct.

-### Create `docker-compose.yml`
-
-The first YAML file I create is `docker-compose.yml`, which wraps up the configurations for the three containers.
-
-I specify CrateDB, Prometheus, and Adapter as services. Then, I add `config.yml` and `prometheus.yml` files as volumes to the Adapter and Prometheus containers, respectively. These files will be created in the following steps.
+### Create `docker-compose.yml`
+
+Create `docker-compose.yml` to configure the three containers.
+Define services for CrateDB, Prometheus, and the adapter. Mount `config.yml` and `prometheus.yml` into the adapter and Prometheus containers, respectively. You will create these files in the following steps.

34-52: Pin image versions and persist CrateDB data.

Pin images to the versions you mention above and add a data volume for CrateDB. Also add basic restart policies.

 services:
   cratedb:
-    image: "crate"
+    image: "crate:4.7.0"  # Pin for reproducibility; update as needed
     ports:
       - "4200:4200"
       - "5432:5432"
+    volumes:
+      - cratedb-data:/data
+    restart: unless-stopped
   prometheus:
-    image: "prom/prometheus"
+    image: "prom/prometheus:v2.33.3"
     volumes:
       - ./prometheus.yml:/etc/prometheus/prometheus.yml
     ports:
       - "9090:9090"
+    restart: unless-stopped
   cratedb-prometheus-adapter:
-    image: "ghcr.io/crate/cratedb-prometheus-adapter"
+    image: "ghcr.io/crate/cratedb-prometheus-adapter:0.4.0"
     volumes:
       - ./config.yml:/etc/cratedb-prometheus-adapter/config.yml
     ports:
       - "9268:9268"
+    depends_on:
+      - cratedb
+    restart: unless-stopped

Add this at the end of the compose file to define the named volume:

volumes:
  cratedb-data:

Verify the exact tags you want to recommend (or update to current stable). If using Compose V2, consider adding a top-level name: for a predictable network/volume prefix.


56-65: Active voice and clarity in the Prometheus config section.

-Next, following the[ Prometheus Documentation](https://prometheus.io/docs/prometheus/latest/getting_started/), I create a `prometheus.yml` file, which holds the scraping configuration for whichever service Prometheus collects metrics from.
-
-To keep it simple, I follow the example in the Prometheus documentation and set it to monitor itself.
-
-One last bit of configuration necessary to forward requests from Prometheus to the CrateDB Adapter is to set `remote_write` and `remote_read` to the Adapter URL, as stated in [CrateDB Prometheus Adapter Setup](https://github.com/crate/cratedb-prometheus-adapter).
-
-As I’m running the Adapter on Docker instead of locally, the host in its URL will not be `localhost`, but rather however I called the Adapter service previously in my `docker-compose.yml` file, in this case, `cratedb-prometheus-adapter`.
-
-The resulting prometheus.yml looks then like this:
+Next, create `prometheus.yml` as described in the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/getting_started/). This file defines which services Prometheus scrapes.
+
+To keep it simple, monitor Prometheus itself.
+
+To forward samples to CrateDB, set `remote_write` and `remote_read` to the adapter URL (see the [CrateDB Prometheus Adapter setup](https://github.com/crate/cratedb-prometheus-adapter)).
+
+Because the adapter runs in Docker, use the adapter service name from `docker-compose.yml` (`cratedb-prometheus-adapter`) instead of `localhost` in the URLs.
+
+Use the following `prometheus.yml`:

93-107: Active voice in adapter config section.

-Finally, following the [CrateDB Prometheus Adapter setup instructions](https://github.com/crate/cratedb-prometheus-adapter), I create the `config.yml` file, which defines the CrateDB endpoints the Adapter writes to.
-
-As I did previously in the `prometheus.yml` file, the host is set to `cratedb`, which is how I declared the CrateDB service on the `docker-compose.yml` file, instead of the default `localhost`. The remaining variables are set with their default values.
+Finally, create `config.yml` as described in the [CrateDB Prometheus Adapter setup](https://github.com/crate/cratedb-prometheus-adapter). This file defines the CrateDB endpoints the adapter writes to.
+
+Set the host to `cratedb` (the service name in `docker-compose.yml`) instead of `localhost`. Keep the remaining variables at their defaults.

108-108: Fix agreement and remove first person.

-I make sure both `docker-compose.yml`, `config.yml`, and `prometheus.yml` are in the same directory in my local machine.
+Place `docker-compose.yml`, `config.yml`, and `prometheus.yml` in the same directory on your machine.

118-118: Remove the Google search link; link directly and use active voice.

-With Docker Compose up and running, I follow the [CrateDB Prometheus Adapter setup instructions](https://github.com/crate/cratedb-prometheus-adapter), navigate to the [CrateDB Admin UI](https://www.google.com/search?client=safari&rls=en&q=cratedb+admin+ui&ie=UTF-8&oe=UTF-8) at [http://localhost:4200](http://localhost:4200/) and create a `metrics` table in CrateDB, which will store the metrics gathered by Prometheus.
+After Docker Compose starts, open the CrateDB Admin UI at [http://localhost:4200](http://localhost:4200/) and create a `metrics` table to store metrics gathered by Prometheus.

131-136: Active voice and concise instructions for Prometheus UI.

-Then I navigate to [http://localhost:9090](http://localhost:9090/), where I find the Prometheus UI. There, I head to **Status** and then **Targets**
-
-![im1|690x206](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/91223397b30bce2f7188617436ea12ceed83d83c.png)
-
-And confirm that Prometheus is successfully monitoring itself.
+Navigate to [http://localhost:9090](http://localhost:9090/) to open the Prometheus UI. Go to **Status** → **Targets**.
+
+![im1|690x206](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/91223397b30bce2f7188617436ea12ceed83d83c.png)
+
+Confirm that Prometheus monitors itself.

139-147: Active voice and neutral tone; avoid marketing language.

-Lastly, I head back to the CrateDB Admin UI and select the `metrics` table I just created.
-
-I see that only after a few minutes of running, Prometheus has gathered over 300k data points.
+Return to the CrateDB Admin UI and select the `metrics` table you created.
+
+After a few minutes, Prometheus will have gathered hundreds of thousands of data points.
 
-![im3|690x403](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/22e8c7d5a90ec9240a4cb4269774e143759aa92e.jpeg)
- 
-I can now enjoy CrateDB’s incredible query speed to analyze and visualize this
-data using tools like {ref}`grafana`, which works effortlessly with CrateDB.
+![im3|690x403](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/22e8c7d5a90ec9240a4cb4269774e143759aa92e.jpeg)
+ 
+Use CrateDB’s query engine to analyze and visualize this data with tools like {ref}`grafana`.

84-85: Optional: scrape Prometheus via service name for clarity in Compose networks.

Inside containers, localhost:9090 works, but using the service name improves readability.

-      - targets: ['localhost:9090']
+      - targets: ['prometheus:9090']

This requires the service to be named prometheus (as in your Compose file), which it is.

Also applies to: 87-90


34-52: Optional: add healthchecks for better startup sequencing.

Consider simple HTTP healthchecks so depends_on can be extended to condition: service_healthy if you choose to use it.

   cratedb:
     image: "crate:4.7.0"
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:4200"]
+      interval: 10s
+      timeout: 5s
+      retries: 12
   prometheus:
     image: "prom/prometheus:v2.33.3"
+    healthcheck:
+      test: ["CMD", "wget", "-qO-", "http://localhost:9090/-/ready"]
+      interval: 10s
+      timeout: 5s
+      retries: 12
   cratedb-prometheus-adapter:
     image: "ghcr.io/crate/cratedb-prometheus-adapter:0.4.0"
+    healthcheck:
+      test: ["CMD", "wget", "-qO-", "http://localhost:9268/health"]
+      interval: 10s
+      timeout: 5s
+      retries: 12

112-116: Use Compose V2 syntax and remove shell prompts (fixes MD014).

File: docs/integrate/prometheus/tutorial.md (lines 112–116)

-Finally, I navigate to my CrateDB-Prometheus directory in my terminal and start Docker Compose with the `docker-compose up` command
+Finally, navigate to your CrateDB–Prometheus directory and start Docker Compose:
 ```shell
-$ cd /Users/Path/To/Directory/CrateDB-Prometheus
-$ docker-compose up
+cd /Users/Path/To/Directory/CrateDB-Prometheus
+docker compose up -d

---

`1-152`: **Remove first‑person and passive constructions in docs/integrate/prometheus/tutorial.md**

Occurrences found — rephrase to neutral/imperative voice.

- First‑person (I / I'm / I'll / we): lines 4, 21, 23, 25, 26, 30, 32, 56, 58, 62, 93, 95, 108, 112, 118, 131, 139, 141, 145.
- Passive/key phrases (can be, will be, is set to, etc.): lines 21, 26, 32, 95.

Quick examples:
- Line 4: "In this tutorial, I show how to" → "This tutorial shows how to"
- Line 21: "can be run as Docker containers" → "run as Docker containers"
- Line 112: "Finally, I navigate ... and start Docker Compose with `docker-compose up`" → "From the CrateDB‑Prometheus directory, run `docker-compose up`"

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 427d70177fd239764a925f35649bf8565b94b4cd and efb7776b0bd56af7f54646dfbc123679916cbac3.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `docs/conf.py` (1 hunks)
* `docs/integrate/prometheus/index.md` (2 hunks)
* `docs/integrate/prometheus/tutorial.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>docs/integrate/prometheus/index.md</summary>

115-115: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)</summary>

* GitHub Check: Build docs

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>docs/integrate/prometheus/index.md (2)</summary><blockquote>

`67-69`: **LGTM: use internal cross‑reference for the tutorial card.**

The switch to `:link-type: ref` improves durability and keeps navigation inside the docs.

---

`115-120`: **LGTM: add hidden toctree entry for the tutorial.**

This keeps the page discoverable in Sphinx while preserving the grid layout.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@amotl amotl added the refactoring Changing shape or layout, or moving content around. label Sep 15, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
docs/integrate/prometheus/tutorial.md (6)

15-20: Refactor motivation to active voice and tighten wording

Improves clarity and avoids passive/impersonal phrasing (“one can,” “comes into place”).

-[Prometheus](https://prometheus.io/docs/introduction/overview/) is a monitoring software for collecting metrics data from applications and infrastructures. Its focus lies on collecting big amounts of concise event data from the monitored system, roughly timestamp points with key-value pairs.
-
-Such data is very useful to track the state and trajectory of a system, so storing this data for the long term is a common need for Prometheus users.
-
-This is where [CrateDB](https://cratedb.com/database) comes into place. With the [CrateDB Prometheus Adapter](https://github.com/crate/cratedb-prometheus-adapter), one can easily store the collected metrics data in CrateDB and take advantage of its high ingestion and query speed and friendly UI to massively scale-out Prometheus.
+[Prometheus](https://prometheus.io/docs/introduction/overview/) is a monitoring system that collects metrics from applications and infrastructure. It focuses on ingesting large volumes of concise time‑series events—timestamped points with key‑value labels.
+
+This data helps you track a system’s state and trajectory. Many Prometheus users want to retain it long term.
+
+[CrateDB](https://cratedb.com/database) helps here. With the [CrateDB Prometheus Adapter](https://github.com/crate/cratedb-prometheus-adapter), you can store metrics in CrateDB and use its fast ingestion, query performance, and admin UI to scale Prometheus.

71-71: Active voice: replace “as described in”

Keeps instructions direct.

-Next, create `prometheus.yml` as described in the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/getting_started/). This file defines which services Prometheus scrapes.
+Next, create `prometheus.yml` following the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/getting_started/). This file defines the services that Prometheus scrapes.

108-108: Active voice: replace “as described in”

Matches tone used elsewhere.

-Finally, create `config.yml` as described in the [CrateDB Prometheus Adapter setup](https://github.com/crate/cratedb-prometheus-adapter). This file defines the CrateDB endpoints the adapter writes to.
+Finally, create `config.yml` following the [CrateDB Prometheus Adapter setup](https://github.com/crate/cratedb-prometheus-adapter). This file defines the CrateDB endpoints that the adapter writes to.

149-149: Improve image alt text for accessibility

Describe what readers should notice in each screenshot.

-![im1|690x206](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/91223397b30bce2f7188617436ea12ceed83d83c.png)
+![Prometheus Targets page showing the self-scrape target as UP](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/91223397b30bce2f7188617436ea12ceed83d83c.png)
@@
-![im2|690x173](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/57ccb5374b0ab524466de08feefbafde559dac87.png)
+![Prometheus target details for the self-scrape job](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/57ccb5374b0ab524466de08feefbafde559dac87.png)
@@
-![im3|690x403](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/22e8c7d5a90ec9240a4cb4269774e143759aa92e.jpeg)
+![CrateDB Admin UI showing the populated metrics table](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/22e8c7d5a90ec9240a4cb4269774e143759aa92e.jpeg)

Also applies to: 153-153, 159-159


164-168: Fix bare URLs and tighten phrasing

Resolves markdownlint MD034 and keeps an active, direct style.

-Here are a few interesting tutorials on that matter:
-
-* https://cratedb.com/blog/visualizing-time-series-data-with-grafana-and-cratedb
-* https://cratedb.com/blog/monitoring-cratedb-with-prometheus-and-grafana
+Explore these related tutorials:
+
+* [Visualizing time‑series data with Grafana and CrateDB](https://cratedb.com/blog/visualizing-time-series-data-with-grafana-and-cratedb)
+* [Monitoring CrateDB with Prometheus and Grafana](https://cratedb.com/blog/monitoring-cratedb-with-prometheus-and-grafana)

127-131: Consider Compose V2 command

If you target modern Docker, prefer “docker compose” (V2) and add “-d” to detach.

-docker-compose up
+docker compose up -d
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efb7776 and c7f4347.

📒 Files selected for processing (1)
  • docs/integrate/prometheus/tutorial.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/integrate/prometheus/tutorial.md

166-166: Bare URL used

(MD034, no-bare-urls)


167-167: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build docs

@amotl amotl changed the title Prometheus: Starter tutorial Prometheus: Usage guide Sep 23, 2025
@surister

This comment was marked as resolved.

@amotl

This comment was marked as resolved.

@amotl amotl force-pushed the prometheus branch 2 times, most recently from c99c51a to e27df98 Compare September 30, 2025 13:23
@amotl amotl merged commit bb81366 into main Sep 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Changing shape or layout, or moving content around.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants