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

feat(inputs.dpdk): Add options to customize error-behavior and metric layout #14308

Merged
merged 16 commits into from
Dec 4, 2023

Conversation

PanKaker
Copy link
Contributor

@PanKaker PanKaker commented Nov 16, 2023

Required for all PRs

Contribution to inputs.dpdk plugin.

New version of the plugin with:

  • Supporting new ethdev metric: ethdev/info
  • Possibility to expose fields: pid and version of DPDK
  • Supporting to read from multiple in-memory sockets
  • Exposing numerical state of /ethdev/link_status. (0 for "DOWN", and 1 for "UP")
  • Supporting new configuration option unreachable_socket_behavior

More info in the README.MD

resolves #14307

@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Nov 16, 2023
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did only a small review on the docs..

plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
plugins/inputs/dpdk/sample.conf Outdated Show resolved Hide resolved
plugins/inputs/dpdk/sample.conf Outdated Show resolved Hide resolved
plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @PanKaker! I do have some comments regarding the plugin/function structure etc... Please take a look!

plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_cmds.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_cmds.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_cmds.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_connector.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_utils.go Outdated Show resolved Hide resolved
@PanKaker
Copy link
Contributor Author

PanKaker commented Nov 16, 2023

Hi, @srebhan. I've addressed almost all comments.

I will need to think about renaming the configuration options (dpdk_*) and I will back with the answer under the discussions

@PanKaker
Copy link
Contributor Author

All comments are addressed.
Waiting for feedback about renaming status_i field.

plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
@PanKaker PanKaker requested a review from srebhan November 21, 2023 18:38
@PanKaker
Copy link
Contributor Author

PanKaker commented Nov 23, 2023

Hi, @Hipska, @srebhan.

I can see that 1 ci is failing (ci/circleci: test-go-windows), I think it's not connected with the changes, could you please confirm this and rerun this step?

I'm also assuming that you will release a new release at the beginning of December. Could you please confirm, that we will be able to merge it until this time?

Thank you.

@Hipska

This comment was marked as outdated.

@srebhan
Copy link
Member

srebhan commented Nov 24, 2023

@PanKaker I commented on some of your comments. My punchline is that splitting code too much (especially if the factored-out functions are only called once) should be avoided. Having to much fragmentation disturbs reviews and debugging later so please do not wrap single function calls with a function. Furthermore, think of functions as a functional unit that is ingested easier if in one place. There are of course exceptions for very complicated or long functions...

…tifySocket function. Remove prepareGlob func. Remove getArrayDiff func. Update tests
@PanKaker
Copy link
Contributor Author

Hi, @srebhan.
All comments were addressed. Waiting for your feedback

Copy link
Member

@srebhan srebhan 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 update @PanKaker! I do have some more minor comments but we are getting close.

plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_connector.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk_utils.go Outdated Show resolved Hide resolved
@PanKaker
Copy link
Contributor Author

Hi, @srebhan.

All comments were addressed. Waiting for your feedback.

P.S. I've noticed that "Lint plugin readmes" is not passing, but it's not connected with this PR:

plugins/inputs/webhooks/artifactory/README.md:1: "Artifactory Webhook" does not match regexp " Plugin$"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Configuration"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Example Output"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Metrics"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Global configuration options"

Copy link
Member

@srebhan srebhan 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 update @PanKaker! Two more small comments and we are good to go from my side...

plugins/inputs/dpdk/dpdk_utils_test.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
@srebhan srebhan changed the title feat(inputs.dpdk): update plugin, new options and metrics feat(inputs.dpdk): Add options to customize error-behavior and metric layout Nov 30, 2023
@PanKaker
Copy link
Contributor Author

PanKaker commented Nov 30, 2023

Hi, @srebhan! Comments are addressed.

P.S. There is still issue wtih CI step Lint plugin readmes, but it's not connected with this PR:

plugins/inputs/webhooks/artifactory/README.md:1: "Artifactory Webhook" does not match regexp " Plugin$"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Configuration"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Example Output"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Metrics"
plugins/inputs/webhooks/artifactory/README.md:1: missing required section "Global configuration options"

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @PanKaker! Don't worry about the Webhook linter error above, I'm aware that it is not introduced by your PR. :-)

I did check the error-messages once again and found some without parameters (where we should use errors.New) and one with a non-consistent style. I can just submit the suggestions or you do it. Whatever you prefer...

plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
plugins/inputs/dpdk/dpdk.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @PanKaker!

@PanKaker
Copy link
Contributor Author

PanKaker commented Dec 1, 2023

Hi, @srebhan! Thank you for the feedback.

I've changed the fmt.Errorf to errors.New in addressed comments + in a few more places.

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 1, 2023
@srebhan srebhan assigned powersj and unassigned srebhan Dec 1, 2023
Copy link
Contributor

@powersj powersj 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 PR - I do have one question around the metadata fields option.

plugins/inputs/dpdk/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the time you put into this PR!

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Dec 4, 2023

@powersj powersj merged commit f654d92 into influxdata:master Dec 4, 2023
3 of 4 checks passed
@github-actions github-actions bot added this to the v1.29.0 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update input dpdk plugin. Add support for more metrics and tags
5 participants