Skip to content

[ServiceBus] Replacing scaling logs to WebJobs extension methods#53926

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

[ServiceBus] Replacing scaling logs to WebJobs extension methods#53926
alrod merged 1 commit into
mainfrom
alrod/replace-logs-sb

Conversation

@alrod

@alrod alrod commented Nov 14, 2025

Copy link
Copy Markdown
Member

Summary

Replace direct LogWarning calls in the ServiceBus scaling extensions with standardized LogFunctionScaleWarning WebJobs extension method.

This enables the Scale Controller's OpenTelemetry logger to intercept scaling warning events (EventId 8003) and forward them to the customer's Application Insights, providing visibility into connectivity errors during scaling.

Changes

  • ServiceBusMetricsProvider.cs: Added functionId constructor parameter; replaced LogWarning with LogFunctionScaleWarning for all error/warning logging paths
  • ServiceBusTargetScaler.cs: Updated constructor call to pass functionId to ServiceBusMetricsProvider
  • ServiceBusScaleMonitor.cs: Updated constructor call to pass functionId to ServiceBusMetricsProvider
  • ServiceBusScaleMonitorTests.cs: Updated test assertions to match new warning log format
  • CHANGELOG.md: Added entry under Other Changes

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:

  • #53923 - Storage Queue extension
  • #53925 - EventHubs extension
  • #975 - CosmosDB extension

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 custom scaling logs in the Service Bus WebJobs extension with standardized WebJobs extension methods (LogFunctionScaleVote and LogFunctionScaleError). The changes update the WebJobs package version to 3.0.42-dev which presumably includes these new logging extension methods.

Key changes:

  • Renamed functionId parameters to functionName for consistency with the new logging methods
  • Replaced LogInformation and LogWarning calls with structured logging extension methods LogFunctionScaleVote and LogFunctionScaleError
  • Updated WebJobs package dependency from version 3.0.41 to 3.0.42-dev

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ServiceBusTargetScaler.cs Renamed _functionId to _functionName; replaced LogInformation with LogFunctionScaleVote for scale vote logging
ServiceBusScaleMonitor.cs Renamed _functionId to _functionName; passed function name to ServiceBusMetricsProvider
ServiceBusMetricsProvider.cs Added _functionName field and constructor parameter; replaced LogWarning calls with LogFunctionScaleError
Packages.Data.props Updated Microsoft.Azure.WebJobs packages from 3.0.41 to 3.0.42-dev
NuGet.Config Added local NuGet package source
Comments suppressed due to low confidence (1)

sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Listeners/ServiceBusMetricsProvider.cs:28

  • Corrected spelling of 'Subcription' to 'Subscription' in '_mainSubcriptionName'.
        private readonly string _mainSubcriptionName;

Comment thread NuGet.Config Outdated
@alrod alrod force-pushed the alrod/replace-logs-sb branch from eb27187 to 8430784 Compare November 15, 2025 00:41
@alrod alrod requested a review from mathewc November 15, 2025 00:43
@alrod alrod force-pushed the alrod/replace-logs-sb branch from 8430784 to 33eafcc Compare November 18, 2025 01:23
@alrod alrod force-pushed the alrod/replace-logs-sb branch 2 times, most recently from cc28200 to 9d0de62 Compare December 12, 2025 01:24
@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-sb branch from a4f5ba3 to fac4dca Compare March 19, 2026 21:59
@alrod alrod merged commit 8c3cf35 into main Mar 20, 2026
22 checks passed
@alrod alrod deleted the alrod/replace-logs-sb branch March 20, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants