cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.18k stars 3.81k forks source link

Restful endpoint data needs to accessible via SQL #58630

Open glennfawcett opened 3 years ago

glennfawcett commented 3 years ago

Is your feature request related to a problem? Please describe. There are several end-points that contain useful data, but requires a two-step process to Extract data and subsequently lookup in CRDB. For example, see the hottest_ranges tool. If this data was available via SQL, one simple Query would be able to return the SAME data.

Describe the solution you'd like Create a virtual table in CRDB_INTERNAL or ?? to expose the restful endpoints so they can be accessed by SQL.

Additional context This has been used with various customers and I even wrote a BLOG on how to diagnosis a hot single range.

gz#7851

Epic CRDB-2537

Jira issue: CRDB-3375

blathers-crl[bot] commented 3 years ago

Hi @glennfawcett, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

While you're here, please consider adding an A- label to help keep our repository tidy.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

glennfawcett commented 3 years ago

A display like so where the size of the blocks is the QPS volume by Object type...

Screen Shot 2021-01-26 at 11 49 30 AM
glennfawcett commented 3 years ago

Put QPS metric per range into the crdb_internal.ranges table. If this were done, it would be real easy to show the hottest objects by just a simple SQL statement:

SELECT database_name, table_name, index_name, qps
FROM crdb_internal.ranges
ORDER BY qps DESC
LIMIT 10;