-
Notifications
You must be signed in to change notification settings - Fork 104
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
Bug with query for steampipe aws Cloudwatch metrics #2300
Comments
this is the screenshot attached.output for steampipe query for cpuusage for custom namesapce metrics is not giving expected results |
Hello @jijopjoy80, I reviewed the issue you mentioned, and the error shown in the screenshot is expected. It occurs because the columns in your SELECT statement are not part of the table schema for Here are the available columns in the > .inspect aws_cloudwatch_metric_data_point
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| column | type | description |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _ctx | jsonb | Steampipe context in JSON form. |
| account_id | text | The AWS Account ID in which the resource is located. |
| expression | text | This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. |
| id | text | The short name you specified to represent this metric. |
| label | text | The human-readable label associated with the data. |
| metric_stat | jsonb | The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data. |
| partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). |
| period | bigint | The granularity, in seconds, of the returned data points. |
| region | text | The AWS Region in which the resource is located. |
| scan_by | text | The order in which data points should be returned. TimestampDescending returns the newest data first and paginates when the MaxDatapoints limit is reached. TimestampAscending returns the oldest data first and paginates when the MaxDatapoints limit is reached. |
| source_account_id | text | The ID of the account where the metrics are located. |
| sp_connection_name | text | Steampipe connection name. |
| sp_ctx | jsonb | Steampipe context in JSON form. |
| status_code | text | The status of the returned data. Complete indicates that all data points in the requested time range were returned. PartialData means that an incomplete set of data points were returned. |
| timestamp | timestamp with time zone | The timestamp for the data points, formatted in Unix timestamp format. |
| timezone | text | You can use timezone to specify your time zone so that the labels of returned data display the correct time for your time zone. |
| title | text | Title of the resource. |
| value | double precision | The data point for the metric corresponding to Timestamp. |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Have you had a chance to review the table documentation for Let me know if I misunderstood the issue or if you need further clarification. Thanks! |
Hello @jijopjoy80, Did you get a chance to take a look at the above comment? |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Describe the bug
AWS CW metrics query is returning proper result(it shows error) for against a custom namespace for cpu_usae,mem_usage and disk_usage
Steampipe version (
steampipe -v
)Steampipe v0.23.3
To reproduce
Query no:1 steampipe query "SELECT
timestamp,
value as cpu_usage
FROM
aws_cloudwatch_metric_data_point
WHERE
metric_name = 'system.cpu.usage.value'
AND period = 60 -- aggregation period in seconds
AND timestamp > now() - interval '5 minutes' -- last 5 minutes of data
ORDER BY
timestamp DESC;
"Query no:2 teampipe query " SELECT
metric_name,
metric_id,
namespace,
dimensions
FROM
aws_cloudwatch_metric
WHERE
namespace = 'MyAppli*****/Me******';"
Expected behavior
It should give the cpu_usage from Custom metrics at aws cloud watch for metric_name = 'system.cpu.usage.value' from table aws_cloudwatch_metric_data_point
Additional context
Actually aws_cloudwatch_metric_data_point table is empty.
The text was updated successfully, but these errors were encountered: