-
Notifications
You must be signed in to change notification settings - Fork 204
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
Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener #806
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ealsur
reviewed
Nov 2, 2022
src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBTriggerMetrics.cs
Outdated
Show resolved
Hide resolved
chiangvincent
changed the title
Introduce Target Based Scaling and Refactor CosmosDBTriggerListener for Scale Controller Redesign
Introduce Target Based Scaling in CosmosDB Trigger Listener
Nov 7, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBTargetScaler.cs
Outdated
Show resolved
Hide resolved
alrod
reviewed
Nov 8, 2022
src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBTargetScaler.cs
Outdated
Show resolved
Hide resolved
alrod
reviewed
Nov 8, 2022
test/WebJobs.Extensions.CosmosDB.Tests/Trigger/CosmosDBListenerTests.cs
Outdated
Show resolved
Hide resolved
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
chiangvincent
changed the title
Introduce Target Based Scaling in CosmosDB Trigger Listener
Introduce Target Based Scaling for CosmosDB
Nov 17, 2022
Co-authored-by: Alexey Rodionov <alrod@inbox.ru>
chiangvincent
changed the title
Introduce Target Based Scaling for CosmosDB
Introduce Target Based Scaling for CosmosDB + Make ScaleMonitor and TargetScaler public for use Redesigned Scale Controller
Jan 13, 2023
chiangvincent
changed the title
Introduce Target Based Scaling for CosmosDB + Make ScaleMonitor and TargetScaler public for use Redesigned Scale Controller
Introduce Target Based Scaling for CosmosDB + Make ScaleMonitor and TargetScaler public for use in Redesigned Scale Controller
Jan 13, 2023
chiangvincent
changed the title
Introduce Target Based Scaling for CosmosDB + Make ScaleMonitor and TargetScaler public for use in Redesigned Scale Controller
Introduce Target Based Scaling for CosmosDB
Jan 18, 2023
chiangvincent
changed the title
Introduce Target Based Scaling for CosmosDB
Introduce Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener
Jan 18, 2023
7 tasks
chiangvincent
changed the title
Introduce Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener
Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener
Jan 30, 2023
ealsur
approved these changes
Jan 31, 2023
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.
Looks good on the trigger changes
src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBMetricsProvider.cs
Outdated
Show resolved
Hide resolved
ealsur
approved these changes
Feb 2, 2023
@ealsur are the scale monitors used for Cosmos V3 the same ones here? If not, can you send a pointer to the existing listener + scale monitor we will have to cherry-pick to? |
brettsam
approved these changes
Feb 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR refactors the
CosmosDBTriggerListener
into two components,CosmosDBScaleMonitor
, andCosmosDBMetricsProvider
, and introduces new class called theCosmosDBTargetScaler
to support target based scaling. The refactor separates CosmosDBScaleMonitor for the redesigned scale controller, which calls intoCosmosDBScaleMonitor
methods for scaling decisions. This is an effort to unify scaling logic between the scale controller and extensions SDKs, which have diverged over time. TheCosmosDBMetricsProvider
is shared by theCosmosDBScaleMonitor
andCosmosDBTargetScaler
classes, which use the provider class to retrieve metrics from the monitored container.Here is a sample PR for the Service Bus SDK for reference.
Note: this PR includes a fix for the
StatusFilePath_ThrowsWhenPathDoesNotExist
unit test for timer triggers after upgrading the test csproj to netcore3.1:To address the following changes in Exception logging, see:
TODO
Logs from E2E Verification With Local Function App
azure-functions-host
repoScmHostingConfigurations.txt
to enable CosmosDB TBSadmin/host/scale/status
API using Postman, observe target worker count and localazure-functions-host
logs emittedScreenshot showing the target scaler requesting a worker count of 2, capped by the partition count which is 1 in this case