Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save haxwithaxe/1c61945df943af462964f2b5ee1904c1 to your computer and use it in GitHub Desktop.

Select an option

Save haxwithaxe/1c61945df943af462964f2b5ee1904c1 to your computer and use it in GitHub Desktop.
Pure bash healthcheck for stock promtail container

There's no wget and no curl (at least in the version I'm using at the moment). Here's a pure bash HTTP GET to /ready.

bash -c 'exec 3<>/dev/tcp/localhost/9080; \
echo -e GET /ready HTTP/1.1\\r\\nHost: localhost\\r\\n >&3; \
read line <&3; \
echo $line | grep -q "HTTP/1.1 200 OK"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment