Skip to content

introduce support for the Gauge metric type#7203

Draft
rainsxng wants to merge 14 commits intomainfrom
dbohdanov/source-gen-gauge-support
Draft

introduce support for the Gauge metric type#7203
rainsxng wants to merge 14 commits intomainfrom
dbohdanov/source-gen-gauge-support

Conversation

@rainsxng
Copy link
Contributor

@rainsxng rainsxng commented Jan 13, 2026

Microsoft Reviewers: Open in CodeFlow

return tagConfigs;
}

if (typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change needed in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not directly related to Gauge, but it's a bug fix since some of the types could've slipped through validation. int? has specialType=None initially and then it gets unwrapped at specialType = typeSymbol.OriginalDefinition.SpecialType which results in System_Nullable_T instead of the real type. That behavior makes the logic inconsistent, since int?, double?, DateTime? would pass the validation. These changes detect it early and return before unwrapping happens

Assembly.GetAssembly(typeof(CounterAttribute))!,
Assembly.GetAssembly(typeof(HistogramAttribute))!,
Assembly.GetAssembly(typeof(CounterAttribute<>))!,
Assembly.GetAssembly(typeof(HistogramAttribute<>))!,
Copy link
Contributor

@iliar-turdushev iliar-turdushev Jan 21, 2026

Choose a reason for hiding this comment

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

Can we add Gauge and Gauge<T> here?


[Fact]
public async Task GaugeNotSupported()
public async Task GaugeIsSDocumented()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public async Task GaugeIsSDocumented()
public async Task GaugeIsDocumented()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants