[CosmosDb] Replacing scaling logs to WebJobs extension methods#975
Conversation
| if (!TryHandleCosmosException(e)) | ||
| { | ||
| _logger.LogWarning(Events.OnScaling, "Unable to handle {0}: {1}", e.GetType().ToString(), e.Message); | ||
| _logger.LogFunctionScaleWarning("Unable to handle.", _functionId, e); |
There was a problem hiding this comment.
Given the format change here, I suggest to reword to "Unable to handle exception.", or perhaps keep the wording as it was for this?
Thinking the formatted end result "Function 'Foo' warning: Unable to handle." showing up in log summaries is too vague.
| } | ||
|
|
||
| _logger.LogWarning(Events.OnScaling, errormsg); | ||
| _logger.LogFunctionScaleWarning(errormsg, _functionId, e); |
There was a problem hiding this comment.
nit: while you're in here, let's fix errormsg -> errorMsg or errorMessage
|
@alrod closing this stale PR. This is no longer applicable here. |
|
/reopen |
041ecde to
ae60e18
Compare
76ebcb7 to
625e00b
Compare
| @@ -79,7 +79,7 @@ internal TargetScalerResult GetScaleResultInternal(TargetScalerContext context, | |||
| targetWorkerCount = partitionCount; | |||
| } | |||
|
|
|||
| _logger.LogInformation(targetScaleMessage); | |||
| _logger.LogFunctionScaleVote(_functionId, targetWorkerCount, (int)remainingWork, concurrency, targetScaleMessage); | |||
There was a problem hiding this comment.
Same question here as in the other PR - these go from Information to Debug now. Will customers be confused they're no longer seeing these logs?
There was a problem hiding this comment.
Reverted - keeping LogInformation for the vote detail log as-is. See my reply on the SB PR for the full plan (phase 1: warnings/errors only, phase 2: vote logs after WebJobs SDK log level fix).
625e00b to
29edc5a
Compare
29edc5a to
a8b14a3
Compare
Summary
Replace direct
LogWarningcalls in the CosmosDB scaling extensions with standardizedLogFunctionScaleWarningWebJobs 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
functionIdconstructor parameter; replacedLogWarningwithLogFunctionScaleWarning; improved 'Unable to handle' message; renamederrormsgtoerrorMessage; fixedTryHandleCosmosExceptionto pass_functionIdinstead ofstring.EmptyLogWarningwithLogFunctionScaleWarningfor concurrency validation warningfunctionIdtoCosmosDBMetricsProviderMicrosoft.Azure.WebJobsfrom 3.0.42 to 3.0.44Phase 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 in azure-sdk-for-net: