Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to monitor socketio application by events #141

Open
sparkingdark opened this issue Aug 31, 2022 · 5 comments
Open

Is it possible to monitor socketio application by events #141

sparkingdark opened this issue Aug 31, 2022 · 5 comments

Comments

@sparkingdark
Copy link

Hello,

Currently I am using python socketio for creating socket app , it it possible to monitor the app using this.

@rycus86
Copy link
Owner

rycus86 commented Aug 31, 2022

Hi,

Does your app use Flask at all? This library is for easy integration with Flask, otherwise you might want to check out the underlying Prometheus client library at https://github.com/prometheus/client_python

@sparkingdark
Copy link
Author

sparkingdark commented Aug 31, 2022

Yes my app use flask and other library which wrap it is the https://github.com/miguelgrinberg/Flask-SocketIO library so I am thinking to use this.

If this has only http support if we can add something like this nodejs implementation

https://github.com/shamil/socket.io-prometheus

@rycus86
Copy link
Owner

rycus86 commented Aug 31, 2022

Excellent, thanks! I wasn't aware of that integration.
You should be able to use this library then, which should give you the Prometheus client integration and basic HTTP metrics.
For the socketio managed methods you can try the metric helper functions (like metrics.counter, metrics.summary, etc) which should work I think, but admittedly haven't tried.
If you do try it I'd be interested to learn here how did you go with it?

@sparkingdark
Copy link
Author

sparkingdark commented Aug 31, 2022

Yeah sure I am trying understand how the socketio and underlying technique work so far I got that basically this integration create a http long polling connection after that it transmit the events and get data from clientside.

I will update this issue after sometime I get or anykind of discussion related to this. Possibly I am also thinking to contribute the methods for only socketio apps or examples in this repo.

I will try those helper functions.

@sparkingdark
Copy link
Author

So far I created a histogram and counter object with listening and receiving event label.Then I created a decorator function which I put on the top the listening event every-time that function receive some data it count and give the observed events. Now it's not the most efficient way but it gives the result back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants