惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

PCI Perspectives
PCI Perspectives
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
罗磊的独立博客
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
Recent Announcements
Recent Announcements
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
The GitHub Blog
The GitHub Blog
M
MIT News - Artificial intelligence
Scott Helme
Scott Helme
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
V
Visual Studio Blog
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AI
AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Security Affairs
S
SegmentFault 最新的问题
C
Cisco Blogs
博客园 - 聂微东
MyScale Blog
MyScale Blog
V
Vulnerabilities – Threatpost
量子位
T
The Exploit Database - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Latest
Security Latest
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis Monitor Aruba Central in Datadog How we centralize and remediate risks with Datadog Case Management Accelerate incident response with Datadog and ServiceNow Monitor your application and network load balancer logs Understanding Karpenter architecture for Kubernetes autoscaling Tools for collecting metrics and logs from Karpenter Monitor Karpenter with Datadog What your product data is actually saying Key metrics for monitoring Karpenter Securing Datadog’s platform in the AI age: The role of observability data Four ways engineering teams use the Datadog MCP Server to power AI agents Approaching your observability migration with the right mindset Meet the new Bits AI SRE: Deeper reasoning, twice as fast Key learnings from the 2026 State of DevSecOps study Use plain English to query your multi-cloud infrastructure in Resource Catalog Simplifying troubleshooting across the user journey with Datadog Synthetic Monitoring Protect your OCI resources with Datadog Cloud Security This Month in Datadog - February 2026 Amazon EC2 security: How misconfigured and public AMIs expand your cloud attack surface Enable end-to-end visibility into your Java apps with a single command Measure and improve mobile app startup performance with Datadog RUM Evaluating our AI Guard application to improve quality and control cost Identify untested code across every level of your codebase Make use of guardrail metrics and stop babysitting your releases Monitor Versa Networks SD-WAN performance in Datadog Improve performance and reliability with APM Recommendations Remediate transitive vulnerabilities faster with Datadog Software Composition Analysis Generate audit-ready vulnerability and compliance reports with Datadog Sheets Monitor Fortinet FortiManager performance in Datadog Improve test coverage across codebases with Datadog Code Coverage Move fast, don’t break things: Consistent testing standards at scale Enrich logs with ServiceNow CMDB context before routing to any SIEM or logging tool Monitor Lustre with Datadog Make faster, better product decisions with Datadog Product Analytics Surface and remediate runtime posture issues with Workload Protection Findings Protect agentic AI applications with Datadog AI Guard How to optimize JavaScript code with CSS Trace Google Pub/Sub workloads in Cloud Run with Datadog Detect human names in logs with ML in Sensitive Data Scanner How we cut our NLQ agent debugging time from hours to minutes with LLM Observability Debug PostgreSQL query latency faster with EXPLAIN ANALYZE in Datadog Database Monitoring Datadog acquires Propolis Unify and correlate frontend and backend data with retention filters Scale compliance across global frameworks with Datadog Cloud Security Monitor Arista VeloCloud SD-WAN performance with Datadog Building reliable dashboard agents with Datadog LLM Observability Simplify log collection and aggregation for MSSPs with Datadog Observability Pipelines Mitigation for Node.js denial-of-service vulnerability affecting Datadog APM Automate flaky test fixes with the Bits AI Dev Agent and Test Optimization How we built an AI SRE agent that investigates like a team of engineers Datadog integrations 2025 recap: Observability for AI, security, and hybrid cloud Design effective executive dashboards with Datadog Implement dbt data quality checks with dbt-expectations Bring faster visibility into AWS Lambda functions with remote instrumentation Troubleshoot faster with the GitLab Source Code integration in Datadog How Cambia Health Solutions saved $30,000 monthly with Cloud Cost Management and the Datadog Resource Catalog Normalize any logs for Cloud SIEM with Datadog's OCSF processor Optimizing Datadog at scale: Cost-efficient observability at Zendesk Detect, diagnose, and resolve network issues easily with CNM Network Health Connect engineering errors to user impact in early-stage products Cilium configuration for Kubernetes operations at scale Designing feedback loops for progressive delivery Ship features faster and safer with Datadog Feature Flags Choosing the right OpenTelemetry Collector distribution Route your monitor alerts with Datadog monitor notification rules Automate Cloud SIEM investigations with Bits AI Security Analyst Cloud threat detection: How to identify risky activity across control and data planes Collecting Kafka performance metrics Monitoring Kafka with Datadog Monitoring Kafka performance metrics
Collecting Amazon MQ metrics and logs
2019-11-04 · via Datadog | The Monitor blog
David M. Lentz

David M. Lentz

In Part 1 of this series, we saw how Amazon MQ routes messages between services in a distributed application, and we looked at some of the key metrics that describe the performance of the message broker and its destinations. Now that we’ve introduced the metrics and their meaning, we’ll look at some tools you can use to collect and query metrics from Amazon MQ:

Track Amazon MQ metrics with CloudWatch

Amazon CloudWatch is the built-in monitoring solution that you can use to collect metrics and logs from Amazon MQ and any other AWS services you’re using. If your messaging clients are running on EC2 instances, you can view their metrics in CloudWatch alongside metrics and logs from your Amazon MQ brokers and destinations. In this section, we’ll look at how you can monitor Amazon MQ using the CloudWatch console, the CloudWatch CLI, and the CloudWatch SDK. To access these services, you’ll need to have the appropriate permissions. Before proceeding, use AWS Identity and Access Management to apply the permissions necessary to access the CloudWatch console and API.

The CloudWatch console

The CloudWatch console is a web UI you can use to visualize metrics and analyze logs from AWS services, including your Amazon MQ brokers and destinations. In this section, we’ll show you how you can use the CloudWatch console to view Amazon MQ metrics and logs, and create alarms to notify you of potential issues with the performance of your brokers and destinations.

See your metrics

CloudWatch automatically collects metrics from your Amazon MQ deployment, including all of the broker and destination metrics we covered in Part 1 of this series. CloudWatch has a built-in dashboard that helps you visualize several Amazon MQ metrics:

The CloudWatch Amazon MQ dashboard displays CPU, connection, network, and activity metrics.

CloudWatch also makes it easy to create your own graphs and dashboards. To create a graph, first click the Metrics link on the CloudWatch console, then click the name of an AWS service (e.g., Amazon MQ) to see a list of metrics available for that service. You can also type a metric name into the search field.

On an empty CloudWatch graph, the All metrics tab is where you browse or search to select the AWS metrics you want to add to the graph.

CloudWatch displays three categories of Amazon MQ metrics: Queue Metrics by Broker, Topic Metrics by Broker, and Broker Metrics. (In Part 1 of this series, we placed queue metrics and topic metrics together as Destination metrics.) In the screenshot below, we’re graphing the HeapUsage metric from the TestBrokerA-1 broker.

A CloudWatch graph shows the HeapUsage metric for a test broker.

You can visualize metrics from different Amazon MQ categories and even different AWS services on a single graph to easily correlate data from different sources. In the screenshot below, a graph shows the HeapUsage metric from the TestBrokerA-1 broker, the MemoryUsage metric from that broker’s testqueue1 queue, and the CPUUtilization metrics from two EC2 instances that host producers that send messages to the broker.

A single CloudWatch graph shows combined Amazon MQ metrics: a broker's HeapUsage metric, a queue's MemoryUsage metric, and the CPUUtilization metrics from two EC2 instances.

After you’ve selected metrics to add to your graph, you can save the graph to a dashboard where you can combine it with other visualizations.

A CloudWatch dashboard displays three different graphs that show metrics from a broker, its destinations, and the EC2 instances running producer applications.

View Amazon MQ logs

You can also use CloudWatch to collect and analyze your Amazon MQ logs to get context around questions that arise as you view the metrics. For example, a graph that shows a drop in a destination’s EnqueueCount metric can draw your attention to a potential issue, but if you can correlate that spike with an Amazon MQ log, you’ll have further information to understand the problem.

You can use CloudFormation, the AWS CLI, or the Amazon MQ console to configure your broker to send logs to CloudWatch. (Once you’ve changed your broker’s configuration, you’ll need to reboot the broker to apply the change and start collecting logs.) You can collect Audit logs, which record changes made to your Amazon MQ service (for example via the API), and General logs, which describe events such as when a broker starts up or when producer flow control is activated.

To see your Amazon MQ logs in CloudWatch Logs, click the Logs link on the main page of the CloudWatch console. You’ll see a log group listed for each Amazon MQ broker that’s configured to send logs to CloudWatch; click the name of a log group to see that broker’s logs. The screenshot below shows the log stream that was automatically created when we launched an Amazon MQ broker.

A CloudWatch logs screenshot displays a log that Amazon MQ created when it started a broker.

Define alarms to stay informed

You can easily define alarms in CloudWatch to notify you automatically if the value of any of the Amazon MQ metrics you’re monitoring strays above or below a threshold you identify. You can also base your alarms on your log data by creating a log filter to extract your desired metrics.

The example below shows how you can create a CloudWatch alarm that will trigger if your broker’s TotalMessageCount metric—the number of messages across all of your destinations—breaches a specific upper threshold of 15,000. If the alarm triggers, it can indicate that your consumers are slow and your broker may run out of resources.

A screenshot of a CloudWatch alarms definition page shows how you can define an alert that will trigger when your broker's TotalMessageCount metric rises above 15,000.

You can configure CloudWatch to publish alarm notifications to an SNS topic so you’ll receive an email if the alarm is triggered. If your consumers are running on EC2 instances, you could also configure the same CloudWatch alarm to trigger an Auto Scaling action and automatically scale out your fleet.

Use CloudWatch from the command line

We’ve seen how the CloudWatch console allows you to create graphs, dashboards, and alarms to monitor Amazon MQ. But you may also need to add monitoring to your shell scripts or other automated processes. For this, you can use the AWS command-line interface (CLI) to programmatically query the CloudWatch API and retrieve Amazon MQ metrics. In this section, we’ll show some examples of how to use the AWS CLI to collect some of the metrics we introduced in Part 1 of this series.

To start using the AWS CLI, follow the installation steps provided for your platform in the documentation. Then use the aws configure command to provide your AWS account information and set your preferred region and output format.

Once you have installed and configured the CLI, you can issue commands to interact with the APIs of the different AWS services. In this section, we will use the aws cloudwatch command to query CloudWatch metrics. In the get-metric-statistics subcommand, include the following required arguments:

  • namespace: The AWS service from which to retrieve metrics. For Amazon MQ metrics, use AWS/AmazonMQ.
  • metric-name: We named some key metrics in Part 1 of this series. For a complete list of available broker and destination metrics, see the AWS documentation.
  • start-time: The date and time of the start of your requested metrics, specified in UTC format.
  • end-time: The date and time of the end of your requested metrics, specified in UTC format.
  • period: This is the length of time over which the metric will be aggregated, specified in seconds. For example, a query with a period value of 60 will aggregate and apply the designated statistic operation (see below) to all datapoints within each 60-second period. The period argument only allows certain values, depending on the time range and the resolution of the metrics being queried. See the documentation for guidance.
  • statistics or extended-statistics: One of these two arguments must be present in each query. You can use statistics to tell CloudWatch how to process the datapoints to return a single value (e.g., Average or Sum) for each period. Use extended-statistics to get CloudWatch to return percentile values like p50 or p99.

The CloudWatch API will return an error if your query results comprise more than 1,440 datapoints. You can avoid this error by adjusting your start-time, end-time, and period values to request a smaller batch of metrics. See the get-metric-statistics documentation for more information on refining your query.

The get-metric-statistics subcommand also accepts several optional arguments you can use to focus your query:

  • region: By default, your query will search within the AWS region you specified when you initially configured the CLI. (To review and update the defaults you’ve configured, type aws configure and enter new values as appropriate.) You can override this default by including the region argument in your query.
  • dimensions: Specify dimensions as key-value pairs in your query to limit the scope of the metrics returned. For collecting the key Amazon MQ metrics we identified in Part 1 of this series, your queries must specify values for the broker dimension and, in some cases, also the destination dimension.

Destination metrics, like MemoryUsage, ConsumerCount, and QueueSize, are scoped to individual destinations, and the values of these metrics on each destination are independent of other destinations. Other key metrics are broker metrics, like StorePercentUsage and TotalMessageCount, which describe resource usage across the broker regardless of the resource usage of any single destination.

The sample query below fetches the average QueueSize of the testqueue destination on the broker named MyBroker in the us-west-2 region:

aws cloudwatch get-metric-statistics --namespace "AWS/AmazonMQ" --metric-name QueueSize --statistics Average --start-time 2019-07-17T18:30:00Z --end-time 2019-07-17T19:00:00Z --period 600 --region us-west-2 --dimensions Name="Broker",Value="MyBroker" Name="Queue",Value="testqueue"

Because the query specifies a 10-minute granularity (period) and a 30-minute time span, it returns three records, each showing the average of all the QueueSize datapoints within the period:

