-
Notifications
You must be signed in to change notification settings - Fork 451
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
Add metrics and RT monitoring #266
Comments
Metrics would definitely be a useful addition, and is something I've thought about in the past, but never got around to implementing anything. The only issue I see with your proposal is, how are messages defined? For storing / reporting stats, the concept of stateful toxics was implemented for scenarios similar to this. |
Thank you. I have been thinking about the idea of making a stateful toxic (I didn't know it exists already), my struggle with it is how to bring the context data to the toxic in the first place. It means either to make The other option is to go more in the path I took and monitor all the links through noop. I would prefer to do it through the link or the proxy instead of hacking noop, but since in the creation they just pass the channel directly to the toxic chain they are not aware of data passing through. About the definition of message, you are right - I guess what I'm measuring is actually packets. I feel fine with that for the sake of keeping toxiproxy unaware of protocols above tcp. The idea of bytes received is good. I did a fork of toxiproxy-frontend and added a graph that shows the metrics in real time, while grouping close events if there are too many. Using bytes received as group size instead of num of packets will be more meaningful. Any idea how can I know which client sent a specific packet? Also could be useful to show which toxics were active in a specific packet, especially where there is a probability they work. Any idea how can I know that? |
Any more comments, anyone? Before I open a PR? |
Hi,
I would like to add metrics to allow RT monitoring, to allow automatic & manual test on remote servers verify that the traffic is actually passing through toxiproxy, verify that they stop, see clients connects and disconnects and so on.
I've been experimenting with the code and got something working, and would like to consult before I create a PR.
The functionality I added does as follows:
The way I did it is by creating a
metrics
module, with aRegisterEvent
method. Inproxy.go
I report when client connects, inlink.go
I report that a clients disconnects.Things got trickier when trying to report messages. I used the fact that noop toxic is always present to report from there. The problem is that noop toxic doesn't have any context to its work, so I had to add
ProxyName
andUpstream
toNoopProxy
, and had to pass this information on to and from where it is created, namelyLink
andToxicStub
.Does this make sense? In addition, I wasn't able to tell in
NoopProxy
which client sent a specific message. Any idea how can I do that?Thanks!
The text was updated successfully, but these errors were encountered: