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 tool to list infrastructure hosts with CPU, memory, I/O wait and load metrics via /api/v1/hosts/list — the endpoint behind SigNoz's Infrastructure Monitoring > Hosts page. Rebased onto current main (2026-08-04) and adapted to upstream conventions introduced since March: slog instead of zap, doRequest helper, GetClient returning an error, registration via h.addTool, coded error helpers, read-only annotations + searchContext, entries in the pinned annotation inventory and manifest.json. Handler lives in its own infra.go, matching the per-domain file layout. Two earlier commits from the old branch are intentionally dropped: the list_alerts fix was addressed upstream in SigNoz#147, and signoz_list_triggered_alerts now duplicates upstream's signoz_list_alerts, which returns firing instances.
artgas1
force-pushed
the
feat/infrastructure-monitoring-hosts
branch
from
August 4, 2026 18:04
1cd9aa6 to
629d207
Compare
Author
|
Rebased onto current
Happy to adjust anything else if the tool is of interest. |
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.