AWS Performance Insights

2023/08/15 - AWS Performance Insights - 7 new api methods

Changes  AWS Performance Insights for Amazon RDS is launching Performance Analysis On Demand, a new feature that allows you to analyze database performance metrics and find out the performance issues. You can now use SDK to create, list, get, delete, and manage tags of performance analysis reports.

ListTagsForResource (new) Link ¶

Retrieves all the metadata tags associated with Amazon RDS Performance Insights resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ServiceType='RDS'|'DOCDB',
    ResourceARN='string'
)
type ServiceType

string

param ServiceType

[REQUIRED]

List the tags for the Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS .

type ResourceARN

string

param ResourceARN

[REQUIRED]

Lists all the tags for the Amazon RDS Performance Insights resource. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

rtype

dict

returns

Response Syntax

{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Tags (list) --

      The metadata assigned to an Amazon RDS resource consisting of a key-value pair.

      • (dict) --

        Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

        • Key (string) --

          A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" ).

        • Value (string) --

          A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").

ListPerformanceAnalysisReports (new) Link ¶

Lists all the analysis reports created for the DB instance. The reports are sorted based on the start time of each report.

See also: AWS API Documentation

Request Syntax

client.list_performance_analysis_reports(
    ServiceType='RDS'|'DOCDB',
    Identifier='string',
    NextToken='string',
    MaxResults=123,
    ListTags=True|False
)
type ServiceType

string

param ServiceType

[REQUIRED]

The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS .

type Identifier

string

param Identifier

[REQUIRED]

An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID . When you call DescribeDBInstances , the identifier is returned as DbiResourceId .

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X .

type NextToken

string

param NextToken

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxResults .

type MaxResults

integer

param MaxResults

The maximum number of items to return in the response. If more items exist than the specified MaxResults value, a pagination token is included in the response so that the remaining results can be retrieved.

type ListTags

boolean

param ListTags

Specifies whether or not to include the list of tags in the response.

rtype

dict

returns

Response Syntax

{
    'AnalysisReports': [
        {
            'AnalysisReportId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'StartTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'Status': 'RUNNING'|'SUCCEEDED'|'FAILED',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AnalysisReports (list) --

      List of reports including the report identifier, start and end time, creation time, and status.

      • (dict) --

        Retrieves the details of the performance analysis report.

        • AnalysisReportId (string) --

          The name of the analysis report.

        • CreateTime (datetime) --

          The time you created the analysis report.

        • StartTime (datetime) --

          The start time of the analysis in the report.

        • EndTime (datetime) --

          The end time of the analysis in the report.

        • Status (string) --

          The status of the analysis report.

        • Tags (list) --

          List of all the tags added to the analysis report.

          • (dict) --

            Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

            • Key (string) --

              A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" ).

            • Value (string) --

              A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").

    • NextToken (string) --

      An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxResults .

TagResource (new) Link ¶

Adds metadata tags to the Amazon RDS Performance Insights resource.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ServiceType='RDS'|'DOCDB',
    ResourceARN='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ServiceType

string

param ServiceType

[REQUIRED]

The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS .

type ResourceARN

string

param ResourceARN

[REQUIRED]

The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

type Tags

list

param Tags

[REQUIRED]

The metadata assigned to an Amazon RDS resource consisting of a key-value pair.

  • (dict) --

    Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

    • Key (string) -- [REQUIRED]

      A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" ).

    • Value (string) -- [REQUIRED]

      A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DeletePerformanceAnalysisReport (new) Link ¶

Deletes a performance analysis report.

See also: AWS API Documentation

Request Syntax

client.delete_performance_analysis_report(
    ServiceType='RDS'|'DOCDB',
    Identifier='string',
    AnalysisReportId='string'
)
type ServiceType

string

param ServiceType

[REQUIRED]

The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS .

type Identifier

string

param Identifier

[REQUIRED]

An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID . When you call DescribeDBInstances , the identifier is returned as DbiResourceId .

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X .

type AnalysisReportId

string

param AnalysisReportId

[REQUIRED]

The unique identifier of the analysis report for deletion.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreatePerformanceAnalysisReport (new) Link ¶

Creates a new performance analysis report for a specific time period for the DB instance.

See also: AWS API Documentation

Request Syntax

client.create_performance_analysis_report(
    ServiceType='RDS'|'DOCDB',
    Identifier='string',
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ServiceType

string

param ServiceType

[REQUIRED]

The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS .

type Identifier

string

param Identifier

[REQUIRED]

An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.

To use an Amazon RDS instance as a data source, you specify its DbiResourceId value. For example, specify db-ADECBTYHKTSAUMUZQYPDS2GW4A .

type StartTime

datetime

param StartTime

[REQUIRED]

The start time defined for the analysis report.

type EndTime

datetime

param EndTime

[REQUIRED]

The end time defined for the analysis report.

type Tags

list

param Tags

The metadata assigned to the analysis report consisting of a key-value pair.

  • (dict) --

    Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

    • Key (string) -- [REQUIRED]

      A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" ).

    • Value (string) -- [REQUIRED]

      A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with aws: or rds: . The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").

rtype

dict

returns

Response Syntax

{
    'AnalysisReportId': 'string'
}

Response Structure

  • (dict) --

    • AnalysisReportId (string) --

      A unique identifier for the created analysis report.

UntagResource (new) Link ¶

Deletes the metadata tags from the Amazon RDS Performance Insights resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ServiceType='RDS'|'DOCDB',
    ResourceARN='string',
    TagKeys=[
        'string',
    ]
)
type ServiceType

string

param ServiceType

[REQUIRED]

List the tags for the Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS .

type ResourceARN

string

param ResourceARN

[REQUIRED]

The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

type TagKeys

list

param TagKeys

[REQUIRED]

The metadata assigned to an Amazon RDS Performance Insights resource consisting of a key-value pair.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetPerformanceAnalysisReport (new) Link ¶

Retrieves the report including the report ID, status, time details, and the insights with recommendations. The report status can be RUNNING , SUCCEEDED , or FAILED . The insights include the description and recommendation fields.

See also: AWS API Documentation

Request Syntax

client.get_performance_analysis_report(
    ServiceType='RDS'|'DOCDB',
    Identifier='string',
    AnalysisReportId='string',
    TextFormat='PLAIN_TEXT'|'MARKDOWN',
    AcceptLanguage='EN_US'
)
type ServiceType

string

param ServiceType

[REQUIRED]

The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS .

type Identifier

string

param Identifier

[REQUIRED]

An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID . When you call DescribeDBInstances , the identifier is returned as DbiResourceId .

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X .

type AnalysisReportId

string

param AnalysisReportId

[REQUIRED]

A unique identifier of the created analysis report. For example, report-12345678901234567

type TextFormat

string

param TextFormat

Indicates the text format in the report. The options are PLAIN_TEXT or MARKDOWN . The default value is plain text .

type AcceptLanguage

string

param AcceptLanguage

The text language in the report. The default language is EN_US (English).

rtype

dict

returns

Response Syntax

{
    'AnalysisReport': {
        'AnalysisReportId': 'string',
        'Identifier': 'string',
        'ServiceType': 'RDS'|'DOCDB',
        'CreateTime': datetime(2015, 1, 1),
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'Status': 'RUNNING'|'SUCCEEDED'|'FAILED',
        'Insights': [
            {
                'InsightId': 'string',
                'InsightType': 'string',
                'Context': 'CAUSAL'|'CONTEXTUAL',
                'StartTime': datetime(2015, 1, 1),
                'EndTime': datetime(2015, 1, 1),
                'Severity': 'LOW'|'MEDIUM'|'HIGH',
                'SupportingInsights': {'... recursive ...'},
                'Description': 'string',
                'Recommendations': [
                    {
                        'RecommendationId': 'string',
                        'RecommendationDescription': 'string'
                    },
                ],
                'InsightData': [
                    {
                        'PerformanceInsightsMetric': {
                            'Metric': 'string',
                            'DisplayName': 'string',
                            'Dimensions': {
                                'string': 'string'
                            },
                            'Value': 123.0
                        }
                    },
                ],
                'BaselineData': [
                    {
                        'PerformanceInsightsMetric': {
                            'Metric': 'string',
                            'DisplayName': 'string',
                            'Dimensions': {
                                'string': 'string'
                            },
                            'Value': 123.0
                        }
                    },
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    • AnalysisReport (dict) --

      The summary of the performance analysis report created for a time period.

      • AnalysisReportId (string) --

        The name of the analysis report.

      • Identifier (string) --

        The unique identifier of the analysis report.

      • ServiceType (string) --

        List the tags for the Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:

        • RDS

        • DOCDB

      • CreateTime (datetime) --

        The time you created the analysis report.

      • StartTime (datetime) --

        The analysis start time in the report.

      • EndTime (datetime) --

        The analysis end time in the report.

      • Status (string) --

        The status of the created analysis report.

      • Insights (list) --

        The list of identified insights in the analysis report.

        • (dict) --

          Retrieves the list of performance issues which are identified.

          • InsightId (string) --

            The unique identifier for the insight. For example, insight-12345678901234567 .

          • InsightType (string) --

            The type of insight. For example, HighDBLoad , HighCPU , or DominatingSQLs .

          • Context (string) --

            Indicates if the insight is causal or correlated insight.

          • StartTime (datetime) --

            The start time of the insight. For example, 2018-10-30T00:00:00Z .

          • EndTime (datetime) --

            The end time of the insight. For example, 2018-10-30T00:00:00Z .

          • Severity (string) --

            The severity of the insight. The values are: Low , Medium , or High .

          • SupportingInsights (list) --

            List of supporting insights that provide additional factors for the insight.

          • Description (string) --

            Description of the insight. For example: A high severity Insight found between 02:00 to 02:30, where there was an unusually high DB load 600x above baseline. Likely performance impact .

          • Recommendations (list) --

            List of recommendations for the insight. For example, Investigate the following SQLs that contributed to 100% of the total DBLoad during that time period: sql-id .

            • (dict) --

              The list of recommendations for the insight.

              • RecommendationId (string) --

                The unique identifier for the recommendation.

              • RecommendationDescription (string) --

                The recommendation details to help resolve the performance issue. For example, Investigate the following SQLs that contributed to 100% of the total DBLoad during that time period: sql-id

          • InsightData (list) --

            List of data objects containing metrics and references from the time range while generating the insight.

            • (dict) --

              List of data objects which provide details about source metrics. This field can be used to determine the PI metric to render for the insight. This data type also includes static values for the metrics for the Insight that were calculated and included in text and annotations on the DB load chart.

              • PerformanceInsightsMetric (dict) --

                This field determines the Performance Insights metric to render for the insight. The name field refers to a Performance Insights metric.

                • Metric (string) --

                  The Performance Insights metric.

                • DisplayName (string) --

                  The Performance Insights metric name.

                • Dimensions (dict) --

                  A dimension map that contains the dimensions for this partition.

                  • (string) --

                    • (string) --

                • Value (float) --

                  The value of the metric. For example, 9 for db.load.avg .

          • BaselineData (list) --

            Metric names and values from the timeframe used as baseline to generate the insight.

            • (dict) --

              List of data objects which provide details about source metrics. This field can be used to determine the PI metric to render for the insight. This data type also includes static values for the metrics for the Insight that were calculated and included in text and annotations on the DB load chart.

              • PerformanceInsightsMetric (dict) --

                This field determines the Performance Insights metric to render for the insight. The name field refers to a Performance Insights metric.

                • Metric (string) --

                  The Performance Insights metric.

                • DisplayName (string) --

                  The Performance Insights metric name.

                • Dimensions (dict) --

                  A dimension map that contains the dimensions for this partition.

                  • (string) --

                    • (string) --

                • Value (float) --

                  The value of the metric. For example, 9 for db.load.avg .