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

instrumental.Error Broken Pipe #6

Open
P110 opened this issue Oct 27, 2018 · 2 comments
Open

instrumental.Error Broken Pipe #6

P110 opened this issue Oct 27, 2018 · 2 comments

Comments

@P110
Copy link

P110 commented Oct 27, 2018

I'm using instrumental in a PHP based websocket server with infinite timeout. I realise that this probably isn't instrumental's intended use case but, after a few minutes I'll get the following error when trying to write to a metric:

[2018-10-27 12:34:18] instrumental.ERROR: Exception caught: fwrite(): send of 63 bytes failed with errno=32 Broken pipe #0 [internal fu...

Now, surprisingly, instrumental is able to recover from this and continues to write metrics the next time it's attempted until it falls over again and recovers again - the metrics we're recording through instrumental aren't mission critical and as such this behaviour is acceptable.

Is there any method to catch this exception in my code to prevent it being output to the log file?

Thank you

@mediocretes
Copy link
Contributor

How frequently are you sending metrics with that agent? Is it a case of metrics being sent regularly and then the socket dying after a few minutes, or is it several minutes of idle time followed by the next send failing?

Catching the exception is trickier... you might be able to give the agent its own logger and then set the log level to FATAL, or redirect its log output into /dev/null. I don't REALLY recommend that last one, as it would catch any other exceptions and throw them away.

@P110
Copy link
Author

P110 commented Nov 10, 2018

We're sending metrics at least 4 times every two minutes - it's regular metrics with the socket dying every four minutes or so.

Will give some janky exception catching a go

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