# Website monitoring for developers.

Find out when your database, queue, or cron jobs stop working.

Health endpoints, scheduled task monitoring, uptime, and an API in one place. Alerts go to the person who can fix the problem.

10-day free trial · No credit card required

[ Pick your stack ](#stack)

- Bitmovin
- HBO Nordic
- Obsidian
- Laravel
- Fathom Analytics
- Stanford University
- Takeaway.com
- IGN
- VRT NWS

Supported stacks

## The same checks for every stack.

Every stack gets the same health endpoint, the same cron heartbeat, and the same alerts. This page shows a short example for each stack. The docs have the full setup.

### Next.js and Node

Health JSON · API

#### Health endpoint

Return the health JSON from a route handler. Oh Dear sends your secret in the `oh-dear-health-check-secret` header.

 ```
// app/api/health/route.ts
export async function GET(request: Request) {
  const secret = request.headers.get("oh-dear-health-check-secret");

  if (secret !== process.env.OH_DEAR_HEALTH_CHECK_SECRET) {
    return new Response(null, { status: 403 });
  }

  return Response.json({
    finishedAt: Math.floor(Date.now() / 1000),
    checkResults: [
      { name: "Database", label: "Database", status: "ok", shortSummary: "Connected" },
      { name: "Queue", label: "Queue", status: "failed", shortSummary: "No workers" },
    ],
  });
}
```

#### Cron heartbeat

Ping Oh Dear at the end of a Vercel Cron route, a BullMQ worker, or any script. When a ping is missing, you get an alert.

 ```
// after the job succeeds
await fetch(process.env.OH_DEAR_PING_URL!, {
  signal: AbortSignal.timeout(5000),
}).catch(() => {}); // a failed ping never fails the job
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#nodejs)

### Python: Django, FastAPI, Flask

Health JSON · API

#### Health endpoint

One view is enough. This example is Django. FastAPI and Flask look the same.

 ```
# views.py
import hmac, os, time
from django.http import HttpResponseForbidden, JsonResponse

def health(request):
    secret = request.headers.get("oh-dear-health-check-secret", "")
    if not hmac.compare_digest(secret, os.environ["OH_DEAR_HEALTH_CHECK_SECRET"]):
        return HttpResponseForbidden()

    return JsonResponse({
        "finishedAt": int(time.time()),
        "checkResults": [
            {"name": "Database", "label": "Database", "status": "ok", "shortSummary": "Connected"},
            {"name": "Celery", "label": "Celery", "status": "ok", "shortSummary": "3 workers"},
        ],
    })
```

#### Cron heartbeat

Ping at the end of a Celery task, a management command, or a cron script.

 ```
import os, urllib.request

try:
    urllib.request.urlopen(os.environ["OH_DEAR_PING_URL"], timeout=5)
except OSError:
    pass  # a failed ping never fails the job
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#python)

### PHP and Laravel

Official packages

#### Health endpoint

On Laravel, [spatie/laravel-health](https://github.com/spatie/laravel-health) adds the protected Oh Dear endpoint for you. In plain PHP, use [ohdearapp/health-check-results](https://github.com/ohdearapp/health-check-results).

 ```
// composer require spatie/laravel-health
// config/health.php
'oh_dear_endpoint' => [
    'enabled' => true,
    'always_send_fresh_results' => true,
    'secret' => env('OH_DEAR_HEALTH_CHECK_SECRET'),
    'url' => '/oh-dear-health-check-results',
],
```

#### Cron heartbeat

[spatie/laravel-schedule-monitor](https://github.com/spatie/laravel-schedule-monitor) syncs every scheduled task for you. Or ping from one task:

 ```
// routes/console.php
Schedule::command('reports:send')
    ->daily()
    ->pingOnSuccess('https://ping.ohdear.app/your-ping-id');
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#laravel) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#php)

### Ruby on Rails

Health JSON · API

#### Health endpoint

One controller action returns the health JSON.

 ```
# app/controllers/health_controller.rb
class HealthController < ActionController::API
  def show
    secret = request.headers["oh-dear-health-check-secret"].to_s
    expected = ENV.fetch("OH_DEAR_HEALTH_CHECK_SECRET")
    return head :forbidden unless ActiveSupport::SecurityUtils.secure_compare(secret, expected)

    render json: {
      finishedAt: Time.now.to_i,
      checkResults: [
        { name: "Database", label: "Database", status: "ok", shortSummary: "Connected" },
      ],
    }
  end
end
```

#### Cron heartbeat

Ping at the end of a Solid Queue job, a rake task, or a whenever entry.

 ```
require "net/http"

begin
  Net::HTTP.get(URI(ENV.fetch("OH_DEAR_PING_URL")))
rescue StandardError
  # a failed ping never fails the job
end
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#ruby)

### Java and Spring Boot

Health JSON · API

#### Health endpoint

Return the health JSON from a controller. One customer built an open source Java library on this format.

 ```
@Value("${OH_DEAR_HEALTH_CHECK_SECRET}")
private String secret;

@GetMapping("/health")
ResponseEntity<Map<String, Object>> health(
    @RequestHeader(name = "oh-dear-health-check-secret", defaultValue = "") String given) {
  if (!MessageDigest.isEqual(given.getBytes(UTF_8), secret.getBytes(UTF_8))) {
    return ResponseEntity.status(HttpStatus.FORBIDDEN).build();
  }

  return ResponseEntity.ok(Map.of(
    "finishedAt", Instant.now().getEpochSecond(),
    "checkResults", List.of(Map.of(
      "name", "Database", "label", "Database",
      "status", "ok", "shortSummary", "Connected"))));
}
```

#### Cron heartbeat

Ping when a `@Scheduled` method or a Quartz job finishes. In a Kubernetes CronJob, add `curl` after your command.

 ```
try {
  HttpClient.newHttpClient().send(
    HttpRequest.newBuilder(URI.create(pingUrl))
      .timeout(Duration.ofSeconds(5)).build(),
    HttpResponse.BodyHandlers.discarding());
} catch (Exception e) {
  // a failed ping never fails the job
}
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#implementing-the-ping-url-in-your-application)

### .NET and C#

Health JSON · API

#### Health endpoint

Return the health JSON from a minimal API endpoint.

 ```
app.MapGet("/health", (HttpRequest request, IConfiguration config) =>
{
    var given = Encoding.UTF8.GetBytes(request.Headers["oh-dear-health-check-secret"].ToString());
    var secret = Encoding.UTF8.GetBytes(config["OhDear:HealthCheckSecret"]!);

    if (!CryptographicOperations.FixedTimeEquals(given, secret))
    {
        return Results.StatusCode(403);
    }

    return Results.Json(new
    {
        finishedAt = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
        checkResults = new[]
        {
            new { name = "Database", label = "Database", status = "ok", shortSummary = "Connected" },
        },
    });
});
```

#### Cron heartbeat

Ping at the end of a Hangfire job or an Azure Functions timer trigger.

 ```
try
{
    using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
    await http.GetAsync(Environment.GetEnvironmentVariable("OH_DEAR_PING_URL"));
}
catch (Exception)
{
    // a failed ping never fails the job
}
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#implementing-the-ping-url-in-your-application)

### Go

Health JSON · API

#### Health endpoint

The standard library is enough. Using Laravel Go? [spatie/laravel-health-go](https://github.com/spatie/laravel-health-go) adds the endpoint for you.

 ```
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
	secret := os.Getenv("OH_DEAR_HEALTH_CHECK_SECRET")
	given := r.Header.Get("oh-dear-health-check-secret")
	if secret == "" || subtle.ConstantTimeCompare([]byte(given), []byte(secret)) != 1 {
		w.WriteHeader(http.StatusForbidden)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(map[string]any{
		"finishedAt": time.Now().Unix(),
		"checkResults": []map[string]string{
			{"name": "Database", "label": "Database", "status": "ok", "shortSummary": "Connected"},
		},
	})
})
```

#### Cron heartbeat

Ping when the job has finished.

 ```
client := http.Client{Timeout: 5 * time.Second}
if resp, err := client.Get(os.Getenv("OH_DEAR_PING_URL")); err == nil {
	resp.Body.Close()
}
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#golang)

### Rust: Axum, Actix

Health JSON · API

#### Health endpoint

Return the health JSON from a handler. Using Laravel Rust? [spatie/laravel-health-rust](https://github.com/spatie/laravel-health-rust) adds the endpoint for you.

 ```
// Axum
async fn health(headers: HeaderMap) -> Response {
    let secret = std::env::var("OH_DEAR_HEALTH_CHECK_SECRET").unwrap_or_default();
    let given = headers
        .get("oh-dear-health-check-secret")
        .and_then(|value| value.to_str().ok())
        .unwrap_or("");

    if secret.is_empty() || given != secret {
        return StatusCode::FORBIDDEN.into_response();
    }

    Json(json!({
        "finishedAt": Utc::now().timestamp(),
        "checkResults": [
            {"name": "Database", "label": "Database", "status": "ok", "shortSummary": "Connected"}
        ]
    }))
    .into_response()
}
```

#### Cron heartbeat

Ping when the job has finished.

 ```
if let Ok(url) = std::env::var("OH_DEAR_PING_URL") {
    // a failed ping never fails the job
    let _ = reqwest::Client::new()
        .get(url)
        .timeout(Duration::from_secs(5))
        .send()
        .await;
}
```

[ Health docs ](https://ohdear.app/docs/features/application-health-monitoring#all-other-languages) [ Cron docs ](https://ohdear.app/docs/features/cron-job-monitoring#implementing-the-ping-url-in-your-application)

Framework not listed? If it can serve HTTP, it can serve the health JSON. Start from the [health check results format](https://ohdear.app/docs/features/application-health-monitoring#health-check-results-format).

Three kinds of checks

## A 200 OK doesn't mean your app works.

A green uptime check only proves that a URL answered. Add two small things. One is a health endpoint inside your app. The other is a heartbeat from your scheduled tasks. Oh Dear checks everything else from outside, with no code.

### Health endpoint

**Checks you choose** Database, cache, queues, mail, disk, or a check you write yourself. Oh Dear reads the results every minute by default.

**No agent** Your app runs the checks. Oh Dear reads one endpoint, protected by a secret.

### Cron heartbeat

**Ping when done** Vercel Cron, Celery, the Laravel scheduler, Solid Queue, Hangfire, or plain cron. A missing or late ping means an alert.

**One limit** A ping proves the job finished on time. It doesn't prove the job produced the right result.

### No code at all

**Outside checks** Uptime, SSL expiry, DNS, broken links, mixed content, ports, ping, Lighthouse, and sitemaps.

**Every stack at once** One account watches the marketing site, the API, and the workers, even when each runs on a different stack.

API, CLI, and MCP

## Automate it like the rest of your pipeline.

Create monitors when you deploy, start a maintenance window during a release, or pull uptime and broken link results into your own tools.

### One API for every check.

The REST API covers monitors, checks, uptime, SSL, DNS, cron, application health, and status pages. Download the OpenAPI spec and generate a client in the language you use.

The [CLI](https://ohdear.app/docs/tools-and-sdks/our-cli-tool) and the [MCP server](https://ohdear.app/docs/tools-and-sdks/mcp-server) put the same data in your terminal and your coding assistant. Prefer infrastructure as code? Community-maintained Terraform and Pulumi providers are listed in the [integrations directory](https://ohdear.app/third-party-integrations).

[Read the API documentation](https://ohdear.app/docs/api/introduction)

Operational ownership

## Send the failing check to the person who can fix it.

When a check changes to warning or failed, Oh Dear sends a message to Slack, Teams, PagerDuty, Opsgenie, or your own webhook. It tells you again when the check recovers. You choose where the alerts for each monitor go.

Each check keeps its own history. In an incident review, you can see what changed and when.

[ Explore notifications and routing ](https://ohdear.app/features/notifications)

One format

## Any language can report its health.

Health monitoring reads one JSON format. Return it from Express, Django, Rails, Spring, ASP.NET, Go, or Rust. On Laravel, a package builds it for you.

### You decide what healthy means.

For example: the database answers, the queue has workers, and the disk has space. Your app runs those checks and returns the results. Oh Dear stores the history. It alerts you when a check fails.

Starting from scratch? The application health settings in Oh Dear have a ready-made prompt. Give it to your coding agent to build the endpoint. You still review and own the code.

[Explore application health monitoring](https://ohdear.app/features/application-health-monitoring)

> One of the most useful features for us is the application health monitoring, as we developed and used in all our projects an open source Java library to expose different health keys to Oh Dear.

Jonathan Lanoy, CEO at Zileo Zileo built an open source Java library on this JSON format.

No feature tiers

## Every check.
Every plan.

Health, cron, uptime, and the rest of Oh Dear are on every plan. You pay for the number of sites you monitor, not for which checks you need.

### Start with everything on.

---

- Every monitoring feature included
- The price depends on how many sites you monitor
- No credit card required

[Start a free trial](https://ohdear.app/register)

**10-day free trial.** No credit card.

## Questions developers ask first.

Does Oh Dear work with my language? Yes, if your app can serve HTTP. Return the health JSON, ping a URL when a cron job finishes, or use the API. Uptime, SSL, DNS, and broken link checks need no code at all.

Do you have an SDK for my language? Our official SDK is for PHP. For every other language, start with the [REST API](https://ohdear.app/docs/api/introduction). Its OpenAPI spec lets you generate a client. The health endpoint and the cron heartbeat need no SDK at all. Community SDKs for JavaScript and Python are listed in the [integrations directory](https://ohdear.app/third-party-integrations), with their current status.

What if my framework is not listed? Return `finishedAt` and `checkResults` as JSON from one endpoint, protected by a secret. If your app can serve that, Oh Dear can monitor it. The [health check results format](https://ohdear.app/docs/features/application-health-monitoring#health-check-results-format) has every field.

Does Oh Dear install an agent? No. Your app runs its own checks and shows the result on one endpoint. Oh Dear reads that endpoint from outside.

Can it monitor cron jobs and background workers? Yes. Your job pings a unique URL when it finishes. When the ping is missing or late, you get an alert. A ping proves the job finished on time. It doesn't prove the job did the right thing. See [scheduled task monitoring](https://ohdear.app/features/scheduled-task-monitoring).

How is this different from an APM tool? An APM tool traces requests inside one app. Oh Dear checks your sites from outside. It covers uptime, application health, scheduled tasks, SSL, DNS, broken links, and performance.

[ More answers in the full FAQ ](https://ohdear.app/docs/faq)

[ Technical detail **Read the application health docs** ](https://ohdear.app/docs/features/application-health-monitoring) [ Scheduled work **Scheduled task monitoring** ](https://ohdear.app/features/scheduled-task-monitoring)

Get started

## Bring every stack you run.

Add a site in under a minute. Every feature on. No credit card.
