Skip to content

Add source generated metrics doc #45784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mariamgerges
Copy link
Contributor

@mariamgerges mariamgerges commented Apr 11, 2025

Summary

This pull request includes updates to the documentation for .NET metrics, specifically focusing on the introduction and usage of source-generated metrics and the addition of installation instructions for the related NuGet package. The most important changes include adding a new documentation file for source-generated metrics, updating existing documentation to reference this new file, and providing detailed usage examples.

Documentation updates:

References and navigation updates:


Internal previews

📄 File 🔗 Preview link
docs/core/diagnostics/metrics-generator.md docs/core/diagnostics/metrics-generator
docs/core/diagnostics/metrics-strongly-typed.md docs/core/diagnostics/metrics-strongly-typed
docs/core/diagnostics/metrics.md docs/core/diagnostics/metrics
docs/navigate/tools-diagnostics/toc.yml docs/navigate/tools-diagnostics/toc

@dariusclay
Copy link

What's the main difference between this update and https://learn.microsoft.com/dotnet/core/diagnostics/metrics-strongly-typed ?

@mariamgerges
Copy link
Contributor Author

What's the main difference between this update and https://learn.microsoft.com/dotnet/core/diagnostics/metrics-strongly-typed ?

this is generally for fast metering, while the other is for metrics with strong types.

@mariamgerges mariamgerges self-assigned this Apr 11, 2025
Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

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

This is a great start, just a few nits. One thing we should also do, is move all the code to under a snippets directory. So, under the docs/core/diagnostics folder, you'll create a snippets folder - if there isn't one already. You'll add a new folder specific to the topic, maybe metrics - and then put the solution, projects, and code files there.

Then back in the Markdown file, you reference the code using the following syntax:

:::code language="csharp" source="snippets/metrics/Path/To/Code.cs":::

@mariamgerges
Copy link
Contributor Author

This is a great start, just a few nits. One thing we should also do, is move all the code to under a snippets directory. So, under the docs/core/diagnostics folder, you'll create a snippets folder - if there isn't one already. You'll add a new folder specific to the topic, maybe metrics - and then put the solution, projects, and code files there.

Then back in the Markdown file, you reference the code using the following syntax:

:::code language="csharp" source="snippets/metrics/Path/To/Code.cs":::

I updated all the code snippets, only one left which shows how the generated code will look like, so I couldn't update it.

@mariamgerges mariamgerges removed the request for review from tommcdon April 14, 2025 12:44
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.

4 participants