Skip to content

AWS SQS(Simple Queue Service)

The displayed Metrics for AWS Simple Queue Service (SQS) include the approximate age of the oldest undeleted message in the queue, the number of delayed messages that cannot be read immediately, the number of messages in flight, the number of messages available for retrieval from the queue, etc.

Configuration

Permissions

For AWS cloud collection permissions, see AWS cloud integration role authorization. The read-only permissions required by this integration are listed below.

  • sqs:ListQueues: Get queue list.
  • sqs:GetQueueAttributes: Get SQS queue ARN.
  • tag:GetResources: Read resource tags through the shared tag collection module to supplement asset tags.
  • cloudwatch:ListMetrics: Discover CloudWatch monitoring metrics and dimensions.
  • cloudwatch:GetMetricData: Read in batches: CloudWatch monitoring metric data.

Install Func

We recommend enabling hosted Func under Integration - Extensions in Guance. All prerequisites are installed automatically; continue with the script installation.

If deploying Func manually, refer to Manual Deployment of Func

Install Script

Prepare AWS AK in advance and authorize access as described in Permissions.

Activate Scripts in Hosted Func

  1. Log in to the Guance console
  2. Click the 【Integration】 menu and select 【Cloud Account Management】
  3. Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
  4. Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
  5. Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
  6. Click 【Integration】 on the cloud account details page, find AWS SQS(Simple Queue Service) in the Not Installed list and click 【Install】 to open the installation form.

Manual Activation Script

  1. Log in to the Func console, click 【Script Market】, open the Guance script market and search for integration_aws_sqs.

  2. Click 【Install】, then enter the corresponding parameters: AWS AK ID, AK Secret, and account name.

  3. Click 【Deploy Startup Script】 to create the Startup script set and configure the corresponding startup scripts automatically.

  4. After enabling the script, open 【Management / Automatic Trigger Configuration】 to view its automatic trigger configuration. Click 【Execute】 to run it immediately without waiting for the scheduled time. After a short wait, review the task records and logs.

Verification

  1. Under 【Management / Automatic Trigger Configuration】, confirm that the task has an automatic trigger configuration. Review its task records and logs for errors.
  2. In Guance, check [Infrastructure / Custom] for asset information.
  3. In Guance, check 【Metrics】 for the corresponding monitoring data.

Metrics

After configuring Amazon CloudWatch, the default Measurement is as follows. More Metrics can be collected through configuration:

AWS SQS(Simple Queue Service) metric details

Metric Name Description Unit Valid Statistics
ApproximateAgeOfOldestMessage The approximate age of the oldest undeleted message in the queue. Note: When a message is received three times (or more) and not processed, it will be moved to the back of the queue, and the ApproximateAgeOfOldestMessage metric will indicate the age of the second oldest message that has not been received more than three times. This operation occurs even if the queue has a redrive policy. Since a single poison pill message (received multiple times but never deleted) can distort this metric, the age of the poison pill message will not be included in the metric until the poison pill message is successfully used. If the queue has a redrive policy, when the configured maximum number of receives is reached, the message will be moved to the dead-letter queue. When a message is moved to the dead-letter queue, the ApproximateAgeOfOldestMessage metric of the dead-letter queue indicates the time the message was moved to the dead-letter queue (not the original time the message was sent). Reporting Standard: If the queue is active, a non-negative value is reported. Seconds Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
ApproximateNumberOfMessagesDelayed The number of messages in the queue that are delayed and cannot be read immediately. This occurs if the queue is configured as a delay queue or if the delay parameter is used to send messages. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
ApproximateNumberOfMessagesNotVisible The number of messages in flight. If a message has been sent to a client but has not been deleted or has not reached the end of its visibility window, it is considered in flight. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
ApproximateNumberOfMessagesVisible The number of messages available for retrieval from the queue. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
NumberOfEmptyReceives The number of ReceiveMessage API calls that did not return any messages. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
NumberOfMessagesDeleted The number of messages deleted from the queue. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
NumberOfMessagesReceived The number of messages returned by the ReceiveMessage operation. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
NumberOfMessagesSent The number of messages added to the queue. Reporting Standard: If the queue is active, a non-negative value is reported. Count Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)
SentMessageSize The size of messages added to the queue. Reporting Standard: If the queue is active, a non-negative value is reported. Bytes Average, Minimum, Maximum, Sum, Sample Count (displayed as Sample Count in the Amazon SQS console)

Feedback

Is this page helpful?