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

Apply the same logic to all metric type for Hostname prefixing #83

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

uepoch
Copy link

@uepoch uepoch commented Sep 7, 2018

Use EnableHostname boolean in all types of metrics instead of just gauges

@uepoch
Copy link
Author

uepoch commented Sep 24, 2018

hello @banks !
Just added tests, ready to go from my POV

@uepoch
Copy link
Author

uepoch commented Nov 12, 2018

Do you need any more information ?

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Hey, overall I think this looks reasonable.

I'm not really responsible for this repo - I only got Commit so I could get some Consul changes through! Sorry you've not had attention here though!

Could you perhaps flesh out in the description some more of the rationale for why this is important - where is this library used that's effecting you etc. It's a perfectly reasonable change but it can help prioritise and incentivise the relevant teams to work on an issue if we know who is feeling an impact especially!

Thanks

if conf.EnableHostname && conf.EnableHostnameLabel {
return nil, fmt.Errorf("both EnableHostname and EnableHostnameLabel can't be true at the same time")
}

Copy link
Member

Choose a reason for hiding this comment

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

Does this risk being a breaking change for clients? Is it important the are mutually exclusive? I can't think of a very food reason to use both but If you are migrating between statsd and prometheus for example you might want both being reported in the interim?

Copy link
Author

Choose a reason for hiding this comment

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

https://github.com/armon/go-metrics/blob/master/statsd.go#L9 (not sure I linked properly)

Statsd and other sink handle labels on their own

In specific statsd case: append them in the name as a suffix, so if both were provided you could have
"localhost-something-localhost-label2

It could break clients using such configs initializers indeed but it will break the client interface anyway
This fix indeed fix the name of all the metrics except gauges if enableHostname is activated

I don't mind removing it tho: it was more of a safeguard against weird behaviors, what do you think ?

Copy link
Author

Choose a reason for hiding this comment

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

Since the metrics initialize is "mostly" done at start-up time for app, issues will be easier to detect for existing clients that does use both, compared to not seeing the same metrics name after a go get
but again, if you prefer, I really don't feel it's important to keep this if

@uepoch
Copy link
Author

uepoch commented Jan 21, 2019

Hello @banks, sorry for HLing again :( , did you had the time to look at this review ?

Should I remove the safeguard ?

@hashicorp-cla
Copy link

hashicorp-cla commented Sep 30, 2022

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


m.conraux seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

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.

3 participants