2025/05/22 - Amazon Prometheus Service - 4 new api methods
Changes Add QueryLoggingConfiguration APIs for Amazon Managed Prometheus
Deletes the query logging configuration for the specified workspace.
See also: AWS API Documentation
Request Syntax
client.delete_query_logging_configuration(
    clientToken='string',
    workspaceId='string'
)
string
(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
string
[REQUIRED]
The ID of the workspace from which to delete the query logging configuration.
None
Retrieves the details of the query logging configuration for the specified workspace.
See also: AWS API Documentation
Request Syntax
client.describe_query_logging_configuration(
    workspaceId='string'
)
string
[REQUIRED]
The ID of the workspace for which to retrieve the query logging configuration.
dict
Response Syntax
{
    'queryLoggingConfiguration': {
        'createdAt': datetime(2015, 1, 1),
        'destinations': [
            {
                'cloudWatchLogs': {
                    'logGroupArn': 'string'
                },
                'filters': {
                    'qspThreshold': 123
                }
            },
        ],
        'modifiedAt': datetime(2015, 1, 1),
        'status': {
            'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
            'statusReason': 'string'
        },
        'workspace': 'string'
    }
}
Response Structure
(dict) --
queryLoggingConfiguration (dict) --
The detailed information about the query logging configuration for the specified workspace.
createdAt (datetime) --
The date and time when the query logging configuration was created.
destinations (list) --
The configured destinations for the query logging configuration.
(dict) --
Defines a destination and its associated filtering criteria for query logging.
cloudWatchLogs (dict) --
Configuration details for logging to CloudWatch Logs.
logGroupArn (string) --
The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist prior to calling this operation.
filters (dict) --
Filtering criteria that determine which queries are logged.
qspThreshold (integer) --
The Query Samples Processed (QSP) threshold above which queries will be logged. Queries processing more samples than this threshold will be captured in logs.
modifiedAt (datetime) --
The date and time when the query logging configuration was last modified.
status (dict) --
The current status of the query logging configuration.
statusCode (string) --
The current status of the query logging configuration.
statusReason (string) --
If there is a failure, the reason for the failure.
workspace (string) --
The ID of the workspace associated with this query logging configuration.
Creates a query logging configuration for the specified workspace. This operation enables logging of queries that exceed the specified QSP threshold.
See also: AWS API Documentation
Request Syntax
client.create_query_logging_configuration(
    clientToken='string',
    destinations=[
        {
            'cloudWatchLogs': {
                'logGroupArn': 'string'
            },
            'filters': {
                'qspThreshold': 123
            }
        },
    ],
    workspaceId='string'
)
string
(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
list
[REQUIRED]
The destinations where query logs will be sent. Only CloudWatch Logs destination is supported. The list must contain exactly one element.
(dict) --
Defines a destination and its associated filtering criteria for query logging.
cloudWatchLogs (dict) -- [REQUIRED]
Configuration details for logging to CloudWatch Logs.
logGroupArn (string) -- [REQUIRED]
The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist prior to calling this operation.
filters (dict) -- [REQUIRED]
Filtering criteria that determine which queries are logged.
qspThreshold (integer) -- [REQUIRED]
The Query Samples Processed (QSP) threshold above which queries will be logged. Queries processing more samples than this threshold will be captured in logs.
string
[REQUIRED]
The ID of the workspace for which to create the query logging configuration.
dict
Response Syntax
{
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    }
}
Response Structure
(dict) --
status (dict) --
The current status of the query logging configuration.
statusCode (string) --
The current status of the query logging configuration.
statusReason (string) --
If there is a failure, the reason for the failure.
Updates the query logging configuration for the specified workspace.
See also: AWS API Documentation
Request Syntax
client.update_query_logging_configuration(
    clientToken='string',
    destinations=[
        {
            'cloudWatchLogs': {
                'logGroupArn': 'string'
            },
            'filters': {
                'qspThreshold': 123
            }
        },
    ],
    workspaceId='string'
)
string
(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
list
[REQUIRED]
The destinations where query logs will be sent. Only CloudWatch Logs destination is supported. The list must contain exactly one element.
(dict) --
Defines a destination and its associated filtering criteria for query logging.
cloudWatchLogs (dict) -- [REQUIRED]
Configuration details for logging to CloudWatch Logs.
logGroupArn (string) -- [REQUIRED]
The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist prior to calling this operation.
filters (dict) -- [REQUIRED]
Filtering criteria that determine which queries are logged.
qspThreshold (integer) -- [REQUIRED]
The Query Samples Processed (QSP) threshold above which queries will be logged. Queries processing more samples than this threshold will be captured in logs.
string
[REQUIRED]
The ID of the workspace for which to update the query logging configuration.
dict
Response Syntax
{
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    }
}
Response Structure
(dict) --
status (dict) --
The current status of the query logging configuration.
statusCode (string) --
The current status of the query logging configuration.
statusReason (string) --
If there is a failure, the reason for the failure.