Skip to content

Conversation

BowenYang666
Copy link
Contributor

@BowenYang666 BowenYang666 commented Apr 4, 2025

Support common tag and value for the same group of metrics

[CommonTag("Category", "Http")]
[CommonTag("MetricVersion", "v1")]
 static partial class Metric
 {
    [Counter("RequestName", "RequestStatusCode")]
    static partial RequestCounter CreateRequestCounter(Meter meter);
}
Microsoft Reviewers: Open in CodeFlow

@BowenYang666
Copy link
Contributor Author

@BowenYang666 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree company="Microsoft"

Bowen Yang (from Dev Box) added 2 commits April 4, 2025 15:02
@BowenYang666 BowenYang666 marked this pull request as ready for review April 7, 2025 01:30
@BowenYang666 BowenYang666 requested a review from a team as a code owner April 7, 2025 01:30
@dariusclay
Copy link
Member

This seems like a cool idea. Did you write up an API proposal for this? Since it's a new feature we might want to discuss it there, so that we don't end up having to change things later.

/// </example>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
[Conditional("CODE_GENERATION_ATTRIBUTES")]
[Experimental("EXPERIMENTAL_COMMON_TAG_ATTRIBUTE")]
Copy link
Member

Choose a reason for hiding this comment

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

Should use the well-defined experiment IDs

Suggested change
[Experimental("EXPERIMENTAL_COMMON_TAG_ATTRIBUTE")]
[Experimental(diagnosticId: DiagnosticIds.Experiments.Telemetry, UrlFormat = DiagnosticIds.UrlFormat)]

@BowenYang666
Copy link
Contributor Author

BowenYang666 commented Apr 8, 2025

This seems like a cool idea. Did you write up an API proposal for this? Since it's a new feature we might want to discuss it there, so that we don't end up having to change things later.

Thanks Darius. I have created a new feature proposal here:
#6259

@evgenyfedorov2
Copy link
Member

@BowenYang666 - could you put together a proper API proposal, please?
alternatively, @dariusclay - do you want to do it yourself and own this idea from the proposal up to implementation from Microsoft folks?

@dariusclay
Copy link
Member

I don't know how I missed your comment @evgenyfedorov2, but yes I will work with @BowenYang666 to push this through the process.

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.

3 participants