1. Docs
  2. @pulumi/awsx
  3. classic
  4. sqs

Module classic/sqs

    APIs

    APIs

    namespace metrics

    function approximateAgeOfOldestMessage

    approximateAgeOfOldestMessage(change?: SqsMetricChange): Metric

    The approximate age of the oldest non-deleted message in the queue.

    Note: For dead-letter queues, the value of ApproximateAgeOfOldestMessage is the longest time that a message has been in the queue.

    Units: Seconds

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function approximateNumberOfMessagesDelayed

    approximateNumberOfMessagesDelayed(change?: SqsMetricChange): Metric

    The number of messages in the queue that are delayed and not available for reading immediately. This can happen when the queue is configured as a delay queue or when a message has been sent with a delay parameter.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function approximateNumberOfMessagesNotVisible

    approximateNumberOfMessagesNotVisible(change?: SqsMetricChange): Metric

    The number of messages that are in flight. Messages are considered to be in flight if they have been sent to a client but have not yet been deleted or have not yet reached the end of their visibility window.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function approximateNumberOfMessagesVisible

    approximateNumberOfMessagesVisible(change?: SqsMetricChange): Metric

    The number of messages available for retrieval from the queue.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function metric

    metric(metricName: SqsMetricName, change: SqsMetricChange): Metric

    Creates an AWS/SQS metric with the requested [metricName]. See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-monitoring-using-cloudwatch.html for list of all metric-names.

    Note, individual metrics can easily be obtained without supplying the name using the other [metricXXX] functions.

    Amazon SQS and Amazon CloudWatch are integrated so you can use CloudWatch to view and analyze metrics for your Amazon SQS queues. You can view and analyze your queues’ metrics from the Amazon SQS console, the CloudWatch console, using the AWS CLI, or using the CloudWatch API. You can also set CloudWatch alarms for Amazon SQS metrics.

    CloudWatch metrics for your Amazon SQS queues are automatically collected and pushed to CloudWatch every five minutes. These metrics are gathered on all queues that meet the CloudWatch guidelines for being active. CloudWatch considers a queue to be active for up to six hours if it contains any messages or if any action accesses it.

    The only dimension that Amazon SQS sends to CloudWatch is “QueueName”

    function numberOfEmptyReceives

    numberOfEmptyReceives(change?: SqsMetricChange): Metric

    The number of ReceiveMessage API calls that did not return a message.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function numberOfMessagesDeleted

    numberOfMessagesDeleted(change?: SqsMetricChange): Metric

    The number of messages deleted from the queue.

    Amazon SQS emits the NumberOfMessagesDeleted metric for every successful deletion operation that uses a valid receipt handle, including duplicate deletions. The following scenarios might cause the value of the NumberOfMessagesDeleted metric to be higher than expected:

    • Calling the DeleteMessage action on different receipt handles that belong to the same message: If the message is not processed before the visibility timeout expires, the message becomes available to other consumers that can process it and delete it again, increasing the value of the NumberOfMessagesDeleted metric.

    • Calling the DeleteMessage action on the same receipt handle: If the message is processed and deleted but you call the DeleteMessage action again using the same receipt handle, a success status is returned, increasing the value of the NumberOfMessagesDeleted metric.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function numberOfMessagesReceived

    numberOfMessagesReceived(change?: SqsMetricChange): Metric

    The number of messages returned by calls to the ReceiveMessage action.

    function numberOfMessagesSent

    numberOfMessagesSent(change?: SqsMetricChange): Metric

    The number of messages added to a queue.

    Units: Count

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    function sentMessageSize

    sentMessageSize(change?: SqsMetricChange): Metric

    The size of messages added to a queue.

    Units: Bytes

    Valid Statistics: Average, Minimum, Maximum, Sum, Data Samples (displays as Sample Count in the Amazon SQS console)

    interface SqsMetricChange

    interface SqsMetricChange extends MetricChange

    property color

    color?: pulumi.Input<string>;

    The six-digit HTML hex color code to be used for this metric.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property dimensions

    dimensions?: pulumi.Input<Record<string, pulumi.Input<string>>>;

    The new dimension for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be cleared.

    property extendedStatistic

    extendedStatistic?: pulumi.Input<number>;

    The new percentile statistic for the metric associated with the alarm. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property label

    label?: pulumi.Input<string>;

    The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property period

    period?: pulumi.Input<number>;

    The new period in seconds over which the specified stat is applied. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default (300s).

    property queue

    queue?: aws.sqs.Queue;

    Optional [Queue] to filter events down to.

    property statistic

    statistic?: pulumi.Input<MetricStatistic>;

    The new statistic to apply to the alarm’s associated metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property unit

    unit?: pulumi.Input<MetricUnit>;

    The new unit for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property visible

    visible?: pulumi.Input<boolean>;

    Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property yAxis

    yAxis?: pulumi.Input<"left" | "right">;

    Where on the graph to display the y-axis for this metric. The default is left.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    type SqsMetricName

    type SqsMetricName = "ApproximateAgeOfOldestMessage" | "ApproximateNumberOfMessagesDelayed" | "ApproximateNumberOfMessagesNotVisible" | "ApproximateNumberOfMessagesVisible" | "NumberOfEmptyReceives" | "NumberOfMessagesDeleted" | "NumberOfMessagesReceived" | "NumberOfMessagesSent" | "SentMessageSize";
      Pulumi AI - What cloud infrastructure would you like to build? Generate Program