feat: add ConsoleMetricExporter#3120
Conversation
Allow to export metrics to the console refs open-telemetry#3036
Codecov Report
@@ Coverage Diff @@
## main #3120 +/- ##
==========================================
+ Coverage 93.13% 93.21% +0.08%
==========================================
Files 196 196
Lines 6406 6414 +8
Branches 1350 1350
==========================================
+ Hits 5966 5979 +13
+ Misses 440 435 -5
|
legendecas
left a comment
There was a problem hiding this comment.
You may need to remove the incomplete one defined in experimental/packages/opentelemetry-sdk-metrics-base/src/export/MetricExporter.ts and export the new one in experimental/packages/opentelemetry-sdk-metrics-base/src/index.ts.
Thank you! I have made your requested changes |
pichlermarc
left a comment
There was a problem hiding this comment.
Looks good overall, just a few nits and comments. 🙂
Thank you for working on this! 🙂
|
@hectorhdzg @pichlermarc I think I have accommodated both your feedback on the PR :) |
| export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void { | ||
| if (this._shutdown) { | ||
| // If the exporter is shutting down, by spec, we need to return FAILED as export result | ||
| setImmediate(resultCallback, { code: ExportResultCode.FAILED }); |
There was a problem hiding this comment.
Probably good to include a reason
pichlermarc
left a comment
There was a problem hiding this comment.
Looks good. Thanks for addressing the comments. 🙂
Which problem is this PR solving?
Adds a new metric exporter
ConsoleMetricExporterto export or log the metrics to the consoleFixes #3036
Short description of the changes
Adds
ConsoleMetricExporterType of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: