Skip to content

API Doc tweaks#1905

Merged
aantn merged 2 commits intomasterfrom
api-docs-tweaks
Aug 26, 2025
Merged

API Doc tweaks#1905
aantn merged 2 commits intomasterfrom
api-docs-tweaks

Conversation

@aantn
Copy link
Copy Markdown
Collaborator

@aantn aantn commented Aug 24, 2025

  1. Move API docs out of a subpage and into the parent Robusta Pro features.
  2. Other small changes for clarity

@aantn aantn requested a review from pavangudiwada August 24, 2025 13:43
@aantn aantn enabled auto-merge (squash) August 24, 2025 13:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 24, 2025

Walkthrough

Removed two documentation pages, added Sphinx redirects for them, expanded and reformatted the Send Alerts API doc (content, schema, examples, troubleshooting, testing), adjusted Robusta Pro features text, and updated the docs index to list individual API pages.

Changes

Cohort / File(s) Summary
Redirects update
docs/conf.py
Added two redirects mapping removed pages to /master/configuration/exporting/send-alerts-api.html and fixed trailing-comma syntax in the redirects dict.
Removed docs
docs/configuration/exporting/exporting-data.rst, docs/configuration/alertmanager-integration/troubleshooting-alertmanager.rst
Deleted the exporting-data overview and the Alertmanager troubleshooting guide files.
Send Alerts API (new/expanded)
docs/configuration/exporting/send-alerts-api.rst
Added comprehensive API doc content: intro, availability note, detailed request/alert schema, example requests, headers, success/error responses, troubleshooting (General & AlertManager), testing guidance, and help links.
Robusta Pro features update
docs/configuration/exporting/robusta-pro-features.rst
Reworded API reference heading, renamed “Custom Alert API” to “Send Alerts API,” and updated closing guidance to reference individual API docs.
Docs index update
docs/index.rst
Removed two Robusta Pro Features entries; added five API-specific entries (send-alerts-api, configuration-changes-api, alert-export-api, alert-statistics-api, namespace-resources-api) to the toctree.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • RoiGlinik

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch api-docs-tweaks

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (7)
docs/configuration/exporting/send-alerts-api.rst (5)

151-154: Normalize Authorization placeholder to a single convention

The example uses “API-KEY” while the header description uses “TOKEN_HERE”. Pick one (e.g., API_KEY) for consistency across the page.

-    --header 'Authorization: Bearer API-KEY' \
+    --header 'Authorization: Bearer API_KEY' \
-   * - ``Authorization``
-     - Bearer token for authentication (e.g., ``Bearer TOKEN_HERE``). The token must have the necessary permissions to submit alerts.
+   * - ``Authorization``
+     - Bearer token for authentication (e.g., ``Bearer API_KEY``). The token must have the necessary permissions to submit alerts.

Also applies to: 193-195


180-182: Clarify where to find ACCOUNT_ID for SaaS vs self-hosted

“generated_values.yaml” applies to self-hosted; SaaS users will likely look in the UI. Suggest clarifying both.

-- ``ACCOUNT_ID``: Your account ID, which can be found in your ``generated_values.yaml`` file.
+- ``ACCOUNT_ID``: Your account ID (SaaS: Settings → Account in the Robusta UI; self-hosted: in your ``generated_values.yaml``).

58-60: Use JSON-native type names (“array”, “object”) instead of Python-specific (“list”, “dict”)

The page is API-focused and shows JSON payloads. Using JSON type names improves clarity and avoids language bias.

-     - list
+     - array
-   * - ``labels``
-     - dict
+   * - ``labels``
+     - object
-   * - ``annotations``
-     - dict
+   * - ``annotations``
+     - object

Apply the same “array/object” terminology anywhere else applicable on this page.

Also applies to: 108-115


171-174: Example request: include subject_type/name for completeness

The schema lists subject_type and subject_name but the example omits them. Adding them helps integrators map these fields correctly.

         "cluster": "prod-cluster-1",
+        "subject_type": "service",
+        "subject_name": "test-service",
         "subject_namespace": "prod",
         "subject_node": "gke-prod-cluster-1-node-1"

236-239: Troubleshooting: “Wait 10 minutes” guidance — verify or scope it

Startup time can vary by environment. If 10 minutes is specific to a known install profile, say so; otherwise consider “a few minutes” or provide readiness indicators (pods, health checks).

docs/conf.py (1)

202-205: Add “docs/…” prefixes too for belt-and-suspenders compatibility

Elsewhere in this list, some old paths include a “docs/…” prefix. If external links ever referenced the generated HTML under that prefix, adding parallel redirects avoids 404s.

     "advanced/index.html": "/master/setup-robusta/installation/index.html",
     "configuration/exporting/exporting-data.html": "/master/configuration/exporting/send-alerts-api.html",
-    "configuration/alertmanager-integration/troubleshooting-alertmanager.html": "/master/configuration/exporting/send-alerts-api.html"
+    "configuration/alertmanager-integration/troubleshooting-alertmanager.html": "/master/configuration/exporting/send-alerts-api.html",
+    "docs/configuration/exporting/exporting-data.html": "/master/configuration/exporting/send-alerts-api.html",
+    "docs/configuration/alertmanager-integration/troubleshooting-alertmanager.html": "/master/configuration/exporting/send-alerts-api.html"
docs/configuration/exporting/robusta-pro-features.rst (1)

36-37: Prefer a sub-heading over bold text for “Robusta API Reference”

As a section lead-in, using a proper sub-heading renders better in the ToC and supports deep-linking.

-**Robusta API Reference**
-    Comprehensive APIs for exporting alert history, generating reports, and sending custom alerts programmatically.
+Robusta API Reference
+---------------------
+    A set of APIs for exporting alert history, generating reports, and sending alerts programmatically.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a7adc1c and 6549639.

📒 Files selected for processing (6)
  • docs/conf.py (1 hunks)
  • docs/configuration/alertmanager-integration/troubleshooting-alertmanager.rst (0 hunks)
  • docs/configuration/exporting/exporting-data.rst (0 hunks)
  • docs/configuration/exporting/robusta-pro-features.rst (2 hunks)
  • docs/configuration/exporting/send-alerts-api.rst (7 hunks)
  • docs/index.rst (1 hunks)
💤 Files with no reviewable changes (2)
  • docs/configuration/alertmanager-integration/troubleshooting-alertmanager.rst
  • docs/configuration/exporting/exporting-data.rst
⏰ 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). (4)
  • GitHub Check: run_tests
  • GitHub Check: run_tests
  • GitHub Check: Deploy docs
  • GitHub Check: Deploy docs
🔇 Additional comments (7)
docs/configuration/exporting/send-alerts-api.rst (3)

88-91: Confirm allowed values for priority

The set includes both “critical/high/medium/low” and “error/debug”. Verify these are the exact values accepted by the backend validator and case sensitivity requirements (e.g., lower-case only). If there’s a canonical enum, link or reference it.


33-34: Batch size limit: please confirm 1000 per request

If this 1000 limit is enforced server-side, keep it. If it’s a guideline or subject to change, consider “currently up to 1000” and/or note rate limits.


18-26: Nice addition: Integration overview before the API details

Clear, user-friendly framing that helps readers choose between pre-built integrations and the API path.

docs/conf.py (1)

202-205: Redirects for removed pages — looks correct

Both old pages now point to the new Send Alerts API doc. Trailing comma after the previous item is good cleanup.

docs/configuration/exporting/robusta-pro-features.rst (2)

43-44: Terminology alignment: “Send Alerts API”

Good rename from “Custom Alert API” to “Send Alerts API” — matches the new doc and is clearer for users.


67-67: Helpful pointer

The closing line directing readers to the individual API references is clear and consistent with the new structure.

docs/index.rst (1)

86-90: Index updated to list individual API docs — LGTM

The Pro Features section now surfaces the specific API pages directly, which improves discoverability.

Comment thread docs/configuration/exporting/send-alerts-api.rst
Copy link
Copy Markdown
Contributor

@pavangudiwada pavangudiwada left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown

@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

♻️ Duplicate comments (1)
docs/configuration/exporting/send-alerts-api.rst (1)

27-28: Duplicate “Send Alerts API” heading — rename inner section to avoid conflicting anchors

This repeats the H1 from Line 1 and can create duplicate anchors/ToC noise (especially with autosectionlabel enabled). Rename this inner heading to “Endpoint” (or remove it).

Apply:

-Send Alerts API
----------------
+Endpoint
+--------
🧹 Nitpick comments (6)
docs/configuration/exporting/send-alerts-api.rst (6)

35-39: Prefer a code block for the HTTP method/URL instead of a caret-underlined title

Rendering an URL-as-title with carets is unusual in our docs and makes deep-linking less clear. A small restructure reads better and avoids overlong underline lines.

Example:

-.. _send-alerts-api:
-
-POST https://api.robusta.dev/api/alerts
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. _send-alerts-api:
+
+Endpoint
+--------
+
+.. code-block:: http
+
+   POST /api/alerts HTTP/1.1
+   Host: api.robusta.dev

149-176: Example: consider adding Accept header and a second alert to demonstrate batching

Minor polish: many APIs encourage Accept: application/json. Also, including two alerts showcases the batch behavior.

     curl --location --request POST 'https://api.robusta.dev/api/alerts' \
     --header 'Authorization: Bearer API-KEY' \
     --header 'Content-Type: application/json' \
+    --header 'Accept: application/json' \
     --data-raw '{
         "account_id": "ACCOUNT_ID",
         "alerts": [
             {
                 "title": "Test Service Down",
                 "description": "The Test Service is not responding.",
                 "source": "monitoring-system",
                 "priority": "high",
                 "aggregation_key": "test-service-issues",
                 "failure": true,
                 "starts_at": "2024-10-07T10:00:00Z",
                 "labels": {
                     "environment": "production"
                 },
                 "annotations": {
                     "env1": "true"
                 },
                 "cluster": "prod-cluster-1",
                 "subject_namespace": "prod",
                 "subject_node": "gke-prod-cluster-1-node-1"
-            }
+            },
+            {
+                "title": "Background job latency",
+                "description": "Latency p95 > 2s",
+                "source": "custom-metrics",
+                "priority": "warning",
+                "aggregation_key": "job-latency",
+                "labels": { "job": "worker" }
+            }
         ]
     }'

211-211: Use literal inline code for status codes

In reStructuredText, single backticks are interpreted text. Use double backticks for literal code.

-- **Status Code**: `200 OK`
+- **Status Code**: ``200 OK``

225-226: Same here: fix inline code for examples of error codes

-- **Status Code**: Varies based on the error (e.g., `400 Bad Request`, `500 Internal Server Error`).
+- **Status Code**: Varies based on the error (e.g., ``400 Bad Request``, ``500 Internal Server Error``).

7-14: Intro benefits are crisp; consider trimming “and more!”

Great overview. Minor tone nit: “and more!” can be dropped for a slightly more formal feel consistent with the rest of the page.

-* and more!

80-83: Description field punctuation consistency

Some descriptions end with a period, others don’t. Standardize for uniformity.

-     - A detailed description of the alert
+     - A detailed description of the alert.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6549639 and abbe610.

📒 Files selected for processing (1)
  • docs/configuration/exporting/send-alerts-api.rst (7 hunks)
⏰ 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). (3)
  • GitHub Check: run_tests
  • GitHub Check: run_tests
  • GitHub Check: Deploy docs
🔇 Additional comments (8)
docs/configuration/exporting/send-alerts-api.rst (8)

40-61: Request Body section reads well and clarifies batching limit

Nice improvement: clear table, explicit required fields, and max 1000 alerts per request.


178-182: Nice: clear guidance on where to find Account ID and create API keys

This will reduce support questions.


200-210: Success response block is concise and consistent with headers above

LGTM.


260-265: Link verification succeeded: embedded-prometheus.rst exists and the relative path is correct

The file docs/configuration/alertmanager-integration/embedded-prometheus.rst was found, which matches the link target ../alertmanager-integration/embedded-prometheus from docs/configuration/exporting/send-alerts-api.rst. No changes required.


227-241: sphinx_design extension already enabled

Confirmed that sphinx_design appears in the extensions list in docs/conf.py (line 50), so the .. tab-set:: and .. tab-item:: directives will work as intended.


280-280: Avoid URL shorteners in docs

I ran a search for any existing robusta.dev/slack or robusta.ai/slack URLs in the repo and found none, which suggests a canonical redirect may not yet exist. Before swapping out the Bit.ly link, please verify whether a http(s)://robusta.dev/slack redirect is live or planned. If it is, update the doc as shown; otherwise, either deploy that redirect first or continue using the Bit.ly link until the canonical URL is available.

• File: docs/configuration/exporting/send-alerts-api.rst
Lines around 280: replace the Bit.ly link once the canonical redirect exists

Suggested diff:

-* Join our `Slack community <https://bit.ly/robusta-slack>`_ for direct support
+* Join our `Slack community <https://robusta.dev/slack>`_ for direct support

62-143: Verify priority enum and aggregation_key requirement against the backend API spec

I searched this repository for any OpenAPI/JSONSchema definitions or server-side validation rules and didn’t find a definitive schema enforcing:

  • The exact set of priority values (critical, high, medium, error, warning, info, low, debug).
  • Whether aggregation_key is truly required by the API.

Please double-check the upstream API specification or server validation to ensure these match. If you confirm that aggregation_key is optional, update the docs accordingly. For example:

-   * - ``aggregation_key``
-     - string
-     - A key to group alerts that are related.
-     - Yes
+   * - ``aggregation_key``
+     - string
+     - A key to group alerts that are related (used for de-duplication/grouping).
+     - No

— After you verify, please either update the documentation or confirm that these fields are indeed required/limited exactly as shown.


23-25: No changes for Alert Sources link

The :doc:Alert Sources <../index>link insend-alerts-api.rstalready targetsdocs/configuration/index.rst`, which is the dedicated “Alert Sources” document. No update is needed here.

@aantn aantn merged commit 732273a into master Aug 26, 2025
8 checks passed
@aantn aantn deleted the api-docs-tweaks branch August 26, 2025 06:30
@coderabbitai coderabbitai Bot mentioned this pull request Sep 15, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Nov 6, 2025
Sign up for free to 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.

2 participants