Closed lyrecoSquared closed 3 months ago
Search prior issues/thread as I recall a similar discussion. The issue is about [url parameter] encoding, I think in this case the quotes around 200 are tripping it - try to url encode them and step through if that get send correctly On Mar 19, 2024, at 10:45 AM, lyrecoSquared @.***> wrote: I am trying to query an Amazon Managed Service for Prometheus endpoint to extract some metrics data via a python script using the make_request method in the following way (cleary this is an example snippet): import awscurl.awscurl as aws
uri = 'https://
headers = {
'Content-Type': 'application/json',
}
awscurl_auth_params = {
'method': 'GET',
'service':
In this way, I am able to successfully connect to the endpoint and download the data related to the query query=http_request_total&start=1710720000.0&end=1710806400.0&step=1h. However, as soon as I try to add a filter (as statuscode="200") in the query (e.g. query=http_request_total{statuscode="200"}&start=1710720000.0&end=1710806400.0&step=1h), the same script as above, returns a tedious 400 status code and an annoying 'x-amzn-errortype': 'InvalidQueryStringException' error. What am I doing wrong? Thanks in advance.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
I tried to encode the quotes, replacing them with %22
but it still gives me the error.
Thanks anyway, I will surely check for some info in prior issues.
For the sake of completeness: https://github.com/okigan/awscurl/issues/169#issuecomment-1664622134 worked for me.
I am trying to query an Amazon Managed Service for Prometheus endpoint to extract some metrics data via a python script using the
make_request
method in the following way (cleary this is an example snippet):In this way, I am able to successfully connect to the endpoint and download the data related to the query
query=http_request_total&start=1710720000.0&end=1710806400.0&step=1h
.However, as soon as I try to add a filter (as
statuscode="200"
) in the query (e.g.query=http_request_total{statuscode="200"}&start=1710720000.0&end=1710806400.0&step=1h
), the same script as above, returns a tedious 400 status code and an annoying'x-amzn-errortype': 'InvalidQueryStringException'
error.What am I doing wrong?
Thanks in advance.