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

Add attribute for server port #9

Closed
wants to merge 1 commit into from

Conversation

TylerLubeck
Copy link
Contributor

@TylerLubeck TylerLubeck commented Jan 11, 2019

Description of the changes

Hello! We run multiple instances of redis on a given machine, and differentiate between them based on their port number. This PR adds a new custom attribute with the port number to each set of metrics

PR Review Checklist

Author

  • add a risk label after carefully considering the "blast radius" of your changes
  • describe the intent of your changes in the description. don't just rewrite your code in prose
  • assign at least one reviewer

Reviewer

  • review code for readability
  • verify that high risk behavior changes are well tested
  • check license for any new external dependency
  • ask questions about anything that isn't clear and obvious
  • approve the PR when you consider it's good to merge

@TylerLubeck
Copy link
Contributor Author

I don't seem to be able to add labels or reviewers. I believe this is a fairly low risk change, since I'm just adding an attribute and not modifying any existing ones.

@@ -161,7 +162,11 @@ func getRawMetrics(info string) (map[string]interface{}, map[string]map[string]i
}
} else {
value := strings.TrimSuffix(parts[1], "\r\n")
metrics[parts[0]] = asValue(value)
if parts[0] == "tcp_port" {
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 don't like doing this, and would love to hear suggestions on a better way. The problem seems to be that custom attributes must be strings and not numbers, and since tcp_port:6379 gets converted to a number the attribute isn't sent.

@alejandrodnm
Copy link
Contributor

Hi @TylerLubeck we will check this and #10 thanks for the PRs and sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants