Skip to content

[DOC-12664] Automatic Workload Reporting #342

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
wants to merge 16 commits into
base: release/8.0
Choose a base branch
from

Conversation

rakhi-prathap
Copy link
Contributor

@rakhi-prathap rakhi-prathap commented Apr 28, 2025

Add documentation for Automatic Workload Reporting (AWR).
Jira: DOC-12664

Doc changes:

  • Add a new page for AWR.
  • Update Get System Info page to include a link to system:awr.
  • Update Administer Queries and Indexes home page to add a link to AWR.

Previews:

Credentials: Preview docs for internal review

@rakhi-prathap rakhi-prathap requested a review from simon-dew April 28, 2025 05:39
@rakhi-prathap rakhi-prathap marked this pull request as draft April 30, 2025 09:55
@rakhi-prathap rakhi-prathap marked this pull request as ready for review May 7, 2025 10:48
These metrics are captured at set intervals and stored as snapshots.
Each snapshot can be considered as a point-in-time capture of the query performance and includes key metrics such as total elapsed time (minimum, maximum, and average), CPU usage, and number of queries executed.

All snapshots are stored in a user-defined keyspace (bucket, scope, collection), which acts as a central repository for AWR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All snapshots are stored in a user-defined keyspace (bucket, scope, collection)...

the keyspace cannot be a scope. it can only be the path to a bucket or collection


* **Troubleshooting Real-Time Issues**:
You can quickly identify slow running queries or instances of high resource usage.
By using the SQL IDs from the AWR data, you can trace the problematic queries and their sources and resolve issues faster.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add how sqlId will be present in completed_requests entries as well.. And that is how a user can trace queries?

UPDATE system:awr SET enabled = true;
----

Upon executing this query, AWR will begin collecting performance statistics for all queries executed on the cluster.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon executing this query, AWR will begin collecting performance statistics for all queries executed on the cluster.

This needs to be slightly modified..

Only when enabled is set to true and the location is set and the configured keyspace available.. will AWR begin its operations.


|**enabled** +
| Indicates whether AWR is enabled or disabled.
| Boolean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add the default value for enabled?

Default: false

By default AWR is disabled, so it is an opt-in feature.

My apologies, I believe this was not added in the DOC ticket description.

| Boolean

| **location** +
| The target keyspace (bucket, scope, collection) where the data is stored.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target keyspace (bucket, scope, collection) where the data is stored.

This needs to be slightly modified, since the keyspace cannot be a scope. "location" can only be the path to a bucket or collection.

Add an example as well.

Example: "bucket1.scope1.collection1"

| **pln** +
|An array containing the encoded, compressed outlines of the execution plan for both the minimum and maximum execution times of the statement.

You can use the xref:n1ql:n1ql-language-reference/stringfun.adoc#fn-str-uncompress[UNCOMPRESS()] function to decompress this the value into a string, which can then be passed to xref:n1ql:n1ql-language-reference/jsonfun.adoc[DECODE_JSON()] for formatting, if needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor:

This reads like you must use UNCOMPRESS() and then DECODE_JSON() on the entire array of plan outlines.

Perhaps change "... UNCOMPRESS() function to decompress this the value into a string..." to "...UNCOMPRESS() function to decompress the execution plan strings..." ?


=== Example
====
The following example fetches AWR data for a specific SQL ID, including the statement text, max execution plan, statement count, total time, and max CPU usage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change:

"statement count" to "number of executions"

Using AWR, you can easily identify these differences, understand your workload, and determine areas for optimization.

When enabled, AWR automatically gathers detailed metrics from the Query service for every query that you run.
These metrics are captured at set intervals and stored as snapshots.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps when introducing the "snapshot" concept.. we can elaborate a bit more. The reason being, it should be clear what the snapshot holds, and it is generated for every unique statement.

The details:

AWR generates a snapshot for every unique statement that executed in the interval. And the snapshot is the aggregate information for all executions of that statement during the reporting interval.

|**interval** +
|The duration of the reporting interval.
That is, the time between each snapshot or data collection.
If the interval is set to 10 minutes, AWR captures a data every 10 minutes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor:

Maybe change "a data" to "snapshots"

@@ -0,0 +1,420 @@
= Automatic Workload Reporting
Copy link

@dhanyagowrish dhanyagowrish Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add snapshot document retention management to this page?

That users will need to configure the TTL for the AWR location to configure the retention period of the snapshot documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants