You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the switch statement which looks at the type of connection and either connects via the mi_http interface, or the unix domain socket (a file on the filesystem), which would normally match the filename of the socket used in the socket_name setting of mi_datagram. However, the opensips configuration allows the socket to be defined as a network socket instead of a filename.
The socket connection would be accepted and relevant metrics get provided when queried for.
This means that the client interprets the socket path and checks whether it is a UDP socket instead of a filename and connects and queries accordingly.
Actual behaviour
$ opensips_exporter -protocol mi_datagram -addr 127.0.0.1:9434 -socket udp:127.0.0.1:8090
2020/12/06 22:52:29 Started OpenSIPS exporter, listening on 127.0.0.1:9434
2020/12/06 22:52:31 Error encountered while reading statistics from opensips socket: write unixgram opensips_exporter422669750/1.sock->udp:127.0.0.1:8090: sendto: no such file or directory
2020/12/06 22:52:31 Problems registering the *processors.pkmemProcessor processor (could be due to no metrics found for this processor). Error: collector has no descriptors
Stacktrace / Error message
nil
Other info
nil
The text was updated successfully, but these errors were encountered:
Thanks for bringing up this issue. I was aware that using a network socket was possible using the mi_datagram module, though we've always used unix domain sockets ourselves so we've had no need for it yet.
I think implementing this should be pretty easy, I don't have time right now to implement this myself but am more than happy to accept a pull request for this. In particular, have a look at the the New, roundtrip and GetStatistics functions in opensips.go. The implement the parts that deal with setting up, retrieving and parsing the response from opensips.
Version
OpenSIPS Exporter Version: 2.0.4
OpenSIPS 2.4.8
File / Feature
opensips_exporter/opensips_exporter.go
Line 37 in 0f7e5c1
This is the switch statement which looks at the type of connection and either connects via the mi_http interface, or the unix domain socket (a file on the filesystem), which would normally match the filename of the socket used in the
socket_name
setting ofmi_datagram
. However, the opensips configuration allows the socket to be defined as a network socket instead of a filename.Expected behaviour
The socket connection would be accepted and relevant metrics get provided when queried for.
This means that the client interprets the socket path and checks whether it is a UDP socket instead of a filename and connects and queries accordingly.
Actual behaviour
Stacktrace / Error message
nil
Other info
nil
The text was updated successfully, but these errors were encountered: