arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
737 stars 125 forks source link

prometheus extra #213

Closed sfc-gh-jcarroll closed 8 months ago

sfc-gh-jcarroll commented 9 months ago

This will be broken until 1.31, do not merge

Add an extra for exposing Prometheus metrics via the Prometheus python client and Streamlit's existing (not really documented) metrics endpoint at /_stcore/metrics.

Note: I added prometheus-client dependency which is pretty lightweight. I can also remove it and just call out in the docs that it needs to be installed?? Not sure if we usually just add all global dependencies here or not.

Working example: https://github.com/sfc-gh-jcarroll/streamlit-extras/tree/prometheus-example/prometheus_example

netlify[bot] commented 9 months ago

Deploy Preview for phenomenal-crepe-0effec ready!

Name Link
Latest commit f845f0d105bca71709e8a92e5636d71b19e82e95
Latest deploy log https://app.netlify.com/sites/phenomenal-crepe-0effec/deploys/65ba7f3695c1bf0008ad0cf7
Deploy Preview https://deploy-preview-213--phenomenal-crepe-0effec.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sfc-gh-jcarroll commented 9 months ago

Requesting review from @arnaudmiribel or @blackary

@kajarenc could you take a quick look at the streamlit hooks for any concerns? I tested it a fair bit and looks like compatibility goes back quite a ways too (I looked back as far as 1.20)

sfc-gh-jcarroll commented 8 months ago

Ready for review and merge