Health & Monitoring
Liveness Probe
Kubernetes-compatible liveness probe to verify service is alive
GET
/
health
/
live
Typescript (SDK)
import { Screenshothis } from "@screenshothis/sdk";
const screenshothis = new Screenshothis();
async function run() {
const result = await screenshothis.health.getLive();
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Screenshothis\Screenshothis;
$sdk = Screenshothis\Screenshothis::builder()->build();
$response = $sdk->live(
);
if ($response->object !== null) {
// handle response
}curl --request GET \
--url https://api.screenshothis.com/health/liveimport requests
url = "https://api.screenshothis.com/health/live"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.screenshothis.com/health/live', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.screenshothis.com/health/live"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.screenshothis.com/health/live")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.screenshothis.com/health/live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "alive",
"timestamp": "2024-01-01T00:00:00.000Z"
}{
"status": "not alive",
"timestamp": "2024-01-01T00:00:00.000Z",
"error": "Application unresponsive"
}⌘I
Typescript (SDK)
import { Screenshothis } from "@screenshothis/sdk";
const screenshothis = new Screenshothis();
async function run() {
const result = await screenshothis.health.getLive();
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Screenshothis\Screenshothis;
$sdk = Screenshothis\Screenshothis::builder()->build();
$response = $sdk->live(
);
if ($response->object !== null) {
// handle response
}curl --request GET \
--url https://api.screenshothis.com/health/liveimport requests
url = "https://api.screenshothis.com/health/live"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.screenshothis.com/health/live', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.screenshothis.com/health/live"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.screenshothis.com/health/live")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.screenshothis.com/health/live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "alive",
"timestamp": "2024-01-01T00:00:00.000Z"
}{
"status": "not alive",
"timestamp": "2024-01-01T00:00:00.000Z",
"error": "Application unresponsive"
}