[Storage] Replacing scaling logs to WebJobs extension methods#53923
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR replaces direct logging calls with WebJobs extension methods for scaling-related logs in the Azure Storage Extensions. The changes introduce LogFunctionScaleVote and LogFunctionScaleError extension methods to provide standardized logging for function scaling events.
Key changes:
- Migrated from
_logger.LogInformationto_logger.LogFunctionScaleVotein QueueTargetScaler for scale vote logging - Replaced
_logger.LogWarningwith_logger.LogFunctionScaleErrorin QueueMetricsProvider for error logging - Updated Microsoft.Azure.WebJobs package references from version 3.0.41 to 3.0.42-dev to access the new extension methods
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/src/Shared/Queues/QueueTargetScaler.cs | Replaced LogInformation with LogFunctionScaleVote extension method for scale decision logging |
| sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/src/Shared/Queues/QueueMetricsProvider.cs | Replaced LogWarning with LogFunctionScaleError extension method for error logging and added Microsoft.Azure.WebJobs.Host.Scale namespace import |
| eng/Packages.Data.props | Updated Microsoft.Azure.WebJobs package versions to 3.0.42-dev to support the new logging extension methods |
| NuGet.Config | Added local package source for development/testing purposes |
8f5e15d to
2a2c7c3
Compare
|
Once version 3.0.42 goes out for Microsoft.Azure.WebJobs and Microsoft.Azure.WebJobs.Sources, you will update this PR to use that version? (and also remove the reference to ) otherwise LGTM at this time |
2a2c7c3 to
ed18484
Compare
|
Hi @alrod. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Hi @alrod. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing |
|
/reopen |
ed18484 to
be103fe
Compare
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
be103fe to
cef94ec
Compare
cef94ec to
5ced443
Compare
5ced443 to
38d37af
Compare
38d37af to
0ee5c00
Compare
0ee5c00 to
c9b1aaf
Compare
Summary
Replace direct
LogWarningcalls in the Storage Queue scaling extensions with standardizedLogFunctionScaleWarningWebJobs extension method.This enables the Scale Controller's OpenTelemetry logger to intercept scaling warning/error events (EventIds 8001/8003) and forward them to the customer's Application Insights, providing visibility into connectivity errors during scaling.
Changes
functionIdconstructor parameter; replacedLogWarningwithLogFunctionScaleWarningfor error loggingfunctionIdtoQueueMetricsProviderQueueMetricsProviderconstructor call to passfunctionIdfunctionIdparameterWhy no Blob trigger changes?
The Blob trigger's
ZeroToOneTargetScalerdoes not need equivalent changes because:ScaleManager.GetTargetScaleResultwraps everyGetScaleResultAsynccall in a try/catch that logs viaLogFunctionScaleError(EventId 8001), which the SC's OpenTelemetry logger already intercepts.ScaleManagercallsLogFunctionScaleVote(EventId 8002) after every successfulGetScaleResultAsync, so the target worker count is already surfaced.Phase 2 (follow-up)
Migrating the
LogInformationscale vote detail logs toLogFunctionScaleVotewill follow once azure-webjobs-sdk #3189 ships (changes vote log level from Debug to Information).Context
Part of the Scale Controller App Insights logging feature (AAPT-Antares-ScaleController PR #14140160).
Related PRs: