eodag icon indicating copy to clipboard operation
eodag copied to clipboard

prometheus metrics for server mode

Open sbrunato opened this issue 2 years ago • 3 comments
trafficstars

Implement prometheus metrics for server mode

Should be configurable as needed only in containers.

measure data downloaded from each provider measure product types searched ?

check https://github.com/trallnag/prometheus-fastapi-instrumentator

sbrunato avatar Sep 29 '23 16:09 sbrunato

additional suggested measures:

  • count of available providers
  • count of available product types

alambare avatar Oct 27 '23 10:10 alambare

Metrics should be OpenTelemetry as it's more general and the new standard way of doing things.

alambare avatar Nov 16 '23 13:11 alambare

Metrics are implemented with OpenTelemetriy automatic instrumentation (https://opentelemetry.io/docs/instrumentation/python/automatic/).

TODO:

  • Compare with https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CONTRIBUTING.md#guideline-for-instrumentations
  • Handle exceptions raised in the metric's code. Write a log message with the error.
  • Add test.
  • Cleanup of the code. For example, _instrument_search and _instrument_download used to be independent of each other (you could call _instrument_search without calling _instrument_download) but this is not the case anymore. This is not clear for the code and it should be rewritten.
  • Fix EODAGInstrumentor_uninstrument. The callback functions continue to be called after calling _uninstrument

dalpasso avatar Jan 11 '24 15:01 dalpasso