- 最新
- 最多得票
- 最多評論
Hi again,
From the request I didn't find any issue in the formatting or syntax based off of the boto3 documentation.
From the error you had indicated:
This metric is not a known metric: db.sql_tokenized.stats.calls_per_sec.avg
The boto3 message suggests that this is not a valid metric. I can confirm that the metric is supported for DescribeDimensionKeys on the AWS API though I am unsure on boto3 as I do not have an environment with it.
I would recommend confirming if this metric is available on boto3 via their list_available_resource_metrics request. Linking again for ease of access: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pi/client/list_available_resource_metrics.html
Hi Faustin,
Thanks for the help, but I was in doubt, if the metric is available via the AWS API and boto3 may not recognize the metric, through which python lib could I access this API information? Could you guide me?
Hello rgouvea,
As mentioned by AWS-leevon, since code debugging is outside the scope of support, this is done on a best effort basis.
With that being said, if you could share the boto3 API request that this error originated from it would assist in narrowing the cause.
Additionally to ensure this metric is supported on boto3, you can use the following request for retrieving the possible metrics for Performance Insights: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pi/client/list_available_resource_metrics.html
Of course, below is the code I'm using, but it's actually a reproduction of the code from the documentation itself mentioned above, in the message.
`from datetime import datetime import boto3
source_profile_name = 'da-prod' sourceRegion = 'us-east-1'
sSession = boto3.Session( profile_name=source_profile_name, region_name=sourceRegion )
client = sSession.client('pi')
response = client.describe_dimension_keys( ServiceType='RDS', Identifier='xx-XXXXXXXXXXXXXXXXXXXXXXXXX', StartTime=datetime(2023, 8, 2), EndTime=datetime(2023, 8, 2), Metric='db.load.avg', PeriodInSeconds=300, GroupBy={ 'Group': 'db.sql_tokenized', 'Dimensions': [ 'db.sql_tokenized.id', 'db.sql_tokenized.statement' ], 'Limit': 5 }, AdditionalMetrics=[ 'db.sql_tokenized.stats.calls_per_sec.avg', 'db.sql_tokenized.stats.rows_per_sec.avg' ], PartitionBy={ 'Group': 'db.user', 'Dimensions': [ 'db.user.id', 'db.user.name' ], 'Limit': 5 }, MaxResults=10 ) `
Can you share the code triggering the error. A gentle note, code debugging is outside the scope of support. hence this is best effort basis.