You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to export metrics from AWS Lambda with the PeriodicExportingMetricReader, by calling forceFlush at the end of the handler function. However, after checking out the implementation, I realized that the metrics are not exported here.
Describe the solution you'd like
I would like to modify the PeriodicExportingMetricReader#forceFlush method to export the metrics here as well, before calling forceFlush on the exporter. Also, considering to add exporting to the shutdown function.
Describe alternatives you've considered
An alternative solution could be to add a new on-demand metric reader, that only exports metrics when forceFlush or shutdown is called. This would make sense if someone wants to export metrics at different breakpoints, for example at the end of the Lamda function.
Additional context
Example code:
constmeterProvider=newMeterProvider();constreader=newPeriodicExportingMetricReader({/** options **/});meterProvider.addMetricReader(reader);exports.handler=async()=>{// do some work// force metrics exportingawaitmeterProvider.forceFlush();return;}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
I am trying to export metrics from AWS Lambda with the PeriodicExportingMetricReader, by calling
forceFlush
at the end of the handler function. However, after checking out the implementation, I realized that the metrics are not exported here.Describe the solution you'd like
I would like to modify the
PeriodicExportingMetricReader#forceFlush
method to export the metrics here as well, before callingforceFlush
on the exporter. Also, considering to add exporting to theshutdown
function.Describe alternatives you've considered
An alternative solution could be to add a new on-demand metric reader, that only exports metrics when
forceFlush
orshutdown
is called. This would make sense if someone wants to export metrics at different breakpoints, for example at the end of the Lamda function.Additional context
Example code:
The text was updated successfully, but these errors were encountered: