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: Bump github.com/aerospike/aerospike-client-go from 1.27.0 to 5.7.0 #10604

Merged
merged 5 commits into from
Feb 22, 2022

Conversation

aratik711
Copy link
Contributor

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in [conventional commit format]

resolves #10315

The changes are listed below:

  • Upgrading aerospike go client to 5.7.0.
  • Removing SSL support from the aerospike telegraf plugin. enable_ssl option would no longer be available.
  • Added an option in the aerospike input plugin config as tls_name, which should be set to the value of tls-name under tls{} stanza in the aerospike.conf if present.
  • Fixed the value of node_name tag to return Node.GetName() which now correctly returns node name, instead of the host:port which was incorrect.

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Feb 8, 2022
Copy link
Contributor

@sspaink sspaink 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 so much for working on this! Just some minor comments for you to address.

plugins/inputs/aerospike/aerospike.go Show resolved Hide resolved
plugins/inputs/aerospike/aerospike_test.go Outdated Show resolved Hide resolved
@sspaink sspaink 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 Feb 14, 2022
@powersj powersj changed the title fix: Bump github.com/aerospike/aerospike-client-go from 1.27.0 to 5.7.0 feat: Bump github.com/aerospike/aerospike-client-go from 1.27.0 to 5.7.0 Feb 15, 2022
@powersj
Copy link
Contributor

powersj commented Feb 15, 2022

Hi,

Looking through this, I only had one question from your initial PR description:

Fixed the value of node_name tag to return Node.GetName() which now correctly returns node name, instead of the host:port which was incorrect.

Is this the reason for all the changes from hostPort to nodeHost? My concern is changing a tag that users might already be using is not ideal.

@aratik711
Copy link
Contributor Author

@powersj Here
https://github.com/influxdata/telegraf/pull/10604/files#diff-a8caf4914634b15870431f7a18f3c09854fe2da6fab7b3a3d40b28bac4119b64R163

For every node it currently returns the same host:port given in the config, ideally it should return the host:port of the node for which we are sending the metrics for.
Ex: if we are sending metrics for node1 it currently sends host:port of node1
if we are sending metrics for node2 it currently sends host:port of node1

Shouldn't it send the host:port of the node it is fetching the metrics from?

@powersj
Copy link
Contributor

powersj commented Feb 16, 2022

Shouldn't it send the host:port of the node it is fetching the metrics from?

Yes, that change is correct.

However, are you also changing the format of the node + port to node name?

@aratik711
Copy link
Contributor Author

@powersj as per the README as well
aerospike_host=localhost:3000,node_name="BB9020011AC4202"
We are supposed to send the node name, host+port is already being sent under aerospike_host.

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.

My hesitation has been that this is changing a tag value. However, it is changing it to the correct value, so I'll approve this. Thanks

@powersj powersj merged commit 63d4a87 into influxdata:master Feb 22, 2022
func (a *Aerospike) getNodeInfo(n *as.Node) (map[string]string, error) {
stats, err := as.RequestNodeStats(n)
func (a *Aerospike) getNodeInfo(n *as.Node, infoPolicy *as.InfoPolicy) (map[string]string, error) {
stats, err := n.RequestInfo(infoPolicy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I know it's a little late, but I think this has introduced a bug. Shouldn't this be added to this method call?

Suggested change
stats, err := n.RequestInfo(infoPolicy)
stats, err := n.RequestInfo(infoPolicy, "statistics")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hipska Thanks, Let me quickly test it out and create a PR

@@ -465,6 +466,8 @@ func parseAerospikeValue(key string, v string) interface{} {
return parsed
} else if parsed, err := strconv.ParseBool(v); err == nil {
return parsed
} else if parsed, err := strconv.ParseFloat(v, 32); err == nil {

Choose a reason for hiding this comment

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

Why are we doing 32-bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug 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.

Upgrade aerospike go client to v5/v4
5 participants