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

Fix instance_ip_grouping_key not working on macOS #687

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

AceFire6
Copy link
Contributor

Fixes #629

The solution is adapted from this StackOverflow answer: https://stackoverflow.com/a/28950776

@csmarchbanks I decided I'd just make the PR so long and if the solution isn't acceptable it can just be closed 👍

Fixes prometheus#629

The solution is adapted from this StackOverflow answer: https://stackoverflow.com/a/28950776

Signed-off-by: Jethro Muller <[email protected]>
@csmarchbanks
Copy link
Member

Thank you for the PR, I just got back from a couple weeks of vacation, and will take a look at this soon. Just need to make sure I fully understand the workaround.

Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

I apologize for the delay. I spent some time testing this, and my main concern is that it looks like the result could be different with this change. E.g. on my local machine instance_ip_grouping_key() changes from {'instance': '127.0.0.1'} to {'instance': '192.168.1.107'}. For many cases the new result probably makes more sense, but this could be a breaking change if someone is configuring their servers with a specific IP address.

@AceFire6
Copy link
Contributor Author

Ah okay. That isn't good!

I wasn't really sure how to test it and we didn't end up using the patch upstream as we had intended to when I made this PR.

I guess this doesn't fit the bill then. I'm not really sure where to go from here so I guess I'll leave what happens next up to you.

Thanks for the review 👍

@csmarchbanks
Copy link
Member

One option would be to check if the platform is Darwin and use your new version in that case, but keep the old behavior for all other platforms? If there is a comment for why the two are handled slightly differently I would be happy moving forward with that.

@AceFire6
Copy link
Contributor Author

@csmarchbanks Cool, I can change the PR to do that 👍

@AceFire6
Copy link
Contributor Author

@csmarchbanks I've made the change to choose which method is used based on the platform 👍

Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

Thanks!

@csmarchbanks csmarchbanks merged commit 09fb459 into prometheus:master Sep 15, 2021
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.

instance_ip_grouping_key does not work on macOS
2 participants