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

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
Vercel News
Vercel News
G
Google Developers Blog
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
F
Fortinet All Blogs
博客园_首页
S
Secure Thoughts
GbyAI
GbyAI
S
Security Affairs
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Archives - TechRepublic
Security Archives - TechRepublic
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Heimdal Security Blog
A
About on SuperTechFans
P
Proofpoint News Feed
H
Help Net Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
L
LINUX DO - 最新话题
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
博客园 - 叶小钗
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
人人都是产品经理
人人都是产品经理
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
Security Latest
Security Latest
The Hacker News
The Hacker News
T
Tor Project blog
O
OpenAI News
博客园 - 三生石上(FineUI控件)
PCI Perspectives
PCI Perspectives
量子位
大猫的无限游戏
大猫的无限游戏
Stack Overflow Blog
Stack Overflow Blog

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
Monitor Redis using Datadog
2015-09-03 · via Datadog | The Monitor blog

Editor’s note: Redis uses the terms “master” and “slave” to describe its architecture and certain metrics. When possible, Datadog does not use these terms. Except when referring to specific metric names for clarity, we will replace these words with “primary” and “replica.”

To implement ongoing, meaningful monitoring, you will need a dedicated system that allows you to store, visualize, and correlate your Redis metrics with the rest of your infrastructure. You also need to be alerted when any system starts to misbehave. In this post, we will show you how to use Datadog to capture and report on the key metrics identified in Part 1. We’ll also discuss collecting and monitoring Redis logs and traces.

Integrating Datadog and Redis

Verify that Redis and redis-cli are working

Before you begin, run this command on your server to verify that Redis is running properly:

redis-cli info | grep uptime_in_seconds

If you are running the command from a different host or port, add arguments to the command as follows:

redis-cli -h <host> -p <port> info | grep uptime_in_seconds

Make sure the output displays “uptime_in_seconds” followed by an integer:

uptime_in_seconds: 162

Install the Datadog Agent

The Datadog Agent is open-source software that collects and reports metrics, traces, and logs from your different hosts so you can use that information within the Datadog platform. Installing the Agent usually requires just a single command. Installation instructions for different systems are available here.

As soon as the Datadog Agent is up and running, you should see your host reporting basic system metrics in your Datadog account.

Reporting host in Datadog

Configure the Agent

Next you will need to create a Redis configuration file for the Agent. You can find the location of the Agent’s configuration directory for integrations (conf.d) for your OS here. In that directory you will find a redisdb.d subdirectory containing a Redis configuration template named conf.yaml.example. Copy this file to conf.yaml. You can edit the file to customize your configuration if you are running Redis on a non-default port or have multiple Redis instances running, and you can include a list of tags that will be applied to every collected metric:

init_config:

instances:

- host: localhost

port: 6379

tags:

- instance:production

Save and close the file.

Restart the Agent

Restart the Agent to load your new configuration. The restart command varies somewhat by platform; see the specific commands for your platform here.

Verify the configuration settings

To check that Datadog and Redis are properly integrated, execute the Datadog status command. The command for each platform is available here.

If the configuration is correct, you will see a section like this in the status output:

Running Checks

======

[...]

redisdb

-------

Total Runs: 104

Metrics: 33, Total Metrics: 3432

Events: 0, Total Events: 0

Service Checks: 1, Total Service Checks: 104

The Service Checks in this snippet report the availability of your Redis instance. The Metrics and Events figures show that the Agent is reporting monitoring data to your Datadog account.

Turn on the integration

Finally, click the Redis Install Integration button inside your Datadog account. The button is located under the Configuration tab in the Redis integration settings.

Redis integration installation

Viewing Redis metrics in Datadog

Once the Agent begins reporting Redis metrics, you will see a Redis dashboard among your list of available dashboards in Datadog.

The default Redis dashboard displays the key metrics to watch highlighted in our introduction to Redis monitoring.

default Redis dashboard

You can easily create a more comprehensive dashboard to monitor your entire web stack by adding additional graphs and metrics from your other systems. For example, you might want to graph Redis metrics alongside metrics from your NGINX web servers, or alongside host-level metrics such as network traffic. To start building a custom dashboard, clone the default Redis dashboard by clicking on the gear on the upper right of the dashboard and selecting Clone Dashboard.

Clone Redis dashboard

Implementing APM for Redis

Datadog APM automatically aggregates statistics about your application’s request rate, latency, and errors, and generates detailed flame graphs that visualize the execution of individual requests. In this section, we’ll walk through how you can start tracing requests with APM, using a simple Python application that interacts with Redis as an example. Datadog APM supports several widely used languages, libraries, and frameworks, including the Python Redis library. We’ll see our example application automatically emit trace information, and we’ll manually instrument the Python code to collect custom traces.

Instrumenting your Redis client

This example application is built on the Redis Python client redis-py. The app is named “myapp.py” and communicates with a Redis server on the localhost (127.0.0.1).

# Adapted from http://webpy.org/docs/0.3/tutorial

import redis, random, web

urls = (

'/', 'index'

)

class index:

def GET(self):

client = redis.StrictRedis(host="127.0.0.1", port=6379)

client.set('randomnumber', random.randint(1,9999))

return str(client.get('randomnumber'))

if __name__ == "__main__":

app = web.application(urls, globals())

app.run()

You’ll need to install Datadog’s Python tracing client, ddtrace:

pip install ddtrace

Launch the example app:

DATADOG_ENV=redis_test ddtrace-run python myapp.py

The DATADOG_ENV parameter sets the environment value of this service to redis_test. We’ll use this below to make it easier to find the traces from this test app within Datadog. DATADOG_ENV is not required and has no default; you can omit this and your env value will be set to none.

Once you’ve issued this command, the app automatically begins sending trace data to the Datadog Agent.

See our documentation on tracing Python applications for sample code and more information.

Enabling APM

To configure the Agent to forward trace information, modify its configuration file to enable the apm_config option, shown here:

apm_config:

# Whether or not the APM Agent should run

enabled: true

(The location of the Agent’s configuration file varies depending on OS; see this page for information about configuring the Agent on your system and restarting it to apply your configuration changes.)

Viewing trace info in Datadog

You’ve configured the Datadog Agent to enable APM, and ddtrace is providing automatic tracing for your Redis client application. You can now see a redis item on the Service list in your Datadog account. (Make sure env:redis_test is selected on the drop-down list in the top-left corner.) Click to view your APM information on the Service page.

The Service page shows information about request latency and errors. Controls at the top of the page determine the time frame and environment shown. Each resource listed at the bottom links to a detailed resource page with further information.
Datadog Service page
The Service page shows information about request latency and errors. Controls at the top of the page determine the time frame and environment shown. Each resource listed at the bottom links to a detailed resource page with further information.

To collect tracing detail beyond what’s provided by auto-instrumentation, you can use ddtrace’s tracer class. As shown in the code below, tracer allows you to attach metadata to your trace (here, tags and a service name) and allows you to define a span of code to trace (via the wrap decorator).

# Adapted from http://webpy.org/docs/0.3/tutorial

import redis, random, web

urls = (

'/', 'index'

)

from ddtrace import tracer

class index:

tracer.set_tags({'team_name':'webapp_team'})

@tracer.wrap('my.wrapped.function', service='my.service')

def GET(self):

client = redis.StrictRedis(host="127.0.0.1", port=6379)

client.set('randomnumber', random.randint(1,9999))

return str(client.get('randomnumber'))

if __name__ == "__main__":

app = web.application(urls, globals())

app.run()

The tracer.wrap decorator in the example code names the service (my.service) and resource (my.wrapped.function) that will report APM data. On the Service list, click the Custom button to view a list of services with custom traces available. Click my.service to view high-level information about the app, including total requests and errors, and aggregate data about request latency. (For more information, see the Service page documentation.)

To view custom trace information about the function call, click my.wrapped.function in the Resource stats section at the bottom of the page.

The trace page visualizes the timeline of the request’s execution, and shows the service calls that comprise that request. In the image below, we can see that 69.7% of the request’s duration was spent executing Redis commands; moving the cursor over the timeline shows more detail about each of those calls and commands.

If the latency of a call is high, the trace page can help to determine where in the request the inefficiency is introduced.

The trace page shows the timing and metadata of the two separate spans that make up this request.
Tags info within tracing data
The trace page shows the timing and metadata of the two separate spans that make up this request.

Traces also provide metadata about each request. For example, note the team_name tag in this view, which was set in the call to the set_tags method.

You can learn more about the trace page in the Datadog documentation.

Capturing Redis Logs

Now that you’re collecting metrics and request traces, the next step is to start collecting logs from your Redis cache as well. To show how Datadog’s logging works, we’ll continue our discussion of myapp.py, an example web application written in Python that functions as a Redis client.

Enabling logging

Log collection is disabled in the Agent by default. Enable it by editing the Agent configuration file, uncommenting the relevant line:

# Logs agent is disabled by default

logs_enabled: true

Next, modify the configuration of the Redis integration. Edit redisdb.d/conf.yaml to configure the logs item as shown below:

logs:

- type: file

path: /var/log/redis/redis-server.log

source: redis

sourcecategory: database

service: my.service

The path to the Redis log file varies between distributions. To determine the proper path value for this configuration, query your Redis server with this command:

redis-cli config get logfile

Finally, restart the Agent as described in the Agent installation instructions specific to your OS.

For more information about configuring log collection in Datadog, see our log management documentation.

Viewing log info in Datadog

You can now see information from your Redis logs begin to appear on the Log Explorer page in your Datadog account.

The level of detail in your Redis logs is determined by the loglevel value specified in /etc/redis/redis.conf. You can view your current loglevel using this command:

redis-cli config get loglevel

To change your loglevel, edit the loglevel line in redis.conf (which is commented with descriptions of the available loglevel values). At all levels, your logs will show information about the server’s status (starting, stopping, ready to accept connections, plus important and critical notices). At the higher loglevels you will see log entries created when a Redis client establishes or relinquishes a connection to the server, and a current count of keys in the Redis data store.

To filter this view to display only your Redis logs, type service:my.service in the search field at the top of the page.

In the image below, the log entry shows that this Redis instance has no configured replicas, and currently has one client connected (a single instance of the myapp.py application). The integration pipeline automatically extracts key attributes from each log entry, including PID, role, and severity.

Viewing Redis log info in Datadog

For more information, see our docs on exploring, searching, and graphing logs.

Alerting on Redis metrics

Once Datadog is capturing and visualizing your metrics, you will likely want to set up some alerts to be automatically notified of potential issues.

Datadog can monitor individual hosts, containers, services, processes—or virtually any combination thereof. For instance, you can monitor all of your Redis hosts, or all hosts in a certain availability zone, or a single key metric being reported by all hosts corresponding to a specific tag. You can also build alerts around the performance of your service, as measured by Datadog APM, or around any data being captured in your Redis logs.

End-to-end Redis visibility

In this post we’ve walked you through integrating Redis with Datadog to visualize your key metrics, request traces, and logs, and to notify the right team whenever your infrastructure or application shows signs of trouble.

If you’ve followed along using your own Datadog account, you should now have improved visibility into what’s happening in your environment, as well as the ability to create automated alerts tailored to your infrastructure, your usage patterns, and the metrics that are most valuable to your organization.

If you don’t yet have a Datadog account, you can sign up for a free trial and start monitoring Redis right away.


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