Skip to content

fix datadog docs and remove experimental tag - #939

Merged
aantn merged 2 commits into
masterfrom
fix-datadog-docs-link
Sep 4, 2025
Merged

aantn merged 2 commits into
masterfrom
fix-datadog-docs-link

Conversation

@aantn

@aantn aantn commented Sep 4, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@aantn
aantn requested a review from Sheeproid September 4, 2025 11:14
@coderabbitai

coderabbitai Bot commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Removed experimental=True from multiple toolset initializations and updated several toolset docs_url values; added two # type: ignore[arg-type] comments on requests.post calls in the New Relic tool. No public API signatures were changed.

Changes

Cohort / File(s) Summary
Datadog toolsets (remove experimental flag + docs_url updates)
holmes/plugins/toolsets/datadog/toolset_datadog_general.py, holmes/plugins/toolsets/datadog/toolset_datadog_logs.py, holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py, holmes/plugins/toolsets/datadog/toolset_datadog_traces.py
Removed experimental=True from Toolset/super().__init__ calls in each Datadog toolset; updated docs_url values to https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/.
Git toolset: docs_url update
holmes/plugins/toolsets/git.py
Updated docs_url from https://docs.github.com/en/rest to https://holmesgpt.dev/data-sources/builtin-toolsets/github/.
New Relic: type-ignore annotations + docs_url update
holmes/plugins/toolsets/newrelic.py
Added # type: ignore[arg-type] comments to two requests.post calls to suppress type-checker warnings; updated docs_url to HolmesGPT docs URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • nherment
  • arikalon1
  • moshemorad
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-datadog-docs-link

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 or @coderabbit 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.

Sheeproid
Sheeproid previously approved these changes Sep 4, 2025

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

🧹 Nitpick comments (3)
holmes/plugins/toolsets/datadog/toolset_datadog_logs.py (3)

145-149: Capability mismatch with docstring — consider adding substring support flag.
Docstring says “historical data and substring matching,” but only HISTORICAL_DATA is returned. If applicable, include SUBSTRING_MATCH in the set; otherwise, align the docstring.

-        return {
-            LoggingCapability.HISTORICAL_DATA
-        }  # No regex support, no exclude filter, but supports historical data
+        return {
+            LoggingCapability.HISTORICAL_DATA,
+            LoggingCapability.SUBSTRING_MATCH,  # if available in enum
+        }  # No regex support, no exclude filter; supports historical + substring

86-88: Avoid shadowing built-in filter.
Use a different name to prevent confusion and improve readability.

-    if params.filter:
-        filter = params.filter.replace('"', '\\"')
-        query += f' "{filter}"'
+    if params.filter:
+        filter_term = params.filter.replace('"', '\\"')
+        query += f' "{filter_term}"'

164-166: Consistent brand casing.
Prefer “Datadog” over “DataDog”.

 def logger_name(self) -> str:
-    return "DataDog"
+    return "Datadog"
📜 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 44fa5fe and a5575d7.

📒 Files selected for processing (4)
  • holmes/plugins/toolsets/datadog/toolset_datadog_general.py (0 hunks)
  • holmes/plugins/toolsets/datadog/toolset_datadog_logs.py (1 hunks)
  • holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py (0 hunks)
  • holmes/plugins/toolsets/datadog/toolset_datadog_traces.py (0 hunks)
💤 Files with no reviewable changes (3)
  • holmes/plugins/toolsets/datadog/toolset_datadog_traces.py
  • holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py
  • holmes/plugins/toolsets/datadog/toolset_datadog_general.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Always place Python imports at the top of the file, not inside functions or methods
Type hints are required (mypy is configured in pyproject.toml)

Files:

  • holmes/plugins/toolsets/datadog/toolset_datadog_logs.py
holmes/plugins/toolsets/**

📄 CodeRabbit inference engine (CLAUDE.md)

Toolsets must live under holmes/plugins/toolsets as either {name}.yaml or a {name}/ directory

Files:

  • holmes/plugins/toolsets/datadog/toolset_datadog_logs.py
⏰ 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: llm_evals
  • GitHub Check: Pre-commit checks
  • GitHub Check: Pre-commit checks
🔇 Additional comments (1)
holmes/plugins/toolsets/datadog/toolset_datadog_logs.py (1)

154-154: Docs URL update — LGTM.
New link looks correct and clearer for users.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
holmes/plugins/toolsets/newrelic.py (5)

82-89: Add a client-side timeout and handle GraphQL 200-with-errors responses

Requests without timeouts can hang; GraphQL may return 200 with an "errors" payload. Handle both.

Apply:

-            response = requests.post(url, headers=headers, json=query)  # type: ignore[arg-type]
+            response = requests.post(url, headers=headers, json=query, timeout=15)  # type: ignore[arg-type]

-            if response.status_code == 200:
-                return success(response.json())
+            if response.status_code == 200:
+                body = response.json()
+                if isinstance(body, dict) and body.get("errors"):
+                    return error(f"New Relic GraphQL errors: {body['errors']}")
+                return success(body)

167-174: Same here: add timeout and check for GraphQL errors

Mirror the fix in traces.

-            response = requests.post(url, headers=headers, json=query)  # type: ignore[arg-type]
+            response = requests.post(url, headers=headers, json=query, timeout=15)  # type: ignore[arg-type]

-            if response.status_code == 200:
-                return success(response.json())
+            if response.status_code == 200:
+                body = response.json()
+                if isinstance(body, dict) and body.get("errors"):
+                    return error(f"New Relic GraphQL errors: {body['errors']}")
+                return success(body)

137-144: Validate and coerce duration; avoid string-math and enforce > 0

Prevents bad NRQL and type issues.

-        duration = get_param_or_raise(params, "duration")
+        try:
+            duration = float(get_param_or_raise(params, "duration"))
+        except Exception:
+            return error("Invalid 'duration': must be a number (seconds).")
+        if duration <= 0:
+            return error("'duration' must be > 0 seconds.")
@@
-        if trace_id:
-            query_string = f"SELECT * FROM Span WHERE trace.id = '{trace_id}' and duration.ms > {duration * 1000} and span.kind != 'internal'"
-        else:
-            query_string = f"SELECT * FROM Span WHERE duration.ms > {duration * 1000} and span.kind != 'internal'"
+        ms = int(duration * 1000)
+        if trace_id:
+            query_string = f"SELECT * FROM Span WHERE trace.id = '{trace_id}' and duration.ms > {ms} and span.kind != 'internal'"
+        else:
+            query_string = f"SELECT * FROM Span WHERE duration.ms > {ms} and span.kind != 'internal'"

61-72: Harden NRQL string construction (basic injection/breakage guard)

User-provided app/since/trace_id are interpolated verbatim; guard with minimal validation.

Add before building each query:

+        # Basic validation to avoid broken NRQL/injection
+        import re  # at file top
+        if not isinstance(app, str) or not re.fullmatch(r"[\w.\-]+", app):
+            return error("Invalid 'app' (allowed: letters, digits, _, -, .).")
+        if not isinstance(since, str) or not re.fullmatch(r"\d+\s+(minutes?|hours?|days?)\s+ago", since):
+            return error("Invalid 'since' (e.g., '1 hour ago').")

For traces (when trace_id is provided):

+        if trace_id and not re.fullmatch(r"[A-Fa-f0-9\-]+", str(trace_id)):
+            return error("Invalid 'trace_id' format.")

Note: If you prefer stricter patterns, we can align with your NR standards.

Also applies to: 146-157


196-209: Replace invalid docs_url in azure_sql_toolset.py
holmes/plugins/toolsets/azure_sql/azure_sql_toolset.py:60 – update the kagi.com link to the official holmesgpt.dev documentation page.

🧹 Nitpick comments (4)
holmes/plugins/toolsets/newrelic.py (4)

207-207: Confirm intent: remove experimental flag here too

PR title mentions removing the experimental tag. This toolset still sets experimental=True. If intended to de-experimentalize, drop the arg.

-            experimental=True,

If you want consistency across toolsets, I can sweep and patch all remaining occurrences.


230-231: Provide example config keys for better UX

Helps users wire credentials correctly.

-        return {}
+        return {
+            "nr_account_id": "<your_newrelic_account_id>",
+            "nr_api_key": "<your_newrelic_api_key>"
+        }

1-1: Optional: drop import-wide type ignore by adding stubs

Prefer installing types-requests and removing the import-level ignore to keep type coverage high.

I can open a small PR adding types-requests to dev deps if you want.


82-82: Consider using a Session for connection reuse (nit)

If these tools are invoked frequently, a shared requests.Session with keep-alive can help.

I can sketch a minimal session holder on the Toolset if desired.

Also applies to: 167-167

📜 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 a5575d7 and 13f9780.

📒 Files selected for processing (5)
  • holmes/plugins/toolsets/datadog/toolset_datadog_general.py (1 hunks)
  • holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py (1 hunks)
  • holmes/plugins/toolsets/datadog/toolset_datadog_traces.py (1 hunks)
  • holmes/plugins/toolsets/git.py (1 hunks)
  • holmes/plugins/toolsets/newrelic.py (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • holmes/plugins/toolsets/git.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • holmes/plugins/toolsets/datadog/toolset_datadog_traces.py
  • holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py
  • holmes/plugins/toolsets/datadog/toolset_datadog_general.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Always place Python imports at the top of the file, not inside functions or methods
Type hints are required (mypy is configured in pyproject.toml)

Files:

  • holmes/plugins/toolsets/newrelic.py
holmes/plugins/toolsets/**

📄 CodeRabbit inference engine (CLAUDE.md)

Toolsets must live under holmes/plugins/toolsets as either {name}.yaml or a {name}/ directory

Files:

  • holmes/plugins/toolsets/newrelic.py
🪛 Ruff (0.12.2)
holmes/plugins/toolsets/newrelic.py

82-82: Probable use of requests call without timeout

(S113)


167-167: Probable use of requests call without timeout

(S113)

⏰ 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: Pre-commit checks
  • GitHub Check: llm_evals
  • GitHub Check: Pre-commit checks
🔇 Additional comments (1)
holmes/plugins/toolsets/newrelic.py (1)

200-200: docs_url update looks good

Correct link to holmesgpt.dev.

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Results of HolmesGPT evals

  • ask_holmes: 33/37 test cases were successful, 1 regressions, 2 skipped, 1 setup failures
Test suite Test case Status
ask 01_how_many_pods ✅
ask 02_what_is_wrong_with_pod ✅
ask 04_related_k8s_events ↪️
ask 05_image_version ✅
ask 09_crashpod ✅
ask 10_image_pull_backoff ✅
ask 110_k8s_events_image_pull ✅
ask 11_init_containers ✅
ask 13a_pending_node_selector_basic ✅
ask 14_pending_resources ✅
ask 15_failed_readiness_probe ✅
ask 17_oom_kill ✅
ask 18_crash_looping_v2 ✅
ask 19_detect_missing_app_details ✅
ask 20_long_log_file_search ✅
ask 24_misconfigured_pvc ✅
ask 24a_misconfigured_pvc_basic ✅
ask 28_permissions_error 🚧
ask 29_events_from_alert_manager ↪️
ask 39_failed_toolset ✅
ask 41_setup_argo ✅
ask 42_dns_issues_steps_new_tools ✅
ask 43_current_datetime_from_prompt ✅
ask 45_fetch_deployment_logs_simple ✅
ask 51_logs_summarize_errors ✅
ask 53_logs_find_term ✅
ask 54_not_truncated_when_getting_pods ❌
ask 59_label_based_counting ✅
ask 60_count_less_than ✅
ask 61_exact_match_counting ✅
ask 63_fetch_error_logs_no_errors ✅
ask 79_configmap_mount_issue ✅
ask 83_secret_not_found ✅
ask 86_configmap_like_but_secret ✅
ask 93_calling_datadog[0] ✅
ask 93_calling_datadog[1] ✅
ask 93_calling_datadog[2] ✅

Legend

  • ✅ 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 failed and should be fixed before merging the PR

@aantn
aantn merged commit e195c3b into master Sep 4, 2025
11 checks passed
@aantn
aantn deleted the fix-datadog-docs-link branch September 4, 2025 11:28
@coderabbitai coderabbitai Bot mentioned this pull request Sep 18, 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