Table: fastly_health_check - Query Fastly Health Checks using SQL
A Fastly Health Check is a service within Fastly that monitors the status of your services and servers. It provides a way to determine if your services are functioning correctly and if there are any issues that need to be addressed. Fastly Health Checks help you stay informed about the health and performance of your services and take appropriate actions when predefined conditions are met.
Table Usage Guide
The fastly_health_check
table provides insights into the health status of Fastly services. As an operations engineer, explore service-specific details through this table, including health check status, response timeout, and associated metadata. Utilize it to uncover information about the health and performance of your services, helping to identify potential issues and take appropriate actions.
Examples
Basic info
Explore the configuration of health checks in Fastly to understand the frequency of checks and their creation time. This is useful to assess the performance and reliability of your services.
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_check;
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_check;
List health checks created in the last 7 days
Explore recent health checks by identifying those created within the last week. This can be useful in maintaining system health and identifying any recent changes or issues.
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere created_at >= now() - interval '7 days';
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere created_at >= datetime('now', '-7 days');
List health checks that are not deleted
Uncover the details of active health checks within your Fastly services. This can help you manage and monitor the performance and health of your services, ensuring they are functioning optimally.
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere deleted_at is null;
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere deleted_at is null;
Show health check details for a particular host
Explore the health check details for a specific host to gain insights into its service ID, version, method, and other key information. This is useful for assessing the health and performance of a particular host within the Fastly service.
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere host = 'health.com';
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere host = 'health.com';
List health checks where threshold is less than 3
Determine the areas in which health checks have a threshold less than 3 to review the configuration for potential vulnerabilities or issues. This is useful for maintaining optimal system health and performance.
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere threshold < 3;
select name, service_id, service_version, method, host, path, check_interval, created_atfrom fastly_health_checkwhere threshold < 3;
List health checks where the service version is inactive
Determine the areas in which health checks are being conducted on inactive service versions, allowing for the identification of potential issues or areas of improvement in your Fastly services. This can be particularly useful in maintaining efficient service operations and ensuring all versions are properly monitored.
select name, c.service_id, service_version, method, host, path, check_interval, c.created_atfrom fastly_health_check as c, fastly_service_version as vwhere c.service_id = v.service_id and c.service_version = v.number and not v.active;
select name, c.service_id, service_version, method, host, path, check_interval, c.created_atfrom fastly_health_check as c, fastly_service_version as vwhere c.service_id = v.service_id and c.service_version = v.number and not v.active;
Schema for fastly_health_check
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
check_interval | bigint | How often to run the health check in milliseconds. | |
comment | text | A freeform descriptive note. | |
created_at | timestamp with time zone | Timestamp (UTC) of when the health check was created. | |
deleted_at | timestamp with time zone | Timestamp (UTC) of when the health check was deleted. | |
expected_response | bigint | The status code expected from the host. | |
headers | jsonb | A list of headers corresponding to this health check. | |
host | text | Which host to check. | |
http_version | text | Whether to use version 1.0 or 1.1 HTTP. | |
initial | bigint | When loading a config, the initial number of probes to be seen as OK. | |
method | text | Which HTTP method to use. | |
name | text | = | The name of the health check. |
path | text | The path to check. | |
service_id | text | =, !=, ~~, ~~*, !~~, !~~* | Alphanumeric string identifying the service. |
service_version | bigint | Integer identifying a service version. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
threshold | bigint | How many health checks must succeed to be considered healthy. | |
timeout | bigint | Timeout in milliseconds. | |
title | text | Title of the resource. | |
updated_at | timestamp with time zone | Timestamp (UTC) of when the health check was updated. | |
window | bigint | The number of most recent health check queries to keep for this health check. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- fastly
You can pass the configuration to the command with the --config
argument:
steampipe_export_fastly --config '<your_config>' fastly_health_check