clinic-api

Query PingCAP Clinic REST APIs for TiDB cluster metadata and diagnostics.

Updated Jun 3, 2026
One-click install
npx skills add https://github.com/alex-quan-001/nutshell-skills --skill clinic-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clinic-api
Source: https://github.com/alex-quan-001/nutshell-skills/tree/main/skills/platform/clinic-api
Command: npx skills add https://github.com/alex-quan-001/nutshell-skills --skill clinic-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, jq, python3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill eliminates the need to manually navigate multiple Clinic UI pages or write ad-hoc curl commands to gather cluster observability data. It provides a unified, scriptable interface for querying cluster metadata, slow queries, metrics, logs, profiling data, and diagnostic files from PingCAP Clinic.

Core Features & Use Cases

  • Cluster Metadata & Topology: Retrieve cluster details, node counts, CPU/memory specs, and storage configuration for Dedicated, Premium, and BYOC clusters.
  • Observability Data Access: Query Prometheus metrics, Loki logs, slow query logs, and TopSQL aggregates through standardized REST endpoints.
  • Diagnostic Artifacts: Download continuous profiling (pprof) data and NGM diagnostic bundles (plan replayer, OOM records) for offline analysis.
  • Use Case: When investigating a TiDB performance incident, use this skill to pull the cluster topology, fetch the top slow queries for the incident window, download CPU profiles from hot TiKV nodes, and retrieve recent OOM diagnostic files.

Quick Start

Use the clinic-api skill to retrieve cluster topology and recent slow query logs for a given cluster ID by sourcing the shell helper script and calling the appropriate sub-skill functions.

Frequently Asked Questions about clinic-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I retrieve TiDB cluster metrics and slow query logs for troubleshooting?

To retrieve TiDB cluster metrics and slow query logs, you can query PingCAP Clinic REST APIs using shell and Python helper utilities. This provides a scriptable interface to fetch Prometheus metrics, Loki logs, and TopSQL aggregates for performance diagnosis.

Can I download continuous profiling data and OOM diagnostic records from TiDB Cloud?

Yes, you can download continuous profiling data and OOM diagnostic records from TiDB Cloud. The skill queries Clinic REST APIs to retrieve NGM diagnostic bundles, including plan replayer and pprof data, for offline analysis of latency hotspots or out-of-memory events.

What dependencies do I need to run curl commands for PingCAP Clinic API queries?

You need curl, jq, and python3 installed to run PingCAP Clinic API queries. These dependencies support the shell and Python helper utilities used to query cluster metadata, metrics, logs, and diagnostic artifacts across Dev, Staging, and Production environments.

Does this approach support fetching cluster topology for Dedicated, Premium, and BYOC clusters?

Yes, fetching cluster topology supports Dedicated, Premium, and BYOC TiDB clusters. It retrieves cluster details, node counts, CPU and memory specs, and storage configuration by querying standardized Clinic REST endpoints using internal API key authentication.

Why use a scriptable interface instead of manually navigating the Clinic UI for observability data?

Using a scriptable interface eliminates the need to manually navigate multiple Clinic UI pages or write ad-hoc curl commands. It provides a unified way to gather cluster observability data, streamlining the investigation of TiDB performance incidents like slow queries and OOM events.

When do I need internal API key authentication to access TiDB diagnostics?

You need internal API key authentication to access TiDB diagnostics whenever querying PingCAP Clinic REST APIs for metadata, metrics, logs, or profiling data. This authentication is required across all supported Dev, Staging, and Production environments.