-
Notifications
You must be signed in to change notification settings - Fork 4
SQL: monitoring #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kbatuigas
wants to merge
2
commits into
main
Choose a base branch
from
DOC-2197-sql-monitoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SQL: monitoring #602
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| = Monitor Redpanda SQL | ||
| :description: Scrape Prometheus metrics from your Redpanda SQL engine to monitor query throughput, latency, node health, and resource use. | ||
| :page-topic-type: how-to | ||
| :personas: platform_admin | ||
| :learning-objective-1: Identify Redpanda SQL metrics in your Cloud Prometheus scrape | ||
| :learning-objective-2: Write PromQL queries against the most operationally useful SQL metrics | ||
|
|
||
| Redpanda SQL exports Prometheus metrics that you can scrape alongside your broker metrics to track query load, latency, error rates, node health, and resource consumption. These metrics flow through the same Cloud OpenMetrics endpoint you already use for broker metrics, so you don't need additional scrape configuration. | ||
|
|
||
| After reading this page, you will be able to: | ||
|
|
||
| * [ ] {learning-objective-1} | ||
| * [ ] {learning-objective-2} | ||
|
|
||
| == Prerequisites | ||
|
|
||
| * A BYOC cluster with Redpanda SQL enabled. See xref:sql:get-started/deploy-sql-cluster.adoc[Deploy a Redpanda SQL cluster]. | ||
| * Prometheus, or a Prometheus-compatible scraper, configured against your Cloud cluster. See xref:manage:monitor-cloud.adoc[Monitor Redpanda Cloud]. | ||
|
|
||
| == Where SQL metrics appear | ||
|
|
||
| Redpanda SQL metrics are named with the `oxla_` prefix (for example, `oxla_query_duration_seconds`, `oxla_node_is_ready_bool`) and are surfaced through the same `/api/cloud/prometheus/public_metrics` endpoint that exposes broker metrics. After you configure scraping as described in xref:manage:monitor-cloud.adoc#configure-redpanda-monitoring[Monitor Redpanda Cloud], SQL metrics appear in your time-series database without additional configuration. | ||
|
|
||
| To see the full set of names and what each one means, see xref:reference:public-metrics-reference.adoc#redpanda-sql-metrics[Redpanda SQL metrics reference]. | ||
|
|
||
| == Useful PromQL queries | ||
|
|
||
| The following examples cover the most common operational signals. SQL metrics use three Prometheus types: counter (monotonic total), gauge (current value), and histogram (latency distribution). | ||
|
|
||
| === Node health | ||
|
|
||
| Alert when any SQL node reports itself not ready or degraded: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| max by (pod) (oxla_node_is_ready_bool) < 1 | ||
| max by (pod) (oxla_node_is_degraded_bool) > 0 | ||
| ---- | ||
|
|
||
| === Query throughput and errors | ||
|
|
||
| Query rate per second, by statement type: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| sum by (stmt_type) (rate(oxla_query_duration_seconds_count[5m])) | ||
| ---- | ||
|
|
||
| Query error rate by error category: | ||
|
|
||
| * `parse_error` | ||
| * `plan_error` | ||
| * `execution_error` | ||
| * `oom` | ||
| * `cancelled` | ||
| * `other` | ||
|
|
||
| [,promql] | ||
| ---- | ||
| sum by (error_type) (rate(oxla_query_errors_total[5m])) | ||
| ---- | ||
|
|
||
| === Query latency | ||
|
|
||
| p95 end-to-end query latency by statement type: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| histogram_quantile(0.95, sum by (stmt_type, le) (rate(oxla_query_duration_seconds_bucket[5m]))) | ||
| ---- | ||
|
|
||
| To break down latency by phase, apply the same `histogram_quantile` pattern to `oxla_query_parse_duration_seconds`, `oxla_query_plan_duration_seconds`, and `oxla_query_execute_duration_seconds`: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| histogram_quantile(0.95, sum by (le) (rate(oxla_query_parse_duration_seconds_bucket[5m]))) | ||
| histogram_quantile(0.95, sum by (le) (rate(oxla_query_plan_duration_seconds_bucket[5m]))) | ||
| histogram_quantile(0.95, sum by (le) (rate(oxla_query_execute_duration_seconds_bucket[5m]))) | ||
| ---- | ||
|
|
||
| === Admission control | ||
|
|
||
| Currently admitted and enqueued queries, and the rate of admission timeouts: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| oxla_admission_active_queries | ||
| oxla_admission_enqueued_queries | ||
| rate(oxla_admission_timeout_queries_failed_total[5m]) | ||
| ---- | ||
|
|
||
| === Resource use | ||
|
|
||
| Resident memory per pod: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| oxla_process_memory_total | ||
| ---- | ||
|
|
||
| Open client connections: | ||
|
|
||
| [,promql] | ||
| ---- | ||
| oxla_num_open_connections | ||
| ---- | ||
|
|
||
| == Suggested reading | ||
|
|
||
| * xref:reference:public-metrics-reference.adoc#redpanda-sql-metrics[Redpanda SQL metrics reference] | ||
| * xref:manage:monitor-cloud.adoc[Monitor Redpanda Cloud] | ||
| * xref:sql:troubleshoot/degraded-state-handling.adoc[] | ||
| * xref:sql:troubleshoot/query-out-of-memory.adoc[] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit before merge