Skip to main content
Glama

configure_tracing

Enable and manage distributed tracing for applications by configuring trace collection settings, including sampling rate and paths to exclude. Integrates with MCP Server for Coroot to optimize observability and performance monitoring.

Instructions

Configure distributed tracing for an application.

Controls trace collection settings including sampling rate and paths to exclude from tracing.

Args: project_id: The project ID app_id: The application ID enabled: Whether to enable tracing sample_rate: Optional trace sampling rate (0.0-1.0) excluded_paths: Optional list of URL paths to exclude

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
enabledYes
excluded_pathsNo
project_idYes
sample_rateNo

Implementation Reference

  • Core handler implementation for the configure_tracing tool. Handles FastMCP type conversions (string to float/list), constructs config, calls CorootClient.configure_tracing, and manages responses/errors.
    async def configure_tracing_impl( project_id: str, app_id: str, enabled: bool, sample_rate: Any = None, excluded_paths: Any = None, ) -> dict[str, Any]: """Implementation for configure_tracing tool.""" try: client = get_client() config = {"enabled": enabled} # Handle FastMCP type conversion issue for sample_rate if sample_rate is not None: if isinstance(sample_rate, str): try: sample_rate = float(sample_rate) except ValueError: return { "success": False, "error": f"Invalid sample_rate: {sample_rate}", } config["sample_rate"] = sample_rate # Handle FastMCP type conversion issue for excluded_paths if excluded_paths: if isinstance(excluded_paths, str): try: excluded_paths = json.loads(excluded_paths) if not isinstance(excluded_paths, list): return { "success": False, "error": ( f"excluded_paths must be a list, " f"got {type(excluded_paths).__name__}" ), } except json.JSONDecodeError: return { "success": False, "error": f"Invalid JSON for excluded_paths: {excluded_paths}", } config["excluded_paths"] = excluded_paths result = await client.configure_tracing(project_id, app_id, config) return { "success": True, "message": "Tracing configuration updated successfully", "config": result, } except ValueError as e: return {"success": False, "error": str(e)} except Exception as e: return {"success": False, "error": f"Unexpected error: {str(e)}"}
  • FastMCP tool registration with @mcp.tool() decorator. Defines input schema via parameters and delegates execution to configure_tracing_impl.
    @mcp.tool() async def configure_tracing( project_id: str, app_id: str, enabled: bool, sample_rate: Any = None, excluded_paths: Any = None, ) -> dict[str, Any]: """ Configure distributed tracing for an application. Controls trace collection settings including sampling rate and paths to exclude from tracing. Args: project_id: The project ID app_id: The application ID enabled: Whether to enable tracing sample_rate: Optional trace sampling rate (0.0-1.0) excluded_paths: Optional list of URL paths to exclude """ return await configure_tracing_impl( project_id, app_id, enabled, sample_rate, excluded_paths )
  • CorootClient helper method that makes the actual HTTP POST request to the Coroot API to configure tracing for the application.
    async def configure_tracing( self, project_id: str, app_id: str, config: dict[str, Any] ) -> dict[str, Any]: """Configure tracing for an application. Args: project_id: The project ID app_id: The application ID config: Tracing configuration Returns: Dict containing updated configuration """ # URL encode the app_id in case it contains slashes encoded_app_id = quote(app_id, safe="") response = await self._request( "POST", f"/api/project/{project_id}/app/{encoded_app_id}/tracing", json=config, ) data: dict[str, Any] = response.json() return data

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jamesbrink/mcp-coroot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server