[HealthChecks] Add TelemetryHealthCheckPublisher #11178
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
Part of #11010
Resolves #11170
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-proc
branch to be included in Core Tools and non-Flex deployments.in-proc
branch is not requiredrelease_notes.md
Additional information
Adds an
IHealthCheckPublisher
which publishes health checks as telemetry.az.functions.health_check.reports
[1]: Represents the health as a double, ranging from 0 to 1. 1 = healthy, 0.5 = degraded, 0 = unhealthy. By keeping this between 0 and 1, we open the door to a percentage based health calculation.
az.functions.health_check.tag
<empty_string>
[1],az.functions.liveness
,az.functions.readiness
[1]: Empty string represents all health checks being included for this metric
az.functions.health_check.unhealthy_checks
[1]: Represents the health as a double, ranging from 0 to 1. 1 = healthy, 0.5 = degraded, 0 = unhealthy. By keeping this between 0 and 1, we open the door to a percentage based health calculation.
az.functions.health_check.tag
<empty_string>
[1],az.functions.liveness
,az.functions.readiness
az.functions.health_check.name
az.functions.script_host.lifecycle
,az.functions.web_host.lifecycle
,az.functions.deployment
[1]: Empty string represents this was part of the all health checks publish. The goal is to have this tag match with
az.functions.health_check.reports
so they can be joined into a single view/query in dashboards.[2]: The name of a health check should follow OTel attribute naming conventions itself.
Other Changes
ObjectPool<T>
usage, with helpers for getting shared pools. First shared pool introduced is forStringBuilder
. This allows for efficient re-usage of string builders when possible.Notes
We intend to use health checks to back liveness & readiness probes. As such, having metrics scoped to specific health check tags will be important to highlight directly the history of those probes. This is why
TelemetryHealthCheckPublisher
has theadditionalTags
parameter. This approach will lead to redundant metrics, as publishing metrics for the "default" (no tag) health check plus a tag-filtered health check will overlap.