-
Notifications
You must be signed in to change notification settings - Fork 6k
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
base: main
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this 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":::
I updated all the code snippets, only one left which shows how the generated code will look like, so I couldn't update it. |
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:
docs/core/diagnostics/metrics-strongly-typed.md
: Added instructions for installing theMicrosoft.Extensions.Telemetry.Abstractions
NuGet package and included a new usage example with necessaryusing
statements. [1] [2]docs/core/diagnostics/source-generated-metrics.md
: Created a new file explaining how to use source-generated metrics in .NET, including installation instructions, usage examples, and requirements for metric methods.References and navigation updates:
docs/core/diagnostics/metrics-strongly-typed.md
: Added a "See also" link to the new source-generated metrics documentation.docs/core/diagnostics/metrics.md
: Added a reference to the new source-generated metrics documentation.docs/navigate/tools-diagnostics/toc.yml
: Updated the table of contents to include links to the new source-generated metrics documentation and the strongly-typed metrics documentation.Fixes #Issue_Number (if available)
Internal previews