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

Switch to promhttp handler and continue on error #57

Closed
wants to merge 1 commit into from
Closed

Switch to promhttp handler and continue on error #57

wants to merge 1 commit into from

Conversation

vbatoufflet
Copy link

Hi all,

This PR follows a discussion started in #56 and use the new HTTP handler provided by the promhttp package along with the promhttp.ContinueOnError error handler to prevent inconsistent metrics from preventing the whole scraping.

Please let me know if this requests suits you or if I missed something here.

Regards.

@brian-brazil
Copy link
Contributor

When cAdvisor did similar in google/cadvisor#1679 it ended up making the scrape succeed, but instead started returning arbitrary subsets of the metrics.

@vbatoufflet
Copy link
Author

Indeed, the metric not matching the stable label length criterion isn't sent anymore.

Wouldn't it be better that I make this behavior configurable via a command-line argument?

@brian-brazil
Copy link
Contributor

I don't think it's a good idea to add a --randomly-break flag, the way to handle this is to fix the labels.

@vbatoufflet
Copy link
Author

Ok I understand.

When you say fix the label. You mean in collectd_exporter or upstream in collectd?

@brian-brazil
Copy link
Contributor

Wherever it needs to be fixed, I'm not too familiar with this part of collectd.

@vbatoufflet
Copy link
Author

Ok, so I'll close this PR keeping the original issue regarding the incompatibility open.

@beorn7
Copy link
Member

beorn7 commented Jan 30, 2018

Indeed, the metric not matching the stable label length criterion isn't sent anymore.

Yes, that's the idea behind the option. The client library is designed to never create invalid output, thus it can only fail completely or leave out the offending parts.

@vbatoufflet
Copy link
Author

vbatoufflet commented Jan 30, 2018

Indeed @beorn7, I implemented this change exactly for that purpose as I can't use the collectd_exporter at the moment with collectd instances exporting conntrack data.

I'll use my own version for tests waiting to find a proper fix that suits everyone to make the exporter compatible with collectd's way to export such metrics trough its binary protocol.

@brian-brazil
Copy link
Contributor

Have you considered using collectd's own Prometheus metrics output? It lacks this sanity checking.

@vbatoufflet
Copy link
Author

I must admit that I wasn't aware of its existence. Thanks! I'll take a look at 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