- Notifications
You must be signed in to change notification settings - Fork 5.1k
[ServiceBus] Replacing scaling logs to WebJobs extension methods #53926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
functionIdparameters tofunctionNamefor consistency with the new logging methods - Replaced
LogInformationandLogWarningcalls with structured logging extension methodsLogFunctionScaleVoteandLogFunctionScaleError - 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; ...bus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Listeners/ServiceBusMetricsProvider.cs Show resolved Hide resolved
| } | ||
| 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."; |
There was a problem hiding this comment.
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.
...bus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Listeners/ServiceBusMetricsProvider.cs Outdated Show resolved Hide resolved
| @@ -17,7 +17,7 @@ namespace Microsoft.Azure.WebJobs.ServiceBus.Listeners | |||
| { | |||
| internal class ServiceBusScaleMonitor : IScaleMonitor<ServiceBusTriggerMetrics> | |||
| { | |||
| private readonly string _functionId; | |||
| private readonly string _functionName; | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
...bus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Listeners/ServiceBusMetricsProvider.cs Show resolved Hide resolved
eb27187 to 8430784 Compare
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.