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

[Metrics] Getting started document using ostream exporter #1341

Closed
lalitb opened this issue Apr 20, 2022 · 1 comment · Fixed by #1394
Closed

[Metrics] Getting started document using ostream exporter #1341

lalitb opened this issue Apr 20, 2022 · 1 comment · Fixed by #1394
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers metrics

Comments

@lalitb
Copy link
Member

lalitb commented Apr 20, 2022

Document Getting started guide for Metrics using Ostream exporter.

Good reference - https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics/getting-started

@lalitb lalitb added metrics documentation Improvements or additions to documentation good first issue Good for newcomers labels Apr 20, 2022
@lalitb lalitb added this to the Metrics SDK - Beta Release milestone Apr 20, 2022
@esigo esigo self-assigned this Apr 20, 2022
@marcalff
Copy link
Member

marcalff commented May 5, 2022

In addition to the documentation, and because the ostream exporter is used for tutorials / debugging purpose,
please consider also printing the metric name in the output:

diff --git a/exporters/ostream/src/metric_exporter.cc b/exporters/ostream/src/metric_exporter.cc
index bf97db0..18e73a3 100644
--- a/exporters/ostream/src/metric_exporter.cc
+++ b/exporters/ostream/src/metric_exporter.cc
@@ -96,6 +96,7 @@ void OStreamMetricExporter::printInstrumentationInfoMetricData(
   {
     sout_ << "\n  start time\t: " << timeToString(record.start_ts)
           << "\n  end time\t: " << timeToString(record.end_ts)
+          << "\n  name\t\t: " << record.instrument_descriptor.name_
           << "\n  description\t: " << record.instrument_descriptor.description_
           << "\n  unit\t\t: " << record.instrument_descriptor.unit_;

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants