Fix autodiscovery over UNIX domain sockets - #1317
Conversation
8a17104 to
d6b2a58
Compare
|
Can you help me understand what this fixes and how? Based on my understanding, the existing .String call on the URI should properly serialize and URI information. |
|
Sure. As I explained in the issue, is that URI is updated from As a result, for each discovered The problem is not visible when using remote connections - only local ones are affected. For remote ones, this happens to work - by chance - because the URLs have a non-empty host. Why the difference? I wonder, too. I tried reporting it to golang, as I believed this is a golang problem (after all, why should URL objects be so inconsistent), but they said that since no actual URL parses to this exact structure, the resulting .String return value is left undefined. They resort to correct guesses for a non-empty host, but prefer to guess wrong when the host is empty. See golang/go#5927 (comment) (maybe they can be convinced when presented with evidence of downstream impact, but my arguments alone proved insufficient). |
Fixes prometheus-community#1316 Signed-off-by: Arusekk <floss@arusekk.pl>
d6b2a58 to
35788c7
Compare
|
Still looking forward for this. ATM auto-discovery through UNIX domain sockets with alloy is an architectural blocker. @Arusekk Thank you for being on it 🙇🏼 |
|
Hey, sorry for the delay, @Arusekk! Although the fix looks correct, it would be awesome if we could add a test to make sure we don't accidentally reintroduce this bug. Maybe we could have a table-driven test covering:
|
|
/workflow-approve |
Fixes #1316
Compiles fine, but not tested any further. I hope this is trivial enough to be safe.