-
Notifications
You must be signed in to change notification settings - Fork 361
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
CosmosDB: Add throughput configuration #6693
Conversation
♻️ PR Preview b25e45f has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
docs/reference/configuration.md
Outdated
@@ -65,6 +65,8 @@ This reference uses `.` to denote the nesting of values. | |||
+ `database.cosmosdb.endpoint` `(string : "")` - CosmosDB account endpoint, e.g. `https://<account>.documents.azure.com/`. | |||
+ `database.cosmosdb.database` `(string : "")` - CosmosDB database name. | |||
+ `database.cosmosdb.container` `(string : "")` - CosmosDB container name. | |||
+ `database.cosmosdb.throughput` `(uint : 400)` - The container's RU/s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- how do we control if we lick to configure throughput?
- prefer to let the user configure the value if choose to use cosmos
- can we keep the type to int - I assume that invalid values will fail to configure the feature
- include "CosmosDB..." as part of the parameter description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Throughput is always configured whether autoscaling or manual mode
- This is anyway the default for cosmosDB if no configuration provided - using the default in our configuration makes this fact accessible to the user
- Done
- Going the other way and removing CosmosDB from all parameter description (redundant + aligning with DyanmoDB description)
pkg/config/config.go
Outdated
Endpoint string `mapstructure:"endpoint"` | ||
Database string `mapstructure:"database"` | ||
Container string `mapstructure:"container"` | ||
Throughput *int32 `mapstructure:"throughput"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use int
without setting any default we can assume 0 as non value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (minor comment)
pkg/kv/cosmosdb/store.go
Outdated
var opts *azcosmos.CreateContainerOptions | ||
if params.Throughput > 0 { | ||
var throughputProperties azcosmos.ThroughputProperties | ||
tp := params.Throughput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline
Closes #6692
Change Description
Background
Add configuration to control CosmosDB container throughput RU/s and autoscaling mode
Testing Details
Tested manually
Breaking Change?
No