Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener#806
Merged
Target Based Scaling for CosmosDB + Separate out CosmosDBScaleMonitor from Listener#806
Conversation
ealsur
reviewed
Nov 2, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
alrod
reviewed
Nov 8, 2022
Co-authored-by: Alexey Rodionov <alrod@inbox.ru>
7 tasks
ealsur
approved these changes
Jan 31, 2023
ealsur
approved these changes
Feb 2, 2023
Member
Author
|
@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
This was referenced Sep 9, 2025
This file contains hidden or 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
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
CosmosDBTriggerListenerinto two components,CosmosDBScaleMonitor, andCosmosDBMetricsProvider, and introduces new class called theCosmosDBTargetScalerto support target based scaling. The refactor separates CosmosDBScaleMonitor for the redesigned scale controller, which calls intoCosmosDBScaleMonitormethods for scaling decisions. This is an effort to unify scaling logic between the scale controller and extensions SDKs, which have diverged over time. TheCosmosDBMetricsProvideris shared by theCosmosDBScaleMonitorandCosmosDBTargetScalerclasses, 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_ThrowsWhenPathDoesNotExistunit 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-hostrepoScmHostingConfigurations.txtto enable CosmosDB TBSadmin/host/scale/statusAPI using Postman, observe target worker count and localazure-functions-hostlogs emittedScreenshot showing the target scaler requesting a worker count of 2, capped by the partition count which is 1 in this case
