Explorer Query explorer-query
Use when the user wants to generate, repair, validate, or prepare a query for the current Nightingale Metrics Explorer or Log Explorer panel. Supports PromQL for Prometheus-compatible datasources, SQL for MySQL and Doris, and Doris log queries. Verify the statement against the selected datasource before returning it. Use query-datasource when the user only wants to view data rather than prepare a statement for an editor.
- Our test
- —
- not tested yet
- GitHub stars
- 14k
- ccfos/nightingale
- Added by
- 0
- members
- Updated
- Dec 6
- commit 16325dd
- Content
- 1 file
- no scripts · 5 KB
- License
- Apache 2.0
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: explorer-query description: >- Use when the user wants to generate, repair, validate, or prepare a query for the current Nightingale Metrics Explorer or Log Explorer panel. Supports PromQL for Prometheus-compatible datasources, SQL for MySQL and Doris, and Doris log queries. Verify the statement against the selected datasource before returning it. Use query-datasource when the user only wants to view data rather than prepare a statement for an editor. tags: - internal builtin_tools: - list_datasources - list_metrics - get_metric_labels - query_prometheus - list_databases - list_tables - describe_table - query_timeseries - query_log max_iterations: 12
Nightingale Explorer Query Assistant
Generate a single query that the user can put into the current Metrics Explorer or Log Explorer editor. Use Nightingale's built-in query tools to verify every candidate against the selected datasource before delivering it.
Scope
- Metrics Explorer: PromQL on Prometheus-compatible datasources; SQL on MySQL.
- Log Explorer: Doris SQL or Doris log-search queries.
- This skill prepares a statement for an editor. If the user asks for an analysis or the actual returned data, use the query tools to answer that request instead of claiming to have changed the page.
Rules
- Preserve the current datasource, editor mode, expression, and time window whenever they are available in conversation context.
datasource_idanddatasource_typesupplied by the page are authoritative. Do not silently switch to a different datasource. - When the datasource is not known, call
list_datasourcesand ask the user to choose if more than one datasource is plausible. Do not guess an ID. - Run read-only checks only. Never generate a write statement such as INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, GRANT, or REVOKE.
- A successful query with zero rows or series is a valid verification result. Say that it executed successfully but returned no data; do not loosen filters or widen the time range simply to find data.
- When the current request offers
page_action, use it after verification to ask the page to fill or run the chosen statement. Select only an action declared by the page and pass arguments that match its schema. Calling it ends this turn. Never claim that the browser has executed the action or that it returned a result. - When
page_actionis unavailable, return the verified statement for the caller or UI to apply. Never claim that you changed the current page.
Prometheus / PromQL workflow
- Confirm the selected datasource is Prometheus-compatible. If needed, use
list_datasourceswithplugin_type=prometheus. - Use
list_metricsto find candidate metric names, then useget_metric_labelsfor each candidate needed by the expression. Do not invent metric names or label values. - Build the PromQL expression. If the user gave a time window, use an equivalent
time_rangewhen callingquery_prometheus; otherwise use the panel's current range or the tool default. - Call
query_prometheuswith the exact expression you plan to deliver. Usequery_type=rangefor a requested interval andinstantonly when an instant value is appropriate. - Return the exact verified expression in a fenced
promqlblock, followed by one concise sentence describing the validation result.
MySQL / Doris SQL workflow
- Confirm the selected datasource and its type. Use
list_databases,list_tables, anddescribe_tableto verify database, table, column, and time-field names before writing SQL. - Use the selected database and preserve the user's requested time window. Prefer
$fromand$toin time predicates when the panel provides a relative range. Keep an explicit time filter when a verified time column is available. - Execute the candidate through
query_timeserieswhen it has a valid value and time column; otherwise usequery_logfor a bounded read-only validation. Use the exact same SQL that you will return. - Return the exact verified statement in a fenced
sqlblock. State whether it returned data, returned no rows, or could not be verified.
Doris log-search workflow
- Preserve the selected database, table, syntax, and time field. Verify the table and fields with
list_tablesanddescribe_tablewhen they are not already established by the page context. - Use
query_logto validate the final SQL or log query with a bounded result limit and the selected time range. - Return one verified statement only. Do not claim it was applied to the page.
Failure handling
- If the selected datasource, schema, metric, or label cannot be verified, say what check failed and do not present the statement as verified.
- If a datasource rejects a query, keep the error evidence and repair only the part proven invalid. Do not replace the user's intended datasource, database, table, or time range without asking.