Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Feature/new metrics #25

Merged
merged 8 commits into from
Apr 16, 2024
Merged

Feature/new metrics #25

merged 8 commits into from
Apr 16, 2024

Conversation

vlorinc
Copy link
Contributor

@vlorinc vlorinc commented Apr 9, 2024

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

@vlorinc vlorinc added the enhancement New feature or request label Apr 9, 2024
@vlorinc vlorinc requested a review from guvenc April 9, 2024 08:37
@vlorinc vlorinc self-assigned this Apr 9, 2024
@github-actions github-actions bot added the size/L label Apr 9, 2024
@vlorinc vlorinc linked an issue Apr 9, 2024 that may be closed by this pull request
Copy link
Collaborator

@guvenc guvenc left a 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
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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() {
Copy link
Collaborator

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"}

Copy link
Contributor Author

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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 12, 2024
Copy link
Collaborator

@guvenc guvenc left a 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.

@guvenc guvenc merged commit 96bc7d3 into main Apr 16, 2024
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation enhancement New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new metrics and refactor
2 participants