-
Notifications
You must be signed in to change notification settings - Fork 785
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 basic docs for Metrics api and sdk #2452
Add basic docs for Metrics api and sdk #2452
Conversation
|
||
See [Program.cs](./Program.cs) for complete example. | ||
|
||
**Note** |
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.
Add colon after "Note".
|
||
### Basic metric usage | ||
|
||
1. Install the `System.Diagnostics.DiagnosticSource` package version |
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.
Is this going to be the only way to instrument applications, or is it still possible to include the OpenTelemetry.Api
package?
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.
the only way. There are no plans to add shim/wrapper around this in the API package.
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.
So that means that if I want to add metrics to my library, I need to take a dep on the DiagnosticSource package and not OTel? I can see why since this is "built-in", but I feel it would be also good to have a wrapper. For example, people coming from other languages have to learn, yet this new thing which is not so obvious. 🤔
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.
If you take a dependency on Otel.API, then it automatically brings in DS package.
This is the same model we use for tracing (and logging) as well.
We added wrapper for tracing, because the Activity API had lot of naming differences (because Activity existed before OTel came into existence.), and many folks felt the need for a wrapper.
Metric API in .NET was built ground up, closely following OTel spec, so there are not many differences, warranting the cost of maintaining another wrapper. Having said that, if there is any strong reason to have a wrapper - please create an issue and we can discuss more.
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.
Thanks @joaopgrassi @pirgeo @utpilla for reviews! I have resolved all comments. If I can get another review, that'd be great before merge! |
Merging to make progress .. Happy to take any additional comments in follow ups! |
To be expanded with more contents later.