-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few comments.
It would be also great, if you could write a couple of sentences to README.md what the exporter is doing. Only a few sentences would be sufficient, as it is not telling anything about the project at the moment.
Thanks !
@@ -0,0 +1,78 @@ | |||
package metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add the license text also here like in main.go ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license text added
@@ -0,0 +1,53 @@ | |||
package metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add the license text also here like in main.go ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license text added
main.go
Outdated
break | ||
go func() { | ||
for { | ||
if !testDpdkConnection() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing the new functionality of the "reconnect" in case dpservice gets restarted.
It works as expected, if the dpservice is down and gets restarted in a time period which is longer than time.Duration(pollIntervalFlag) * time.Second
. If it is shorter than that (dpservice gets stopped/started quickcly)
I get such an output. Can you also detect this error and try to reconnect to dpservice ?
sudo ./bin/prometheus-dpdk-exporter
{"level":"info","msg":"Hostname: guvenc-vm","time":"2024-04-11T19:15:44+02:00"}
{"level":"info","msg":"Server starting on :8080...","time":"2024-04-11T19:15:44+02:00"}
{"level":"error","msg":"Failed to send command to /var/run/dpdk/rte/dpdk_telemetry.v2: write unixpacket @-\u003e/var/run/dpdk/rte/dpdk_telemetry.v2: write: broken pipe","time":"2024-04-11T19:16:04+02:00"}
{"level":"error","msg":"Failed to send command to /var/run/dpdk/rte/dpdk_telemetry.v2: write unixpacket @-\u003e/var/run/dpdk/rte/dpdk_telemetry.v2: write: broken pipe","time":"2024-04-11T19:16:04+02:00"}
{"level":"error","msg":"Failed to send command to /var/run/dpdk/rte/dpdk_telemetry.v2: write unixpacket @-\u003e/var/run/dpdk/rte/dpdk_telemetry.v2: write: broken pipe","time":"2024-04-11T19:16:04+02:00"}
{"level":"error","msg":"Failed to send command to /var/run/dpdk/rte/dpdk_telemetry.v2: write unixpacket @-\u003e/var/run/dpdk/rte/dpdk_telemetry.v2: write: broken pipe","time":"2024-04-11T19:16:04+02:00"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked the testing function and now it should handle also this short interruption without error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements.
Refactored code: split the code into packages and functions.
Change of log format to comply with requirements.
Added Dockerfile and build, run, ... steps in Makefile.
Port on which exporter is running can be now set via flag.
Added reconnect attempt after dpservice went down and up again.
Added new Dpservice metric: virtsvc_used_port_count