Skip to content
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

Fix column autoscale_settings_max_throughput in table azure_cosmosdb_sql_database #772

Open
khushboo9024 opened this issue Jun 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@khushboo9024
Copy link
Contributor

Describe the bug
The column autoscale_settings_max_throughput in the table azure_cosmosdb_sql_database is coming up as null even though we have data.

Steampipe version (steampipe -v)
Example: v0.3.0

Plugin version (steampipe plugin list)
Example: v0.5.0

To reproduce
Steps to reproduce the behavior (please include relevant code and/or commands).

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@khushboo9024 khushboo9024 added the bug Something isn't working label Jun 11, 2024
@ParthaI
Copy link
Contributor

ParthaI commented Jun 12, 2024

Hi @khushboo9024, As per my findings the APIs(List/Get) have a property named MaxThroughput under SQLDatabaseGetProperties. However, the API is returning null value for this property all the time.

  • Also, the azure CLI command(az cosmosdb sql database list --resource-group test7 --account-name test4446666/ az cosmosdb sql database show --resource-group test7 --account-name test4446666 --name test5353) is also not returning any result for autoscaling settings.
  • As per my understanding, we can set the autoscaling settings on the container level.
  • It would be better if we add support for the table azure_cosmosdb_sql_container

Thanks!

@ParthaI
Copy link
Contributor

ParthaI commented Jun 13, 2024

@khushboo9024, I have pushed a rough code into the issue-772 branch that adds a new table called azure_cosmosdb_sql_container. With this, I am able to retrieve the throughput details for the containers.

> select name,account_name, database_name, jsonb_pretty(throughput_settings)  from azure_cosmosdb_sql_container
+--------+--------------+---------------+---------------------------+
| name   | account_name | database_name | jsonb_pretty              |
+--------+--------------+---------------+---------------------------+
| test53 | test93       | test63        | <null>                    |
| Items  | tes-acc33    | ToDoList      | {                         |
|        |              |               |     "Resource": {         |
|        |              |               |         "throughput": 400 |
|        |              |               |     }                     |
|        |              |               | }                         |
+--------+--------------+---------------+---------------------------+

Time: 5.4s. Rows returned: 2. Rows fetched: 2. Hydrate calls: 2.

Please give it a go in the PR branch and let me know if that helps. I will do some cleanup in the branch and raise the PR then.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants