Novartis / cellxgene-gateway

Cellxgene Gateway allows you to use the Cellxgene Server provided by the Chan Zuckerberg Institute (https://github.com/chanzuckerberg/cellxgene) with multiple datasets.
Apache License 2.0
55 stars 32 forks source link

add basic prometheus metrics with prometheus_flask_exporter #72

Open rbelnap opened 2 years ago

rbelnap commented 2 years ago

I have a need to monitor the gateway with our existing prometheus infrastructure, this PR just adds generic monitoring for flask, which will work for basic path metrics and up/down monitoring. I plan on adding more useful metrics (cache status and usage, for example) but wanted to gauge interest with a PR early.

codecov-commenter commented 2 years ago

Codecov Report

Merging #72 (d500889) into master (390fe24) will increase coverage by 0.18%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   62.59%   62.78%   +0.18%     
==========================================
  Files          21       21              
  Lines         794      798       +4     
  Branches      113      113              
==========================================
+ Hits          497      501       +4     
  Misses        280      280              
  Partials       17       17              
Flag Coverage Δ
unittests 62.78% <100.00%> (+0.18%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cellxgene_gateway/gateway.py 37.41% <100.00%> (+1.65%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

alokito commented 2 years ago

Hi @rbelnap ! Thank you for the suggestion. This would be the first "non-functional" dependency added to cellxgene-gateway which gives me some pause. However, it does look really cool, and I don't think there is any competing standard for observability in the python world. Before we go down this path, can you think of a less intrusive way, perhaps that does not involve modifying gateway.py?