-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New CLI examples for RDS Performance Insights #9473
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
Merged
Merged
Changes from 1 commit
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| **To create a performance analysis report** | ||
|
|
||
| The following ``create-perforamnce-analysis-report`` example creates a performance analysis report with the start time ``1682969503`` and end time ``1682979503`` for the database ``db-loadtest-0``. :: | ||
|
|
||
| aws pi create-performance-analysis-report \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
| --start-time 1682969503 \ | ||
| --end-time 1682979503 \ | ||
| --region us-west-2 | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "AnalysisReportId": "report-0234d3ed98e28fb17" | ||
| } | ||
|
|
||
| For more information about creating performance analysis reports, see `Creating a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.html>`__ in the *Amazon RDS User Guide* and `Creating a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.html>`__ in the *Amazon Aurora User Guide*. | ||
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,13 @@ | ||
| **To delete a performance analysis report** | ||
|
|
||
| The following ``delete-perforamnce-analysis-report`` example deletes the performance analysis report with the report ID ``report-0d99cc91c4422ee61``. :: | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| aws pi delete-performance-analysis-report \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --analysis-report-id report-0d99cc91c4422ee61 \ | ||
| --region us-west-2 | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This command produces no output. | ||
|
|
||
| For more information about deleting performance analysis reports, see `Deleting a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport.html>`__ in the *Amazon RDS User Guide* and `Deleting a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport.html>`__ in the *Amazon Aurora User Guide*. | ||
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,51 @@ | ||
| **To get details for a specified dimension group for a DB instance** | ||
daniil-millwood marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| The following ``get-dimension-key-details`` example retrieves the full text of a SQL statement for DB instance ``db-10BCD2EFGHIJ3KL4M5NO6PQRS5``. The ``--group`` is ``db.sql``, and the ``--group-identifier`` is ``db.sql.id``. In this example, ``my-sql-id`` represents a SQL ID retrieved by using the ``get-resource-metrics`` or ``describe-dimension-keys`` operations. In this example, the dimensions details are available. Thus, Performance Insights retrieves the full text of the SQL statement, without truncating it. :: | ||
|
|
||
| aws pi get-dimension-key-details \ | ||
| --service-type RDS \ | ||
| --identifier db-10BCD2EFGHIJ3KL4M5NO6PQRS5 \ | ||
| --group db.sql \ | ||
| --group-identifier my-sql-id \ | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --requested-dimensions statement | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "Dimensions":[ | ||
daniil-millwood marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "Value": "SELECT e.last_name, d.department_name FROM employees e, departments d WHERE e.department_id=d.department_id", | ||
| "Dimension": "db.sql.statement", | ||
| "Status": "AVAILABLE" | ||
| }, | ||
| ... | ||
| ] | ||
| } | ||
|
|
||
| For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*. | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| **To get details for a specified dimension group for a DB instance (Windows)** | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The following ``get-dimension-key-details`` example retrieves the full text of a SQL statement for DB instance ``db-10BCD2EFGHIJ3KL4M5NO6PQRS5``. The ``--group`` is ``db.sql``, and the ``--group-identifier`` is ``db.sql.id``. In this example, ``my-sql-id`` represents a SQL ID retrieved by using the ``get-resource-metrics`` or ``describe-dimension-keys`` operations. :: | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| aws pi get-dimension-key-details ^ | ||
| --service-type RDS ^ | ||
| --identifier db-10BCD2EFGHIJ3KL4M5NO6PQRS5 ^ | ||
| --group db.sql ^ | ||
| --group-identifier my-sql-id ^ | ||
| --requested-dimensions statement | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "Dimensions":[ | ||
| { | ||
| "Value": "SELECT e.last_name, d.department_name FROM employees e, departments d WHERE e.department_id=d.department_id", | ||
| "Dimension": "db.sql.statement", | ||
| "Status": "AVAILABLE" | ||
| }, | ||
| ... | ||
| ] | ||
| } | ||
|
|
||
| For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*. | ||
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,28 @@ | ||
| **To get a performance analysis report** | ||
|
|
||
| The following ``get-perforamnce-analysis-report`` example gets the performance analysis report for the database ``db-loadtest-0`` with the report ID ``report-0d99cc91c4422ee61``. The response provides the report status, ID, time details, and insights. :: | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| aws pi get-performance-analysis-report \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
| --analysis-report-id report-0d99cc91c4422ee61 \ | ||
| --region us-west-2 | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "AnalysisReport": { | ||
| "Status": "Succeeded", | ||
| "ServiceType": "RDS", | ||
| "Identifier": "db-loadtest-0", | ||
| "StartTime": 1680583486.584, | ||
| "AnalysisReportId": "report-0d99cc91c4422ee61", | ||
| "EndTime": 1680587086.584, | ||
| "CreateTime": 1680587087.139, | ||
| "Insights": [ | ||
| ... (Condensed for space) | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| For more information about performance analysis reports, see `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon RDS User Guide* and `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon Aurora User Guide*. | ||
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,20 @@ | ||
| **To get resource metadata for a database** | ||
|
|
||
| The following ``get-resource-metadata`` example gets the resource metadata for the database ``db-loadtest-0`` with the report ID ``report-0d99cc91c4422ee61``. The response shows that SQL digest statistics are enabled. :: | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| aws pi get-resource-metadata \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "Identifier": "db-loadtest-0", | ||
| "Features":{ | ||
| "SQL_DIGEST_STATISTICS":{ | ||
| "Status": "ENABLED" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| For more information about SQL statistics for Performance Insights, see `SQL statistics for Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/sql-statistics.html>`__ in the *Amazon RDS User Guide* and `SQL statistics for Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/sql-statistics.html>`__ in the *Amazon Aurora User Guide*. | ||
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,48 @@ | ||
| **To list the dimensions that can be queried for a metric type on a DB instance** | ||
|
|
||
| The following ``list-available-resource-dimensions`` example lists the ``db.load`` metrics you can query for the database ``db-loadtest-0``. :: | ||
|
|
||
| aws pi list-available-resource-dimensions \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
| --metrics db.load | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "MetricDimensions": [ | ||
| { | ||
| "Metric": "db.load", | ||
| "Groups": [ | ||
| { | ||
| "Group": "db.user", | ||
| "Dimensions": [ | ||
| { | ||
| "Identifier": "db.user.id" | ||
| }, | ||
| { | ||
| "Identifier": "db.user.name" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "Group": "db.sql_tokenized", | ||
| "Dimensions": [ | ||
| { | ||
| "Identifier": "db.sql_tokenized.id" | ||
| }, | ||
| { | ||
| "Identifier": "db.sql_tokenized.db_id" | ||
| }, | ||
| { | ||
| "Identifier": "db.sql_tokenized.statement" | ||
| } | ||
| ] | ||
| }, | ||
| ... | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*. |
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,29 @@ | ||
| **To list the metrics that can be queried for a metric type on a DB instance** | ||
|
|
||
| The following ``list-available-resource-metrics`` example lists the ``db.load`` metrics you can query for the database ``db-loadtest-0``. :: | ||
|
|
||
| aws pi list-available-resource-metrics \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
| --metric-types "os" "db" | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "Metrics": [ | ||
| { | ||
| "Description": "The number of virtual CPUs for the DB instance", | ||
| "Metric": "os.general.numVCPUs", | ||
| "Unit": "vCPUs" | ||
| }, | ||
| ......, | ||
| { | ||
| "Description": "Time spent reading data file blocks by backends in this instance", | ||
| "Metric": "db.IO.read_latency", | ||
| "Unit": "Milliseconds per block" | ||
| }, | ||
| ...... | ||
| ] | ||
| } | ||
|
|
||
| For more information about metrics in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*. |
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,45 @@ | ||
| **To list performance analysis reports for a database** | ||
|
|
||
| The following ``list-performance-analysis-reports`` example lists performance analysis reports for the database ``db-loadtest-0``. The response lists all the reports with the report ID, status, and time period details. :: | ||
|
|
||
| aws pi list-performance-analysis-reports \ | ||
| --service-type RDS \ | ||
| --identifier db-loadtest-0 \ | ||
| --region us-west-2 | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "AnalysisReports": [ | ||
| { | ||
| "Status": "Succeeded", | ||
| "EndTime": 1680587086.584, | ||
| "CreationTime": 1680587087.139, | ||
daniil-millwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "StartTime": 1680583486.584, | ||
| "AnalysisReportId": "report-0d99cc91c4422ee61" | ||
| }, | ||
| { | ||
| "Status": "Succeeded", | ||
| "EndTime": 1681491137.914, | ||
| "CreationTime": 1681491145.973, | ||
| "StartTime": 1681487537.914, | ||
| "AnalysisReportId": "report-002633115cc002233" | ||
| }, | ||
| { | ||
| "Status": "Succeeded", | ||
| "EndTime": 1681493499.849, | ||
| "CreationTime": 1681493507.762, | ||
| "StartTime": 1681489899.849, | ||
| "AnalysisReportId": "report-043b1e006b47246f9" | ||
| }, | ||
| { | ||
| "Status": "InProgress", | ||
| "EndTime": 1682979503.0, | ||
| "CreationTime": 1682979618.994, | ||
| "StartTime": 1682969503.0, | ||
| "AnalysisReportId": "report-01ad15f9b88bcbd56" | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| For more information about performance analysis reports, see `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon RDS User Guide* and `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon Aurora User Guide*. | ||
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,21 @@ | ||
| **To list tags for a performance analysis report** | ||
|
|
||
| The following ``list-tags-for-resource`` example lists tags for a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. :: | ||
|
|
||
| aws pi list-tags-for-resource \ | ||
| --service-type RDS \ | ||
| --resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-loadtest-0/report-0d99cc91c4422ee61 \ | ||
| --region us-west-2 | ||
|
|
||
| Output:: | ||
|
|
||
| { | ||
| "Tags": [ | ||
| { | ||
| "Value": "test-tag", | ||
| "Key": "name" | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*. |
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,13 @@ | ||
| **To add a tag to a performance analysis report** | ||
|
|
||
| The following ``tag-resource`` example adds the tag key ``name`` with the tag value ``test-tag`` to a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. :: | ||
|
|
||
| aws pi tag-resource \ | ||
| --service-type RDS \ | ||
| --resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-loadtest-0/report-0d99cc91c4422ee61 \ | ||
| --tags Key=name,Value=test-tag \ | ||
| --region us-west-2 | ||
|
|
||
| This command produces no output. | ||
|
|
||
| For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*. |
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,13 @@ | ||
| **To delete a tag for a performance analysis report** | ||
|
|
||
| The following ``untag-resource`` example deletes the tag ``name`` for a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. :: | ||
|
|
||
| aws pi untag-resource \ | ||
| --service-type RDS \ | ||
| --resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-loadtest-0/report-0d99cc91c4422ee61 \ | ||
| --tag-keys name \ | ||
| --region us-west-2 | ||
|
|
||
| This command produces no output. | ||
|
|
||
| For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*. |
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.
Uh oh!
There was an error while loading. Please reload this page.