Skip to content
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

Merged
merged 9 commits into from
Oct 6, 2021

Conversation

cijothomas
Copy link
Member

To be expanded with more contents later.

@cijothomas cijothomas requested a review from a team October 6, 2021 01:20

See [Program.cs](./Program.cs) for complete example.

**Note**
Copy link
Contributor

Choose a reason for hiding this comment

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

Add colon after "Note".

src/OpenTelemetry.Api/README.md Outdated Show resolved Hide resolved
src/OpenTelemetry.Api/README.md Outdated Show resolved Hide resolved
src/OpenTelemetry.Api/README.md Outdated Show resolved Hide resolved
src/OpenTelemetry.Api/README.md Outdated Show resolved Hide resolved

### Basic metric usage

1. Install the `System.Diagnostics.DiagnosticSource` package version
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@joaopgrassi joaopgrassi Oct 6, 2021

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. 🤔

Copy link
Member Author

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.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM.

@cijothomas
Copy link
Member Author

Thanks @joaopgrassi @pirgeo @utpilla for reviews! I have resolved all comments. If I can get another review, that'd be great before merge!

@cijothomas
Copy link
Member Author

Merging to make progress .. Happy to take any additional comments in follow ups!

@cijothomas cijothomas merged commit 8159df1 into open-telemetry:main Oct 6, 2021
@cijothomas cijothomas deleted the cijothomas/metricdoc1 branch October 6, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants