Skip to content

Conversation

@cboffa13
Copy link
Member

@cboffa13 cboffa13 commented Nov 6, 2025

Description

This PR enhances the monitoring MCP server. This separates the "Alarms" and the "Metrics" into their own folders. The following tools are now available within the Monitoring MCP Server:

Tool Name Description Status
list_alarms List Alarms in the tenancy Unchanged
get_compute_metrics Gets only compute metrics Unchanged
get_metrics_data Gets aggregated metric data New Tool Added
get_available_metrics Lists the available metrics a user can query on in their tenancy New Tool Added

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

You can ask specific or generic questions related to metrics or alarms

  • In my tenancy, can you list all my metric namespaces?
  • For my compute instance ocid1.instance.oc1.phx.... can you list the VolumeReadOps for the last week?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 6, 2025
@cboffa13 cboffa13 changed the title Feature: Monitoring MCP Enhancements WIP - Feature: Monitoring MCP Enhancements Nov 6, 2025
@cboffa13 cboffa13 force-pushed the cboffa/feature/monitoring-enhancements branch 6 times, most recently from a709d2d to 8f47eeb Compare November 7, 2025 21:53
@cboffa13 cboffa13 changed the title WIP - Feature: Monitoring MCP Enhancements Feature: Monitoring MCP Enhancements Nov 10, 2025
@cboffa13 cboffa13 force-pushed the cboffa/feature/monitoring-enhancements branch from 8f47eeb to df40bf4 Compare November 13, 2025 18:01
@cboffa13 cboffa13 marked this pull request as ready for review November 18, 2025 19:05
@shopewf
Copy link
Member

shopewf commented Dec 12, 2025

I dont mind the change in structure (i.e. splitting the server up into metrics vs alarms), but im wondering if it would just be simpler for us to keep the normal structure of a server intact and separate them in their files by regions?

It's my preferred way of splitting things up like that because in any code editor you could just collapse all of the alarms section if you only wanted to look at metrics. I typically always collapse every single piece of code that im not actively working on

E.g. server.py

# region alarms
... region tools
# endregion

# region metrics
... metrics tools
# endregion

OR we dont even have to worry about the difference between alarms and metrics. I think of our compute server where we have instances, images, and vnic attachments all together

statistic: StatisticType = Field(
"mean", description="The statistic to use for the metric"
),
resolution: str = Field(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense for us to pass in a Literal enum here instead?

"The default resolution is 1m (one minute).",
examples=["1m", "5m", "1h", "1d"],
),
resource_group: str | None = Field(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this parameter get used anywhere?

"ocid1.instance.oc1.phx.anyhqljt6vnpo4icbvfcrphq2vkdmivmlbhupdw46nth7scky6rbigwjc7ea"
],
),
metric: str = Field(
Copy link
Member

@shopewf shopewf Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This goes for every parameter for this function, but if you pass in a default value (in the case here it's "InstanceMetadataRequests"), it's best to wrap the parameter type in Optional. So in this case it would be
metric: Optional[str] = Field(...)

"oci_compute",
description="The source service or application to use when searching for metric data points"
"to aggregate.",
examples=["oci_compute"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are any namespaces besides this supposed to be determined?

# Conflicts:
#	src/oci-monitoring-mcp-server/oracle/oci_monitoring_mcp_server/tests/test_monitoring_tools.py
@cboffa13 cboffa13 force-pushed the cboffa/feature/monitoring-enhancements branch from df40bf4 to 87a11c5 Compare December 15, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants