Skip to content

aws.lightsail.get_instance_metric_data

Example SQL Queries

SELECT * FROM
aws.lightsail.get_instance_metric_data
WHERE
"instance_name" = 'VALUE'
AND "metric_name" = 'VALUE'
AND "period" = 'VALUE'
AND "start_time" = 'VALUE'
AND "end_time" = 'VALUE'
AND "unit" = 'VALUE'
AND "statistics" = 'VALUE';

Description

Returns the data points for the specified Amazon Lightsail instance metric, given an instance name.

Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.

Table Definition

Column NameColumn Data Type
end_time Required Input Column

The end time of the time period.

TIMESTAMP_S
instance_name Required Input Column

The name of the instance for which you want to get metrics data.

VARCHAR
metric_name Required Input Column

The name of the metric returned.

VARCHAR
period Required Input Column

The granularity, in seconds, of the returned data points.

The StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System instance metric data is available in 1-minute (60 seconds) granularity. All other instance metric data is available in 5-minute (300 seconds) granularity.

BIGINT
start_time Required Input Column

The start time of the time period.

TIMESTAMP_S
statistics Required Input Column

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum/SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

VARCHAR[]
Show child fields
statistics[]
unit Required Input Column

The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units to specify with each available metric, see the metricName parameter.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
metric_data

An array of objects that describe the metric data returned.

STRUCT(
"average" DOUBLE,
"maximum" DOUBLE,
"minimum" DOUBLE,
"sample_count" DOUBLE,
"sum" DOUBLE,
"timestamp" TIMESTAMP_S,
"unit" VARCHAR
)[]
Show child fields
metric_data[]
Show child fields
metric_data[].average

The average.

metric_data[].maximum

The maximum.

metric_data[].minimum

The minimum.

metric_data[].sample_count

The sample count.

metric_data[].sum

The sum.

metric_data[].timestamp

The timestamp (1479816991.349).

metric_data[].unit

The unit.