datalust / seq-input-healthcheck

Periodically GET an HTTP resource and write response metrics to Seq
Other
29 stars 11 forks source link

Using Unix domain sockets #43

Open Ctrl-Elite opened 6 days ago

Ctrl-Elite commented 6 days ago

Hello,

Is there any way to call Unix domain sockets using seq-input-healthcheck?

I'm trying to call docker engine api from inside the SEQ container using /var/run/docker.sock.

KodrAus commented 6 days ago

Hi @Ctrl-Elite :wave: I haven't tried this myself, but grokking through the source it looks like it should work with unix:///var/run/docker.sock since Docker's API is HTTP-based and .NET's HTTP client supports Unix domain sockets. Are you seeing any errors in Seq when you try run the healthcheck?

Ctrl-Elite commented 5 days ago

I don't think we can use unix:///var/run/docker.sock directly in .NET HTTP client. A SocketsHttpHandler is probably needed to achieve this. I can't seem to figure out what should I input in Target URLs. I have tried cURL URL but that's not working obviously.

KodrAus commented 5 days ago

Ah yes it looks like you're right and .NET can't actually use domain sockets by default. If it's something we can support without impacting other usecases then it could be good to support, otherwise your best bet may be to fork the app and make the adjustments you need.