Skip to content

urljoin removes path after base url - #1342

Merged
arikalon1 merged 1 commit into
masterfrom
grafana-dashboards-urljoin
Jan 8, 2026
Merged

arikalon1 merged 1 commit into
masterfrom
grafana-dashboards-urljoin

Conversation

@arikalon1

@arikalon1 arikalon1 commented Jan 7, 2026 •

Copy link
Copy Markdown
Collaborator

urljoin("robusta.dev/grafana", "/api/dashboards/tags") -> "robusta.dev/api/dashboards/tags"

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced URL construction for Grafana API endpoints to improve reliability and prevent malformation of API requests.

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

urljoin("robusta.dev/grafana", "/api/dashboards/tags") -> "robusta.dev/api/dashboards/tags"

Signed-off-by: Arik Alon <alon.arik@gmail.com>
@arikalon1
arikalon1 requested a review from Sheeproid January 7, 2026 18:35
@netlify

netlify Bot commented Jan 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for holmes-docs ready!

Name Link
🔨 Latest commit 0f73038
🔍 Latest deploy log https://app.netlify.com/projects/holmes-docs/deploys/695ea77a1d02100008a4c636
😎 Deploy Preview https://deploy-preview-1342--holmes-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.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@github-actions

github-actions Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Results of HolmesGPT evals

Automatically triggered by commit 0f73038 on branch grafana-dashboards-urljoin

View workflow logs

Results of HolmesGPT evals

  • ask_holmes: 9/9 test cases were successful, 0 regressions
Status Test case Time Turns Tools Cost
✅ 09_crashpod 36.3s ±0% 6 14 $0.1786
✅ 101_loki_historical_logs_pod_deleted 39.9s ↓20% 6 12 $0.1745
✅ 111_pod_names_contain_service 35.3s ↓13% 6 14 $0.1616
✅ 12_job_crashing 46.8s ±0% 8 18 $0.2115
✅ 162_get_runbooks 58.7s ↑25% 8 16 $0.2466
✅ 176_network_policy_blocking_traffic_no_runbooks 42.5s ±0% 7 16 $0.2001
✅ 24_misconfigured_pvc 37.9s ±0% 7 16 $0.1752
✅ 43_current_datetime_from_prompt 3.8s ↑23% 1 — $0.0618
✅ 61_exact_match_counting 11.5s ±0% 3 3 $0.0859
Total 34.7s avg 5.8 avg 13.6 avg $1.4959

Time/Cost columns show % change vs historical average (↑slower/costlier, ↓faster/cheaper). Changes under 10% shown as ±0%.

Historical Comparison Details

Filter: excluding branch 'grafana-dashboards-urljoin'

Status: Success - 45 test/model combinations loaded

Experiments compared (30):

Comparison indicators:

  • ±0% — diff under 10% (within noise threshold)
  • ↑N%/↓N% — diff 10-25%
  • ↑N%/↓N% — diff over 25% (significant)
📖 Legend
Icon Meaning
✅ The test was successful
➖ The test was skipped
⚠️ The test failed but is known to be flaky or known to fail
🚧 The test had a setup failure (not a code regression)
🔧 The test failed due to mock data issues (not a code regression)
🚫 The test was throttled by API rate limits/overload
❌ The test failed and should be fixed before merging the PR
🔄 Re-run evals manually

⚠️ Warning: /eval comments always run using the workflow from master, not from this PR branch. If you modified the GitHub Action (e.g., added secrets or env vars), those changes won't take effect.

To test workflow changes, use the GitHub CLI or Actions UI instead:

gh workflow run eval-regression.yaml --repo HolmesGPT/holmesgpt --ref grafana-dashboards-urljoin -f markers=regression -f filter=

Option 1: Comment on this PR with /eval:

/eval
markers: regression

Or with more options (one per line):

/eval
model: gpt-4o
markers: regression
filter: 09_crashpod
iterations: 5

Run evals on a different branch (e.g., master) for comparison:

/eval
branch: master
markers: regression
Option Description
model Model(s) to test (default: same as automatic runs)
markers Pytest markers (no default - runs all tests!)
filter Pytest -k filter (use /list to see valid eval names)
iterations Number of runs, max 10
branch Run evals on a different branch (for cross-branch comparison)

Quick re-run: Use /rerun to re-run the most recent /eval on this PR with the same parameters.

Option 2: Trigger via GitHub Actions UI → "Run workflow"

🏷️ Valid markers

benchmark, chain-of-causation, compaction, context_window, coralogix, counting, database, datadog, datetime, easy, elasticsearch, embeds, grafana-dashboard, hard, kafka, kubernetes, leaked-information, logs, loki, medium, metrics, network, newrelic, no-cicd, numerical, one-test, port-forward, prometheus, question-answer, regression, runbooks, slackbot, storage, toolset-limitation, traces, transparency


Commands: /eval · /rerun · /list

CLI: gh workflow run eval-regression.yaml --repo HolmesGPT/holmesgpt --ref grafana-dashboards-urljoin -f markers=regression -f filter=

@coderabbitai

coderabbitai Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

The PR modifies URL construction in the Grafana toolset by removing leading slashes from API endpoints and ensuring the base URL includes a trailing slash before concatenation, normalizing endpoint formatting across health checks and dashboard tools without changing public APIs.

Changes

Cohort / File(s) Summary
Grafana endpoint normalization
holmes/plugins/toolsets/grafana/toolset_grafana.py
Removes leading slashes from API endpoints (e.g., "/api/..." → "api/...") in health_check, _make_grafana_request, and tool invocations (SearchDashboards, GetDashboardByUID, GetHomeDashboard, GetDashboardTags). Adds trailing slash enforcement to base URL before endpoint concatenation to prevent malformed URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • #1075: URL-normalization changes directly affect the same Grafana request construction and endpoints used by the four dashboard tools added in that PR.

Suggested reviewers

  • aantn
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: correcting URL joining behavior in Grafana endpoints by removing leading slashes from paths to prevent base URL path loss.

✏️ 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.

@github-actions

github-actions Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Docker image ready for a48f981 (built in 4m 53s)

⚠️ Warning: does not support ARM (ARM images are built on release only - not on every PR)

Use this tag to pull the image for testing.

📋 Copy commands

⚠️ Temporary images are deleted after 30 days. Copy to a permanent registry before using them:

gcloud auth configure-docker us-central1-docker.pkg.dev
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes:a48f981
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes:a48f981 me-west1-docker.pkg.dev/robusta-development/development/holmes-dev:a48f981
docker push me-west1-docker.pkg.dev/robusta-development/development/holmes-dev:a48f981

Patch Helm values in one line (choose the chart you use):

HolmesGPT chart:

helm upgrade --install holmesgpt ./helm/holmes \
  --set registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set image=holmes-dev:a48f981

Robusta wrapper chart:

helm upgrade --install robusta robusta/robusta \
  --reuse-values \
  --set holmes.registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set holmes.image=holmes-dev:a48f981

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

🤖 Fix all issues with AI agents
In @holmes/plugins/toolsets/grafana/toolset_grafana.py:
- Around line 109-112: The _make_grafana_request method currently lets
response.raise_for_status() bubble up; catch requests.exceptions.HTTPError (and
general RequestException) around the requests call in _make_grafana_request and
return a StructuredToolResult with status=StructuredToolResultStatus.ERROR
(include the attempted full URL, the query_params/request payload, the HTTP
status code and response text from e.response if present, and any other request
details) and keep the success path returning
StructuredToolResult(status=StructuredToolResultStatus.SUCCESS, data=data,
url=url, params=query_params); ensure you reference the same variable names used
in the function (url, query_params, params, response) and include fallback text
if e.response is None.
🧹 Nitpick comments (1)
holmes/plugins/toolsets/grafana/toolset_grafana.py (1)

102-102: Update docstring example to match new endpoint format.

The docstring example still shows "/api/search" with a leading slash, but the actual usage now requires relative paths without leading slashes (e.g., "api/search").

📝 Proposed fix
-        endpoint: API endpoint path (e.g., "/api/search")
+        endpoint: API endpoint path (e.g., "api/search")
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed23a8b and 0f73038.

📒 Files selected for processing (1)
  • holmes/plugins/toolsets/grafana/toolset_grafana.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Always place Python imports at the top of the file, not inside functions or methods
Use Ruff for formatting and linting with configuration in pyproject.toml
Type hints required (mypy configuration in pyproject.toml)
Pre-commit hooks enforce quality checks on Python files

Files:

  • holmes/plugins/toolsets/grafana/toolset_grafana.py
holmes/plugins/toolsets/**/*.{py,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

holmes/plugins/toolsets/**/*.{py,yaml}: All toolsets MUST return detailed error messages from underlying APIs to enable LLM self-correction, including exact query/command executed, time ranges/parameters/filters used, and full API error response (status code and message)
For 'no data' responses in toolsets, specify what was searched and where
Never return unbounded data from APIs - always include filter parameters on tools that query collections

Files:

  • holmes/plugins/toolsets/grafana/toolset_grafana.py
holmes/plugins/toolsets/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

holmes/plugins/toolsets/**/*.py: Use requests library for HTTP calls in Python toolsets, not specialized client libraries like opensearchpy
Implement simple Pydantic config class with validation for Python toolsets
Include health check in prerequisites_callable() method for Python toolsets
Each tool in Python toolsets should be a thin wrapper around a single API endpoint
Use JsonFilterMixin for client-side filtering when server-side filtering is not possible, adding max_depth and jq parameters
Maintain backwards compatibility in toolset config using Pydantic's extra='allow' when renaming config fields
Only define current field names in toolset config schema with extra='allow' to avoid polluting model_dump() output with deprecated fields
Use @model_validator(mode='after') in toolset config to map old field names to new names and log deprecation warnings
Bash toolset validates commands for safety

Files:

  • holmes/plugins/toolsets/grafana/toolset_grafana.py
🧬 Code graph analysis (1)
holmes/plugins/toolsets/grafana/toolset_grafana.py (1)
holmes/plugins/toolsets/grafana/common.py (1)
  • get_base_url (35-39)
⏰ 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). (5)
  • GitHub Check: build
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.12)
  • GitHub Check: build (3.10)
  • GitHub Check: llm_evals
🔇 Additional comments (1)
holmes/plugins/toolsets/grafana/toolset_grafana.py (1)

75-75: Endpoint paths in toolset_grafana.py are correctly updated, but the refactoring is incomplete.

The endpoints at lines 75, 222, 264, 288, and 314 are correctly changed to relative paths for use with urljoin. However, grafana_tempo_api.py still uses leading-slash endpoints (/api/search at line 218, /api/v2/traces/{trace_id} at line 182, etc.) with simple string concatenation, which is inconsistent with this refactoring.

Update grafana_tempo_api.py to use relative paths (without leading slashes) and implement the same urljoin pattern as toolset_grafana.py for consistency.

Likely an incorrect or invalid review comment.

Comment thread holmes/plugins/toolsets/grafana/toolset_grafana.py
@arikalon1
arikalon1 merged commit 26cf7a6 into master Jan 8, 2026
15 of 17 checks passed
@arikalon1
arikalon1 deleted the grafana-dashboards-urljoin branch January 8, 2026 09:43
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