Skip to content

[Storage] Replacing scaling logs to WebJobs extension methods#53923

Merged
alrod merged 1 commit into
mainfrom
alrod/replace-logs-storage
Mar 20, 2026
Merged

[Storage] Replacing scaling logs to WebJobs extension methods#53923
alrod merged 1 commit into
mainfrom
alrod/replace-logs-storage

Conversation

@alrod

@alrod alrod commented Nov 13, 2025

Copy link
Copy Markdown
Member

Summary

Replace direct LogWarning calls in the Storage Queue scaling extensions with standardized LogFunctionScaleWarning WebJobs 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

  • QueueMetricsProvider.cs: Added functionId constructor parameter; replaced LogWarning with LogFunctionScaleWarning for error logging
  • QueueScaleMonitor.cs: Updated constructor call to pass functionId to QueueMetricsProvider
  • QueueTargetScaler.cs: Updated QueueMetricsProvider constructor call to pass functionId
  • QueueMetricsProviderTests.cs: Updated test constructor calls to include functionId parameter
  • CHANGELOG.md: Added entry under Other Changes

Why no Blob trigger changes?

The Blob trigger's ZeroToOneTargetScaler does not need equivalent changes because:

  1. Exceptions are already handled at the WebJobs SDK levelScaleManager.GetTargetScaleResult wraps every GetScaleResultAsync call in a try/catch that logs via LogFunctionScaleError (EventId 8001), which the SC's OpenTelemetry logger already intercepts.
  2. Scale votes are already emittedScaleManager calls LogFunctionScaleVote (EventId 8002) after every successful GetScaleResultAsync, so the target worker count is already surfaced.
  3. No connectivity error paths — unlike Queue/ServiceBus/EventHubs/CosmosDB metrics providers, the Blob target scaler has no internal catch blocks that silently swallow errors.

Phase 2 (follow-up)

Migrating the LogInformation scale vote detail logs to LogFunctionScaleVote will 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:

  • #53925 - EventHubs extension
  • #53926 - ServiceBus extension
  • #975 - CosmosDB extension

Copilot AI review requested due to automatic review settings November 13, 2025 23:29
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Nov 13, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.LogInformation to _logger.LogFunctionScaleVote in QueueTargetScaler for scale vote logging
  • Replaced _logger.LogWarning with _logger.LogFunctionScaleError in 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

Comment thread eng/Packages.Data.props Outdated
Comment thread NuGet.Config Outdated
@alrod alrod force-pushed the alrod/replace-logs-storage branch from 8f5e15d to 2a2c7c3 Compare November 14, 2025 00:09
@amnguye

amnguye commented Nov 17, 2025

Copy link
Copy Markdown
Member

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

@alrod alrod force-pushed the alrod/replace-logs-storage branch from 2a2c7c3 to ed18484 Compare November 18, 2025 01:26

@mathewc mathewc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit on spacing

@alrod alrod marked this pull request as draft December 12, 2025 01:25
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the no-recent-activity There has been no recent activity on this issue. label Feb 13, 2026
@github-actions

Copy link
Copy Markdown

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 if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the no-recent-activity label; otherwise, this is likely to be closed again with the next cleanup pass.

@github-actions github-actions Bot closed this Feb 20, 2026
@alrod

alrod commented Mar 19, 2026

Copy link
Copy Markdown
Member Author

/reopen

@github-actions github-actions Bot reopened this Mar 19, 2026
@github-actions github-actions Bot removed the no-recent-activity There has been no recent activity on this issue. label Mar 19, 2026
@alrod alrod force-pushed the alrod/replace-logs-storage branch from ed18484 to be103fe Compare March 19, 2026 05:31
@github-actions

github-actions Bot commented Mar 19, 2026

Copy link
Copy Markdown

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Microsoft.Azure.WebJobs.Extensions.Storage.Common

@alrod alrod force-pushed the alrod/replace-logs-storage branch from 0ee5c00 to c9b1aaf Compare March 20, 2026 21:46
@alrod alrod merged commit f07ac47 into main Mar 20, 2026
22 checks passed
@alrod alrod deleted the alrod/replace-logs-storage branch March 20, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants