Skip to content

Conversation

@jviau
Copy link
Contributor

@jviau jviau commented Oct 1, 2025

Issue describing the changes in this PR

resolves #11399

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

This PR's goal is to avoid emitting of metric tags when the tag value is null or empty. To accomplish this I had to drop usage of metric source gen, as it had no way to do that. Honestly, it is not a big loss -- writing these types manually is about just as much work if not less.

@jviau jviau requested a review from a team as a code owner October 1, 2025 16:35
Copilot AI review requested due to automatic review settings October 1, 2025 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the metric source generation for health check metrics and implements manual histogram classes to avoid emitting empty or null metric tags. The change transitions from auto-generated metric types to manual implementations that can conditionally exclude tags based on whether their values are null or empty.

  • Replaced source-generated histogram types with manual implementations
  • Added conditional tag filtering to prevent empty tags from being emitted
  • Moved metric value conversion logic into the main metrics class

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
HealthCheckMetricsGeneration.cs Removed entire file containing source-generated metric types and extension methods
HealthCheckMetrics.cs Added manual histogram implementations with conditional tag filtering and moved helper methods
launchSettings.json Added launch configuration for test project (unrelated to core changes)

@jviau jviau merged commit d8ca940 into dev Oct 3, 2025
9 checks passed
@jviau jviau deleted the u/jviau/avoid-empty-tags branch October 3, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HealthChecks] Metrics include an empty tag

4 participants