Azure / Azure/azure-functions-host

OverflowException in MetricsEventManager.RaiseMetricsPerFunctionEvent

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

Description

Kusto logs are showing an overflow exception here for some customer apps:

```
System.OverflowException : Value was either too large or too small for a UInt64.
at System.Decimal.ToUInt64(Decimal d)
at System.Convert.ToUInt64(Decimal value)
at Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.MetricsEventManager.FunctionActivityTracker.<>c.b__29_1(IGrouping`2 functionGroups)
at /_/src/WebJobs.Script.WebHost/Diagnostics/MetricsEventManager.cs : 556
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.MetricsEventManager.FunctionActivityTracker.RaiseMetricsPerFunctionEvent()
at /_/src/WebJobs.Script.WebHost/Diagnostics/MetricsEventManager.cs : 565
at Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.MetricsEventManager.FunctionActivityTracker.TimerFlush(Object state)
at /_/src/WebJobs.Script.WebHost/Diagnostics/MetricsEventManager.cs : 382
```

Contributor guide

Open the contributing guide

Research direction

Start in src/WebJobs.Script.WebHost/Diagnostics/MetricsEventManager.cs at the reported lines 556 and 565, tracing the UInt64 conversion inside RaiseMetricsPerFunctionEvent. Reproduce or isolate the metric values that trigger the overflow, then verify that metrics flushing completes without the exception for those values.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.