Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions holmes/plugins/toolsets/datadog/toolset_datadog_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def __init__(self, toolset: "DatadogTracesToolset"):
name="fetch_datadog_traces",
description="Fetch a list of traces from Datadog with optional filters",
parameters={
"query": ToolParameter(
description="Datadog search query (e.g., 'service:web-app @http.status_code:500')",
type="string",
required=False,
),
"service": ToolParameter(
description="Filter by service name",
type="string",
Expand Down Expand Up @@ -200,6 +205,9 @@ def __init__(self, toolset: "DatadogTracesToolset"):

def get_parameterized_one_liner(self, params: dict) -> str:
"""Get a one-liner description of the tool invocation."""
if "query" in params:
return f"{toolset_name_for_one_liner(self.toolset.name)}: Fetch Traces ({params['query']})"

filters = []
if "service" in params:
filters.append(f"service={params['service']}")
Expand Down Expand Up @@ -238,6 +246,11 @@ def _invoke(self, params: Any) -> StructuredToolResult:
# Build search query
query_parts = []

# If a custom query is provided, use it as the base
if params.get("query"):
query_parts.append(params["query"])

# Add additional filters
if params.get("service"):
query_parts.append(f"service:{params['service']}")

Expand Down