{

"Label": "QueueSize",

"Datapoints": [

{

"Timestamp": "2019-07-17T18:40:00Z",

"Average": 20.0,

"Unit": "Count"

},

{

"Timestamp": "2019-07-17T18:50:00Z",

"Average": 20.0,

"Unit": "Count"

},

{

"Timestamp": "2019-07-17T18:30:00Z",

"Average": 20.0,

"Unit": "Count"

}

]

}

Call the CloudWatch API

You can also use the AWS SDKs to build a custom solution to programmatically collect Amazon MQ metrics and logs from CloudWatch. AWS supports many languages—including Node.js, Python, and Go—that you can use to build applications that access the CloudWatch API.

In this section, we’ve looked at different ways CloudWatch makes Amazon MQ metrics and logs available. For complete visibility into your messaging infrastructure, you should adopt a platform that regularly queries the CloudWatch API and allows you to view, analyze, and alert on your Amazon MQ metrics and logs. In Part 3 of this series, we’ll show you how you can use Datadog to get deep visibility into Amazon MQ.

Use the built-in ActiveMQ Web Console

The ActiveMQ Web Console is a web-based tool that gives you an easy way to view some of the metrics emitted by Amazon MQ, such as queue sizes and storage space in use. The Web Console is installed automatically when you create an Amazon MQ broker instance, but you need to create a user that has permission to access it. You can use CloudFormation, the AWS CLI, or the Amazon MQ console to configure a user to access the ActiveMQ Web Console.

The screenshot below illustrates using the Amazon MQ console to create a user with ActiveMQ Web Console access:

A screenshot shows the form you need to submit to create a user with access to the ActiveMQ Web Console.

Once your Amazon MQ broker is up and running, choose it from your list of brokers in the Amazon MQ console, then scroll down to the ActiveMQ Web Console section of the page and click the link. You’ll be directed to that broker’s ActiveMQ Web Console.

A screenshot shows the first page you see after logging in to the ActiveMQ Web Console, with a link to manage the ActiveMQ broker.

When you click the “Manage ActiveMQ broker” link, you’ll be prompted to log in as a user with console access permission, like the consoleuser we created in the example above.

The main page of the ActiveMQ Web Console displays information about the broker’s memory usage (MemoryPercentUsage), as well as disk space used for the persistent message store (StorePercentUsage) and for the temp store (TempPercentUsage).

A screenshot shows the main page of the ActiveMQ Web Console, which includes the broker's uptime, store percent used, memory percent used, and temp percent used metrics.
A screenshot shows the main page of the ActiveMQ Web Console, which includes the broker's uptime, store percent used, memory percent used, and temp percent used metrics.

Note that the TempPercentUsage metric is visible on the ActiveMQ Web Console (as Temp percent used, shown in the screenshot above), but isn’t available in CloudWatch. This means you can only see the amount of space your broker uses to store non-persistent messages if you log in to view it in the ActiveMQ Web Console.

You can use the top navigation bar to view pages that list data from your queues and topics. These pages show many (but not all) of the destination metrics we highlighted in Part 1 of this series. The screenshot below shows metrics from two queues, including the number of pending messages (QueueSize) and the number of consumers (ConsumerCount).

The queues page of the ActiveMQ Web Console shows the pending message count, consumer count, messages enqueued, and messages dequeued metrics.

The ActiveMQ console makes it easy to see the current value of some basic metrics from your broker and its destinations. It doesn’t allow you to graph metrics to visualize trends over time. You also can’t use it to create alerts to inform you of changes that could indicate a problem with your messaging infrastructure.

Monitor Amazon MQ logs and metrics alongside the rest of your stack

In Part 1 of this series, we explained some Amazon MQ metrics you should monitor to understand the resource usage and performance of your broker and destinations. In this post, we’ve given an overview of two tools you can use to monitor Amazon MQ.

CloudWatch is a full-featured service you can use to visualize and alert on Amazon MQ metrics and view Amazon MQ logs. The ActiveMQ Web Console is built in to each Amazon MQ broker you create, but only shows current values of a few metrics, and lacks features for creating graphs and alerts or collecting logs.

For complete visibility into your brokers, destinations, and clients, you need a monitoring platform that allows you to visualize and alert on metrics and logs from Amazon MQ, other AWS services, and the infrastructure that runs it all. In Part 3 of this series, we’ll show you how you can use Datadog to collect and analyze metrics and logs from your entire messaging infrastructure.

Source Markdown for this post is available on GitHub. Questions, corrections, additions, etc.? Please let us know.

Acknowledgments

We wish to thank Ram Dileepan and Rick Michaud at AWS for their technical review of this post.