Skip to content

Conversation

@alrod
Copy link
Member

@alrod alrod commented Nov 14, 2025

Contributing to the Azure SDK

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

Copilot AI review requested due to automatic review settings November 14, 2025 00:12
Copilot finished reviewing on behalf of alrod November 14, 2025 00:19
Copy link
Contributor

Copilot AI left a comment

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; 
}
catch (UnauthorizedAccessException ex)
{
if (TimeToLogWarning())
{
_logger.LogWarning(ex, $"Connection string does not have 'Manage Claim' for {entityName} '{_entityPath}'. Unable to determine active message count.");
string message = $"Connection string does not have 'Manage Claim' for {entityName} '{_entityPath}'. Unable to determine active message count.";
Copy link
Member

@mathewc mathewc Nov 14, 2025

Choose a reason for hiding this comment

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

nit: can you avoid declaring message as before and just inline this in the log call? Same comment throughout. Wondering why you're not doing this consistently - e.g. on line 109 its inlined.

@@ -17,7 +17,7 @@ namespace Microsoft.Azure.WebJobs.ServiceBus.Listeners
{
internal class ServiceBusScaleMonitor : IScaleMonitor<ServiceBusTriggerMetrics>
{
private readonly string _functionId;
private readonly string _functionName;
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? Looks like its functionId for all the other monitors

Copy link
Member Author

Choose a reason for hiding this comment

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

replaced to functionId for consultancy

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants