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 metrics injection #3315

Merged
merged 3 commits into from
Oct 18, 2016
Merged

Fix metrics injection #3315

merged 3 commits into from
Oct 18, 2016

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Oct 18, 2016

I made last minute change last time and didn't test it properly.
This disabled metrics-interface as injection was being done after all collectors were being registered.

License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu added the status/in-progress In progress label Oct 18, 2016
@Kubuxu Kubuxu force-pushed the fix/metrics-injection branch 2 times, most recently from c56e4a4 to 7425a21 Compare October 18, 2016 07:56
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu added the need/review Needs a review label Oct 18, 2016
Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

Good catch, thanks for adding a test


err := mprome.Inject()
if err != nil {
log.Warningf("Injecting prometheus handler for metrics failed with message: %s\n", err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

should this just be a warning? Or should we actually error out here?

Also, can we (in a future PR) have a flag to disable metrics entirely?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we can have flag, lacking metrics won't hurt working of the daemon so IMO it is better to continue.

If you want I can do Error log here instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Disabling of the metrics would be just not injecting the metrics.


err := mprome.Inject()
if err != nil {
log.Errorf("Injecting prometheus handler for metrics failed with message: %s\n", err.Error())
Copy link

Choose a reason for hiding this comment

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

How will :5001/debug/metrics/prometheus behave if Inject() fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will miss the metrics that are being added with metrics-interface and that is it.

Without this patch it runs as if the Inject has failed.

@whyrusleeping whyrusleeping merged commit 01ea333 into master Oct 18, 2016
@whyrusleeping whyrusleeping deleted the fix/metrics-injection branch October 18, 2016 22:45
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Oct 18, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants