canonical / prometheus-juju-exporter

GNU General Public License v3.0
2 stars 8 forks source link

Split "collect" and "export" functionalities into separate subcommands. #13

Closed mkalcok closed 1 year ago

mkalcok commented 1 year ago

This is a workaround for a memory leak that occurred when the long running process (exporter) was using libjuju directly. Things that have been changed:

With this structure, libjuju objects are created only in the short-lived process prometheus-juju-exporter collect and therfore can't cause memory leak in the long living process prometheus-juju-exporter export

Note: This is just a working version to get some feedback. Unit tests were not adjusted yet.

TODO before potential merge:

esunar commented 1 year ago

I've checked the memory consumption with 10, 100 executions. It seems stable.

mkalcok commented 1 year ago

superseded with #14 which is a correct fix for the memory issue.