Skip to main content

monitors

Creates, updates, deletes, gets or lists a monitors resource.

Overview

Namemonitors
TypeResource
Idaws.internetmonitor.monitors

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The time when the monitor was created.
health_events_configobjectA complex type with the configuration information that determines the threshold and other conditions for when Internet Monitor creates a health event for an overall performance or availability issue, across an application's geographies. Defines the percentages, for overall performance scores and availability scores for an application, that are the thresholds for when Amazon CloudWatch Internet Monitor creates a health event. You can override the defaults to set a custom threshold for overall performance or availability scores, or both. You can also set thresholds for local health scores,, where Internet Monitor creates a health event when scores cross a threshold for one or more city-networks, in addition to creating an event when an overall score crosses a threshold. If you don't set a health event threshold, the default value is 95%. For local thresholds, you also set a minimum percentage of overall traffic that is impacted by an issue before Internet Monitor creates an event. In addition, you can disable local thresholds, for performance scores, availability scores, or both. For more information, see Change health event thresholds in the Internet Monitor section of the CloudWatch User Guide.
internet_measurements_log_deliveryobjectPublish internet measurements to an Amazon S3 bucket in addition to CloudWatch Logs.
max_city_networks_to_monitorintegerThe maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. This limit can help control billing costs. To learn more, see Choosing a city-network maximum value in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
modified_atstring (date-time)The last time that the monitor was modified.
monitor_arnstringThe Amazon Resource Name (ARN) of the monitor. (pattern: <code>arn:.*</code>)
monitor_namestringThe name of the monitor. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
processing_statusstringThe health of the data processing for the monitor. (OK, INACTIVE, COLLECTING_DATA, INSUFFICIENT_DATA, FAULT_SERVICE, FAULT_ACCESS_CLOUDWATCH)
processing_status_infostringAdditional information about the health of the data processing for the monitor.
resourcesarrayThe resources monitored by the monitor. Resources are listed by their Amazon Resource Names (ARNs).
statusstringThe status of the monitor. (PENDING, ACTIVE, INACTIVE, ERROR)
tagsobjectThe tags that have been added to monitor.
traffic_percentage_to_monitorintegerThe percentage of the internet-facing traffic for your application to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set. To learn more, see Choosing an application traffic percentage to monitor in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_monitorselectmonitor_name, regionLinkedAccountIdGets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.
list_monitorsselectregionNextToken, MaxResults, MonitorStatus, IncludeLinkedAccountsLists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.
create_monitorinsertregion, MonitorNameCreates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: VPCs, Network Load Balancers (NLBs), Amazon CloudFront distributions, and Amazon WorkSpaces directories. Internet Monitor then publishes internet measurements from Amazon Web Services that are specific to the city-networks. That is, the locations and ASNs (typically internet service providers or ISPs), where clients access your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide. When you create a monitor, you choose the percentage of traffic that you want to monitor. You can also set a maximum limit for the number of city-networks where client traffic is monitored, that caps the total traffic that Internet Monitor monitors. A city-network maximum is the limit of city-networks, but you only pay for the number of city-networks that are actually monitored. You can update your monitor at any time to change the percentage of traffic to monitor or the city-networks maximum. For more information, see Choosing a city-network maximum value in the Amazon CloudWatch User Guide.
update_monitorupdatemonitor_name, regionUpdates a monitor. You can update a monitor to change the percentage of traffic to monitor or the maximum number of city-networks (locations and ASNs), to add or remove resources, or to change the status of the monitor. Note that you can't change the name of a monitor. The city-network maximum that you choose is the limit, but you only pay for the number of city-networks that are actually monitored. For more information, see Choosing a city-network maximum value in the Amazon CloudWatch User Guide.
delete_monitordeletemonitor_name, regionDeletes a monitor in Amazon CloudWatch Internet Monitor.
start_queryexecmonitor_name, region, StartTime, EndTime, QueryTypeStart a query to return data for a specific query type for the Amazon CloudWatch Internet Monitor query interface. Specify a time period for the data that you want returned by using StartTime and EndTime. You filter the query results to return by providing parameters that you specify with FilterParameters. For more information about using the query interface, including examples, see Using the Amazon CloudWatch Internet Monitor query interface in the Amazon CloudWatch Internet Monitor User Guide.
stop_queryexecmonitor_name, query_id, regionStop a query that is progress for a specific monitor.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
monitor_namestringThe name of the monitor.
query_idstringThe ID of the query that you want to stop. A QueryId is an internally-generated identifier for a specific query.
regionstringAWS region (default: us-east-1)
IncludeLinkedAccountsbooleanA boolean option that you can set to TRUE to include monitors for linked accounts in a list of monitors, when you've set up cross-account sharing in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see Internet Monitor cross-account observability in the Amazon CloudWatch Internet Monitor User Guide.
LinkedAccountIdstringThe account ID for an account that you've set up cross-account sharing for in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see Internet Monitor cross-account observability in the Amazon CloudWatch Internet Monitor User Guide.
MaxResultsintegerThe number of monitor objects that you want to return with this call.
MonitorStatusstringThe status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself. For information about the statuses for a monitor, see Monitor.
NextTokenstringThe token for the next set of results. You receive this token from a previous call.

SELECT examples

Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.

SELECT
created_at,
health_events_config,
internet_measurements_log_delivery,
max_city_networks_to_monitor,
modified_at,
monitor_arn,
monitor_name,
processing_status,
processing_status_info,
resources,
status,
tags,
traffic_percentage_to_monitor
FROM aws.internetmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' -- required
AND region = '{{ region }}' -- required
AND LinkedAccountId = '{{ LinkedAccountId }}'
;

INSERT examples

Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: VPCs, Network Load Balancers (NLBs), Amazon CloudFront distributions, and Amazon WorkSpaces directories. Internet Monitor then publishes internet measurements from Amazon Web Services that are specific to the city-networks. That is, the locations and ASNs (typically internet service providers or ISPs), where clients access your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide. When you create a monitor, you choose the percentage of traffic that you want to monitor. You can also set a maximum limit for the number of city-networks where client traffic is monitored, that caps the total traffic that Internet Monitor monitors. A city-network maximum is the limit of city-networks, but you only pay for the number of city-networks that are actually monitored. You can update your monitor at any time to change the percentage of traffic to monitor or the city-networks maximum. For more information, see Choosing a city-network maximum value in the Amazon CloudWatch User Guide.

INSERT INTO aws.internetmonitor.monitors (
MonitorName,
Resources,
ClientToken,
Tags,
MaxCityNetworksToMonitor,
InternetMeasurementsLogDelivery,
TrafficPercentageToMonitor,
HealthEventsConfig,
region
)
SELECT
'{{ MonitorName }}' /* required */,
'{{ Resources }}',
'{{ ClientToken }}',
'{{ Tags }}',
{{ MaxCityNetworksToMonitor }},
'{{ InternetMeasurementsLogDelivery }}',
{{ TrafficPercentageToMonitor }},
'{{ HealthEventsConfig }}',
'{{ region }}'
RETURNING
arn,
status
;

UPDATE examples

Updates a monitor. You can update a monitor to change the percentage of traffic to monitor or the maximum number of city-networks (locations and ASNs), to add or remove resources, or to change the status of the monitor. Note that you can't change the name of a monitor. The city-network maximum that you choose is the limit, but you only pay for the number of city-networks that are actually monitored. For more information, see Choosing a city-network maximum value in the Amazon CloudWatch User Guide.

UPDATE aws.internetmonitor.monitors
SET
ResourcesToAdd = '{{ ResourcesToAdd }}',
ResourcesToRemove = '{{ ResourcesToRemove }}',
Status = '{{ Status }}',
ClientToken = '{{ ClientToken }}',
MaxCityNetworksToMonitor = {{ MaxCityNetworksToMonitor }},
InternetMeasurementsLogDelivery = '{{ InternetMeasurementsLogDelivery }}',
TrafficPercentageToMonitor = {{ TrafficPercentageToMonitor }},
HealthEventsConfig = '{{ HealthEventsConfig }}'
WHERE
monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
RETURNING
monitor_arn,
status;

DELETE examples

Deletes a monitor in Amazon CloudWatch Internet Monitor.

DELETE FROM aws.internetmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Start a query to return data for a specific query type for the Amazon CloudWatch Internet Monitor query interface. Specify a time period for the data that you want returned by using StartTime and EndTime. You filter the query results to return by providing parameters that you specify with FilterParameters. For more information about using the query interface, including examples, see Using the Amazon CloudWatch Internet Monitor query interface in the Amazon CloudWatch Internet Monitor User Guide.

EXEC aws.internetmonitor.monitors.start_query
@monitor_name='{{ monitor_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"StartTime": "{{ StartTime }}",
"EndTime": "{{ EndTime }}",
"QueryType": "{{ QueryType }}",
"FilterParameters": "{{ FilterParameters }}",
"LinkedAccountId": "{{ LinkedAccountId }}"
}'
;