Guide: Uptime Monitoring
Uptime Monitors check your public-facing services from our infrastructure at regular intervals to ensure they are available and responding correctly. If a check fails, 9n9s can notify you immediately.
Common Use Cases
Section titled “Common Use Cases”- Websites & Landing Pages: Ensure your marketing site is online and accessible to users.
- API Endpoints: Monitor the health of your critical REST or GraphQL API endpoints.
- Public Services: Check if a specific TCP port on a server is open and responsive (e.g., a database or SSH port that is publicly accessible).
Creating an Uptime Monitor
Section titled “Creating an Uptime Monitor”- From your project dashboard, click “Create Monitor”.
- Select “Uptime” as the monitor type.
- Fill out the configuration:
- Name: A descriptive name, e.g., “Main Website” or “API Health Check”.
- Protocol & Target: Choose from
HTTP(S)orTCP Port.- For
HTTP(S), enter the full URL to check (e.g.,https://my-api.com/health). - For
TCP Port, enter thehost:port(e.g.,my-db.example.com:5432).
- For
- Check Frequency: How often 9n9s should check your service (e.g., every 1 minute, 5 minutes). This may be limited by your account tier.
- Request Configuration (for HTTP): You can customize the
HTTP Method, addCustom Headers, and include aRequest BodyforPOSTorPUTrequests.
Defining Success with Assertions
Section titled “Defining Success with Assertions”An “up” service is more than just a 200 OK response. Assertions let you define what a successful check looks like. You can add multiple assertions.
1. Status Code Assertion
Section titled “1. Status Code Assertion”The most common assertion. You can specify a single code or a range.
- Expected Status Code:
200(for success) - Expected Status Code:
2xx(for any success code from 200-299) - Expected Status Code:
401(to ensure an endpoint is correctly protected)
2. Response Body Assertion
Section titled “2. Response Body Assertion”Check the content of the response body. This is useful to ensure your service is returning the correct data, not just a generic success page.
- Operator:
ContainsorDoes Not Contain - Value: A string or a regular expression to match against.
- Example: For a health check endpoint that returns
{"status": "ok"}, you could assert that the bodyContainsthe string"ok".
3. Response Time Assertion
Section titled “3. Response Time Assertion”Ensure your service is performant. 9n9s will fail the check if the response time exceeds this threshold.
- Max Response Time: e.g.,
500msor2s.
4. SSL/TLS Certificate Assertion (for HTTPS)
Section titled “4. SSL/TLS Certificate Assertion (for HTTPS)”For HTTPS targets, 9n9s automatically checks the validity of your SSL/TLS certificate. You can configure an assertion to be warned a number of days before it expires.
- Expires in more than:
14 days.
If any of these assertions fail, the check is considered “Down”, and 9n9s will trigger your configured alerts.