HTTPClientConfig marshalling and unmarshalling JSON

38 views
Skip to first unread message

Olivier Cazade

unread,
Jul 19, 2022, 3:12:51 PM7/19/22
to Prometheus Developers
Hello,

I am having some issue marshaling and unmarshalling a HTTPClientConfig struct to JSON.

The problem is about the ProxyURL field. When there are no ProxyURL configured,it gets marshaled to "proxy_url":null, and then it gets unmarshaled to an empty string.

Contrary to a null pointer, an empty string will be handled by the http package like a valid Proxy. resulting in some connection error.

I first thought that it was some kind of bug, but then looking at the tests, this looks like an intended feature:

This is why I am confused here, is it a bug, or is there some kind of trick that I am missing?

Thanks,

Julien Pivotto

unread,
Jul 20, 2022, 2:24:10 AM7/20/22
to Olivier Cazade, Prometheus Developers
It is probably a bug. Json is not used in Prometheus, we use yaml.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/ace6dd1e-2f5f-47b7-bea0-00f182859210n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages