-
Notifications
You must be signed in to change notification settings - Fork 773
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
Add README for Metrics #4528
Add README for Metrics #4528
Conversation
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.
Awesome!
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.
Left few comments, nothing should be blocking this; but are very important to be added now or a future PR.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4528 +/- ##
==========================================
- Coverage 85.13% 85.11% -0.03%
==========================================
Files 318 318
Lines 12620 12620
==========================================
- Hits 10744 10741 -3
- Misses 1876 1879 +3 |
- Instruments SHOULD only be created once and reused throughout the application | ||
lifetime. This | ||
[example](../../docs/metrics/getting-started-console/Program.cs) shows how an | ||
instrument is created a `static` field and then used in the application. You |
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.
instrument is created a `static` field and then used in the application. You | |
instrument is created and stored in a `static` field and then used in the application. You |
instrument is created a `static` field and then used in the application. You | ||
could also look at this ASP .NET Core | ||
[example](../../examples/AspNetCore/Program.cs) which shows a more Dependency | ||
Injection friendly way of doing this by extracting the `Meter` and an |
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.
which shows a more Dependency Injection friendly way of doing this. -> I think this much is sufficient, to avoid too much details here.
a single MeterProvider is built at application startup, and is disposed of at | ||
application shutdown. For an ASP.NET Core application, use `AddOpenTelemetry` | ||
and `WithMetrics` methods from the `OpenTelemetry.Extensions.Hosting` package | ||
to correctly setup `MeterProvider`. Here's a [sample ASP .NET Core |
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.
sample -> example
ASP .NET -> ASP.NET
and `WithMetrics` methods from the `OpenTelemetry.Extensions.Hosting` package | ||
to correctly setup `MeterProvider`. Here's a [sample ASP .NET Core | ||
app](../../examples/AspNetCore/Program.cs) for reference. For simpler | ||
applications such as Console apps, refer to this |
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.
applications such as Console apps, refer to this | |
applications such as console apps, refer to this |
[doc](../../docs/metrics/customizing-the-sdk/README.md#changing-maximum-metricpoints-per-metricstream) | ||
for more information. The SDK would not process any newer unique key-value | ||
combination that it encounters, once this limit is reached. | ||
- MeterProvider is disposed. You need to ensure that the `MeterProvider` |
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.
- MeterProvider is disposed. You need to ensure that the `MeterProvider` | |
- MeterProvider is disposed incorrectly/earlier than desired. You need to ensure that the `MeterProvider` |
to correctly setup `MeterProvider`. Here's a [sample ASP .NET Core | ||
app](../../examples/AspNetCore/Program.cs) for reference. For simpler | ||
applications such as Console apps, refer to this | ||
[example](../../docs/metrics/getting-started-console/Program.cs). |
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.
also show asp.net example from controib repo.
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.
LGTM.
Changes