feat(metric): add get_service_metrics tool#215
Open
matty69v wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Hello team do we have some news from my 2 pr's ? |
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.
Hey team,
Continuing my contributions after #209 (force_check) and #210 (get_resource_timeline). Still dogfooding the MCP server with Claude Code against a staging Centreon.
The gap
After using
list_resourcesto confirm a service is in WARNING or CRITICAL state, the natural follow-up is "what's the actual value?" The output string sometimes contains metrics, but it's unstructured text that the LLM has to parse heuristically. Meanwhile, the structured metric data (current value, unit, thresholds) is already available via the API but not exposed through MCP.What this PR adds
A new
get_service_metricstool in a dedicatedcomponents/metric.pymodule:readOnlyHint=True,idempotentHint=TrueGET /monitoring/hosts/{host_id}/services/{service_id}/metrics(API docs)Implementation notes
Metricmodel inutils/type.pywith alist(host_id, service_id)static methodcomponents/metric.pymodule (one module per API doc section, per reviewer feedback on feat(resource): add force_check tool to trigger checks on demand #209/feat(resource): add get_resource_timeline tool #210)host_id,service_id) rather than a wrapper objectTool count
12 → 13. README updated.
Tests
2 new tests, all passing alongside the existing suite:
tests/utils/test_type.py::test_metric_listtests/components/test_metric.py::test_get_service_metricsNo new dependencies, no breaking changes.
Summary by Aikido
🚀 New Features
More info