update_db_instrumentation
Configure database monitoring settings in Coroot to instrument and track performance metrics for MySQL, PostgreSQL, Redis, MongoDB, or Memcached databases.
Instructions
Update database instrumentation configuration.
Configures how Coroot instruments and monitors a specific database.
Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) db_type: Database type (mysql, postgres, redis, mongodb, memcached) config: Instrumentation configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| app_id | Yes | ||
| db_type | Yes | ||
| config | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1196-1214 (handler)MCP tool handler function decorated with @mcp.tool(). This is the entry point for the 'update_db_instrumentation' tool, which delegates to an internal implementation.@mcp.tool() async def update_db_instrumentation( project_id: str, app_id: str, db_type: str, config: dict[str, Any] ) -> dict[str, Any]: """Update database instrumentation configuration. Configures how Coroot instruments and monitors a specific database. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) db_type: Database type (mysql, postgres, redis, mongodb, memcached) config: Instrumentation configuration """ return await update_db_instrumentation_impl( # type: ignore[no-any-return] project_id, app_id, db_type, config )
- src/mcp_coroot/server.py:1182-1194 (helper)Internal helper implementation that calls the CorootClient.update_db_instrumentation method and formats the response.@handle_errors async def update_db_instrumentation_impl( project_id: str, app_id: str, db_type: str, config: dict[str, Any] ) -> dict[str, Any]: """Update database instrumentation config.""" client = get_client() result = await client.update_db_instrumentation(project_id, app_id, db_type, config) return { "success": True, "message": f"{db_type} instrumentation updated successfully", "config": result, }
- src/mcp_coroot/client.py:1409-1435 (helper)CorootClient method that performs the actual HTTP POST request to the Coroot API to update database instrumentation configuration.async def update_db_instrumentation( self, project_id: str, app_id: str, db_type: str, config: dict[str, Any] ) -> dict[str, Any]: """Update database instrumentation configuration. Args: project_id: Project ID. app_id: Application ID. db_type: Database type (mysql, postgres, redis, mongodb, memcached). config: Instrumentation configuration. Returns: Updated instrumentation configuration. """ # URL encode the app_id since it contains slashes from urllib.parse import quote encoded_app_id = quote(app_id, safe="") response = await self._request( "POST", f"/api/project/{project_id}/app/{encoded_app_id}/instrumentation/{db_type}", json=config, ) data: dict[str, Any] = response.json() return data