Stackpath Monitoring allows you to observe your public-facing websites and services from a global perspective and collect metrics that can help you understand website performance and identify issues affecting end-users browsing your sites or using your services. Your Monitoring can also be configured to notify you of outages so that you can be proactive in maintaining service performance and availability.
In this guide, you will learn all of the high-level concepts and terminology relating to HTTP Monitoring and create your first HTTP monitor. Let's get started!
What is a Monitor?
A Monitor is responsible for observing one website or service. You provide a URL or IP address and every 5 minutes the Monitor will initiate a connection from each of the configured locations and collect metrics to help you understand the state of the monitored resource.
Monitors are highly configurable. We'll break down and define all of the Monitor configuration options available in the Monitor creation walkthrough later in this guide.
What is a Monitor Location?
Each individual Monitor can be configured with up to 37 geographic locations to monitor from. This allows you an overview of your site's reliability and accessibility from a global perspective, as well as the ability to identify issues specific to certain regions as metrics are collected on a per-location basis. You can configure as many or as few locations as you'd like on your monitor, allowing you to monitor globally or only in the regions relevant to your user base.
China is available as a Monitoring location, however, due to the 'Great Firewall of China' sites hosted outside of China may see slow response times or connection issues from this location. You may wish to exclude this location from your Monitor if availability in this region is not a concern.
You may need to whitelist our monitoring IP's to ensure that they can connect. You can find a full list of IP addresses here
What are Monitoring Metrics?
Each configured location will return metrics for your monitored website or service. These include;
- DNS Lookup Time
- TCP Connection Time
- TLS Handshake Time
- Server Processing Time
HTTP Monitors also capture the status code of the last check.
What are the Monitor States?
One of the collected metrics is the Monitor State. There are 3 states a Monitor can be in: "down", "slow", and "up". Here's what each state means:
A Monitor will be considered down if we are unable to connect to it, resolve the URL/IP address or if there is some other error.
Errors could be nameserver lookup failures, timeouts, or SSL certificate errors.
A retry is immediately attempted when a Monitor is found to be down to verify the state. Timeouts are capped at 20 seconds, regardless of what is entered in your portal.
A down status will not be recorded for error pages or HTTP status codes, e.g. a 500 internal server error will be considered "up" because the Monitor received a response from the monitored resource.
Slow is an extra state which helps with reporting and alerting when services are responding slower than you would expect.
A Monitor is considered slow if any response time is greater than 500ms.
A Monitor will be considered up if we receive any response, including error status codes, from a location. A 5xx error message will be considered up.
Creating a Monitor
Now that we've covered some important terminology, we can create our Monitor. First, navigate to the Monitoring section of the portal, which can be found in the menu on the left-hand side:
You'll be shown a list of your current Monitors. If you have already created a monitor it will be visible here.
Go ahead and click the "Create Monitor" button. You'll then be presented with a list of options, which will have slight differences based on whether you're creating an HTTP or TCP monitor. In this guide we are creating an HTTP GET Monitor for the StackPath website - https://stackpath.com. The type of Monitor you create is defined by the Protocol dropdown selection input. There are many options available on this page, so we will start by looking at the required configuration options, which are in the screenshot below.
Name: This is the vanity name for the monitor you will see on your Monitoring overview page. This can be set to any value, but we recommend using the website or service name for quick identification. We are using 'StackPath' as our name in this example.
Protocol: Defines the protocol used for the check. The options are HTTP or TCP. Since we're creating an HTTP monitor we will use HTTP.
URL: This is the URL that will be monitored. You can also choose between the HTTP and HTTPS protocols here with the dropdown. If you have TLS/SSL enabled we recommend monitoring your site via HTTPS. We are monitoring https://stackpath.com so we have selected the HTTPS protocol and entered stackpath.com into the text box.
Method: Defines the HTTP method that the monitor will use. Available options are GET and POST requests. If you're not familiar with HTTP Methods, you can find more information in our documentation. As we want to monitor GET requests we've used the default option of GET.
IP version: Defines the IP version used to connect to the monitored resource, IPv4 or IPv6. We're using IPv4 in our example, so we have not changed from the default option.
Locations: Decide the locations you wish to have the URL/IP monitored from. Each location chosen will send its own request to your chosen URL/IP and will have its own monitoring data available. You can find a full list of locations here. We've added all 37 locations in our example.
Frequency: Defines how often the check will occur. At present, the default and only option is 5 minutes.
Timeout: How long the monitor will attempt to make a connection with the monitored URL/IP. If the timeout is reached, the site is considered down for the location that reached the timeout. There's a hard cap of 20 seconds for timeouts, the default timeout is 10 seconds.
We've now completed the required configuration options, however, we can further configure our monitor with optional configuration. Let's continue to configure this check with the rest of the options available on this page.
Further customization of your Monitor is possible via these options. Let's take a look at each one and when they should be used.
Strict SSL Validation: Defines whether SSL should be validated. This includes ensuring that the connection is established via HTTPS and that certificate is valid. If a secure connection cannot be established the location will determine the monitored resource state as down. If this option is enabled, a 'CA Bundle' input will also appear, which allows you to add your own CA Bundle to be used for certificate verification which is useful for self-signed certificates. As we want to know if there are any SSL issues we have enabled this by checking the checkbox but we have not provided a CA Bundle as the StackPath.com certificate is not self-signed.
Authentication: If your monitored resource requires authentication via Basic Authentication or Digest Authentication you can enable that here by selecting your authentication type from the dropdown box, after which two more inputs will appear for your User and Password. We don't require any authentication for the StackPath website so we are using the default of 'None'.
Public Certificate: If your site uses certificate authentication you can add your public certificate here.
Private Key: If your site uses certificate authentication you can add your private key here.
Headers: Define any custom headers that you require to be sent when the monitor makes an HTTP/S request. You can define multiple headers here by clicking the '+' button, and remove any extra entries you don't require with the '-' button.
Request body content: Here you can define the data to be sent when the monitor makes an HTTP/S request. This typically can be left empty if you have previously selected the GET HTTP method. Users that are creating POST monitors that send a request body should enter the request body here.
Move on to Step 2
Now that you understand each option you can go ahead and create your monitor by clicking the 'Create Monitor' button. With your monitor set up, we can move on part 2 of the guide, where we'll cover Monitoring Metrics and Alerting.