Feat: Support az monitor metrics (aks platform metrics) #54
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.
This pull request introduces significant changes to support Azure Monitor commands in the MCP toolset, including the addition of read-only, read-write, and admin commands, as well as utility functions for string manipulation. The changes also include extensive test coverage to validate functionality and integration.
Azure Monitor Command Support:
internal/components/monitor/registry.go: Added support for registering Azure Monitor commands (RegisterMonitorCommand) with categories for read-only, read-write, and admin commands. Includes predefined read-only commands such asaz monitor metrics list,az monitor metrics list-definitions, andaz monitor metrics list-namespaces.internal/server/server.go: Integrated Azure Monitor commands into the MCP server by registering them at appropriate access levels (read-only, read-write, admin). [1] [2] [3]Utility Functions:
internal/utils/strings.go: AddedReplaceSpacesWithUnderscoresutility function to standardize tool names by replacing spaces with underscores.Test Coverage:
internal/components/monitor/registry_test.go: Added tests forGetReadOnlyMonitorCommands,RegisterMonitorCommand, and validation of command registration with and without arguments.internal/utils/strings_test.go: Added unit tests forReplaceSpacesWithUnderscoresto ensure correct string manipulation.internal/security/validator_test.go: Added tests for validating Azure Monitor commands as read-only operations and ensuring proper security checks. [1] [2]Security Validation:
internal/security/validator.go: UpdatedAzReadOperationsto include Azure Monitor read-only commands for security validation.Code Cleanup:
internal/components/azaks/registry.go: Refactored to use the newReplaceSpacesWithUnderscoresutility function, removing the local implementation. [1] [2] [3]