earthpulse / eotdl

Earth Observation Training Datasets
https://eotdl.com
MIT License
18 stars 6 forks source link

Add prometheus client and download size tracking #111

Closed totycro closed 6 months ago

totycro commented 1 year ago

This PR introduces the prometheus client library and adds multiprocessing-safe metrics.

It also tracks downloaded data volume as a metric which is labelled by the user email address.

The metrics endpoint will then look like this (here I've downloaded a file of about 20kb 10 times):

# HELP eotdl_api_downloaded_bytes_total Bytes downloaded from this api
# TYPE eotdl_api_downloaded_bytes_total counter
eotdl_api_downloaded_bytes_total{user_email="bernhard.mallinger@eox.at"} 205540.0
achtsnits commented 10 months ago

@juansensio shall we try to rebase or will you have a look here?