Skip to content

aws.lightsail.get_bucket_metric_data

Example SQL Queries

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

Description

Returns the data points of a specific metric for an Amazon Lightsail bucket.

Metrics report the utilization of a bucket. View and collect metric data regularly to monitor the number of objects stored in a bucket (including object versions) and the storage space used by those objects.

Table Definition

Column NameColumn Data Type
bucket_name Required Input Column

The name of the bucket for which to get metric data.

VARCHAR
end_time Required Input Column

The timestamp indicating the latest data to be returned.

TIMESTAMP_S
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.

Bucket storage metrics are reported once per day. Therefore, you should specify a period of 86400 seconds, which is the number of seconds in a day.

BIGINT
start_time Required Input Column

The timestamp indicating the earliest data to be returned.

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 - The sum of all values submitted for the matching metric. 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 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.