PeriodicExportingMetricReader tries to export when there's no data #5234
Labels
bug
Something isn't working
pkg:sdk-metrics
priority:p3
Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)
What happened?
Create a
PeriodicExportingMetricReader
wrapping anOTLPMetricExporter
. Flush the reader without recording any metrics. It will send an effectively empty export request, which is wasteful for both the client and receiver. We host a receiving backend and logged an error when receiving requests like this, and took a while to investigate because I didn't expect that the client would actually send such requests.I imagine
PeriodicExportingMetricReader
should be the one to skip exporting/reading when there's nothing to export, but this could maybe also be done inOTLPMetricExporter
and other exporters. The console exporter naturally does nothing because it iterates through things to export, so the loop is empty.OpenTelemetry Setup Code
package.json
Relevant log output
Operating System and Version
No response
Runtime and Version
No response
The text was updated successfully, but these errors were encountered: