feat: add signoz_list_hosts tool for infrastructure monitoring#67
Open
artgas1 wants to merge 1 commit into
Open
feat: add signoz_list_hosts tool for infrastructure monitoring#67artgas1 wants to merge 1 commit into
artgas1 wants to merge 1 commit into
Conversation
Adds a new tool to list infrastructure hosts with CPU, memory, I/O wait, and load metrics. Uses the /api/v1/hosts/list endpoint which powers SigNoz's Infrastructure Monitoring > Hosts page. Returns simplified host data: hostName, active status, OS, CPU usage, memory usage, I/O wait, and load average (15m). Supports time range, sorting by any metric column, and pagination. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
signoz_list_hoststool that exposes SigNoz's Infrastructure Monitoring hosts data via MCP. This enables AI assistants to check server health, CPU/memory usage, and load averages directly.New Tool
signoz_list_hosts— List infrastructure hosts with resource utilization metrics.Parameters
Example Response
{ "hosts": [ { "hostName": "production-vps", "active": true, "os": "linux", "cpu": 0.33, "memory": 0.36, "wait": 0.004, "load15": 2.05 } ], "total": 5, "sentAnyHostMetricsData": true }Implementation
ListHosts()→POST /api/v1/hosts/listHostListRequest,HostListResponse,HostRecordin newpkg/types/infra.goRegisterInfraHandlers()Use Case
This was motivated by a real incident where a VPS became overloaded but we couldn't query host metrics through MCP. The existing
signoz_execute_builder_queryrequires complex query construction for host metrics, while this tool provides a simple, purpose-built interface.