Azure / Azure/azure-functions-host

Update HostMetrics.AppFailure metric to use health check

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

Description

The [AppFailure](https://github.com/Azure/azure-functions-host/blob/22849a0dc36d5c5d32cc93368ec95f51a5534737/src/WebJobs.Script/Metrics/HostMetrics.cs#L93) metric is used to capture app failures in the function host, currently this is just permanent app failures, but will also be used for non-critical app failures in the future (potentially via a "severity" tag).

This metric should be persisted until resolved rather than reset on each flush of the metrics. A solution to this is to utilize the built-in Health Check metric in .NET 8. The goal of this issue is to update the `AppFailure` metric with a health check instead.

**Resources**:

- https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.diagnostics.healthchecks?view=dotnet-plat-ext-8.0
- https://learn.microsoft.com/en-us/dotnet/core/diagnostics/built-in-metrics-diagnostics
- https://learn.microsoft.com/en-us/dotnet/core/diagnostics/diagnostic-health-checks
- https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.diagnostics.healthchecks.imanualhealthcheck-1?view=dotnet-plat-ext-8.0

Contributor guide

Open the contributing guide

Research direction

Start in src/WebJobs.Script/Metrics/HostMetrics.cs at the AppFailure metric, then review the linked .NET 8 health-check and built-in-metrics resources. Confirm how the current metric is flushed and define done as replacing it with a health check that remains persisted until the app failure is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.