Azure / Azure/azure-functions-host

Improve FunctionsScaleManager logging

Open
#6,912 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

To help with CRI investigations, we should improve the logging of metrics prior to calling the monitor for a scale decision ([here](https://github.com/Azure/azure-functions-host/blob/82638e5f08700f9620f6141dc85ab142c848d505/src/WebJobs.Script/Scale/FunctionsScaleManager.cs#L69)). At a minimum we should log the number of samples being sent, and perhaps log all of the metrics as well, so we can see exactly what inputs went into the scale decision. Currently the metrics are only logged when they're taken [here](https://github.com/Azure/azure-functions-host/blob/82638e5f08700f9620f6141dc85ab142c848d505/src/WebJobs.Script/Scale/FunctionsScaleMonitorService.cs#L100) before they're persisted. Later for scale decisions we read the last N metrics samples in ascending order and pass those to the scale decision. So if there is an issue between writing/reading these we don't really have visibility into that.

Contributor guide

Open the contributing guide

Research direction

Start in src/WebJobs.Script/Scale/FunctionsScaleManager.cs around line 69, then compare the existing metric logging in src/WebJobs.Script/Scale/FunctionsScaleMonitorService.cs around line 100. Trace the samples passed to the monitor and determine the appropriate logging scope. Done means the pre-decision log shows the sample count and, if included, the metrics used for the scale decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, observability
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.