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

推荐订阅源

B
Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Google DeepMind News
Google DeepMind News
S
Schneier on Security
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
Security Latest
Security Latest
Jina AI
Jina AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Recorded Future
Recorded Future
T
Tor Project blog
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
Forbes - Security
Forbes - Security
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
C
Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Google DeepMind News
Google DeepMind News
Project Zero
Project Zero
IT之家
IT之家
T
Threatpost
Cyberwarzone
Cyberwarzone
O
OpenAI News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
J
Java Code Geeks
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Latest news
Latest news
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research

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
Deploying and configuring Datadog with Chef roles
Mallory Mooney · 2018-05-15 · via Datadog | The Monitor blog

What is Chef?

Chef is a platform that automates configuration management for your infrastructure, supporting a continuous delivery workflow. As a configuration management tool, Chef monitors the state of resources across your infrastructure to ensure that each resource is in the desired state with every Chef run. For example, if you try to use Chef to add a user group that already exists on a particular host, Chef will recognize this, and move on without executing a change because the host is already in the desired state.

Chef uses policies to manage workflows and operational requirements. These policies apply the same set of configurations to machines based on their server type (e.g., web or database server) or where they fit in an organization’s development process (e.g., staging or production). In this post, we will show you how to use one of these policy types—Chef roles—to deploy the Datadog Agent and configure specific monitoring integrations, using Prometheus as an example.

How Chef works

Chef operates on three foundational elements: nodes, a workstation, and the Chef server. Nodes are any machines (e.g., Apache web servers) that make up your infrastructure and are managed by Chef. The workstation is simply the machine you use to create configurations for your infrastructure. The server acts as a hub for all your infrastructure’s configurations and communicates between your workstation and each node. The Chef server can run on the workstation or on a separate machine.

In the Chef model, you configure nodes through recipes: Ruby files that contain any element needed to set up a part of your system. A collection of recipes is called a cookbook. Cookbooks are similar to Ansible roles or Puppet modules in that they are packages that accomplish essential tasks such as configuring a web server. You can create a repeatable process for configuring nodes by assigning a role to them. Roles define what nodes should do along with how they should be configured via a run-list of recipes and associated configuration attributes.

Why use Chef with Datadog?

Chef enables you to implement infrastructure as code and efficiently manage all of the nodes across your infrastructure. You can take it a step further and implement monitoring as code by using the platform to automatically install and configure the Datadog Agent on the nodes you’re already managing with Chef. And with Datadog’s Chef integration, you get real-time visibility into what is happening with your Chef resources, run-time performance, and execution failures. You can actively monitor the health of your Chef server in conjunction with the systems it’s managing, and be notified of any performance problems or anomalies.

Deploying the Datadog Agent with Chef roles

To follow the deployment and configuration steps outlined below, you will need a running Chef server, a workstation with the Chef development kit installed, and a bootstrapped node. If you haven’t installed Chef yet, you can refer to these tutorials to get each piece set up. Note that you will need the name of your bootstrapped node later.

Datadog provides a cookbook that includes a dd-agent recipe for installing the Agent, along with a few other elements to set up common integrations. To install the Datadog cookbook and manage dependencies you can use a Berksfile, much like a Gemfile for Ruby. Navigate to the Chef repository (typically chef-repo) on your workstation, add cookbook 'datadog', '~> 2.15.0' to your Berksfile, then install the cookbook on your workstation with the command:

Every time you create or edit cookbooks, you will need to upload them to the Chef server so it can distribute them to appropriate nodes:

Next, you’ll need to create a role that will run recipes from the Datadog cookbook. Create a new file at /chef-repo/roles/ and name it deploy_dd_agent.rb. (You may have to create the roles directory if it doesn’t already exist.) Include the following in your new file:

name 'deploy_dd_agent'

description 'Role that deploys Datadog components to servers'

default_attributes(

'datadog' => {

'api_key' => '<YOUR_API_KEY>',

'application_key' => '<YOUR_APP_KEY>',

'agent6' => true,

}

)

run_list %w(

recipe[datadog::dd-agent]

)

Note that you need to substitute the API and application keys with keys from your Datadog account. For added security, consider using chef-vault to manage your keys so they will not be stored as cleartext on the Chef server. The role you created includes the Datadog cookbook recipe to install the Agent as part of its run_list and applies the default_attributes as configuration details needed for the Agent to run on the node.

Save the file and execute this command on your workstation:

knife role from file roles/deploy_dd_agent.rb

This uploads the role to the Chef server, but you still need to assign the role to your bootstrapped node. You can do this by updating the node’s run_list with:

knife node run_list add <BOOTSTRAPPED_NODE_NAME> 'role[deploy_dd_agent]'

Using Chef roles makes scaling your systems more efficient, as Chef can easily deploy the same role to multiple nodes within your infrastructure. This saves you from having to manually install the Agent on each node. By default, the Chef client runs every 30 minutes on managed nodes to apply any recent configuration changes. This will pick up the new role and install the Datadog Agent on the node. You can also SSH into the bootstrapped node and run the command manually:

Install Datadog Agent

Going further: Configuring the Agent + Prometheus with Chef

Using Chef to install the Datadog Agent on a node is the first step toward monitoring your infrastructure, as the Agent collects system-level metrics for your nodes by default. But for collecting metrics from a specific integration, you need a recipe and an associated template for your Chef role. The Datadog cookbook already includes recipes and templates for common integrations such as Apache, MySQL, and Docker. You can apply the same method for setting up these integrations as you did with installing the Agent by including their recipes and configuration details in your role’s run-list and attributes. You can also configure Datadog for additional integrations by creating your own recipes and templates, as we’ll demonstrate below.

Datadog supports collecting and monitoring metrics that are formatted for Prometheus, an open source monitoring system. Prometheus uses a text-based exposition format to collect timeseries metric data and is a popular monitoring tool for Kubernetes. If some of your existing applications are configured to emit Prometheus metrics, you can use Chef recipes to automatically configure the Agent to start collecting that data. In the chef-repo/cookbooks/datadog/templates/ folder, create a new file called prometheus.yaml.erb:

instances:

<% @instances.each do |i| -%>

- prometheus_url: <%= i['prometheus_url'] %>

<% if i['namespace'] -%>namespace: <%= i['namespace'] %><% end -%>

<% if i.key?('metrics') -%>

metrics:

<% i['metrics'].each do |m| -%>

- <%= m %>

<% end -%>

<% end -%>

<% end -%>

The template generates the static text required for the Agent’s configuration files based on your role’s attributes. Save the template and create a new prometheus.rb recipe in the chef-repo/cookbooks/datadog/recipes/ folder:

# Cookbook:: datadog

# Recipe:: prometheus

# Integrate Prometheus metrics into Datadog

datadog_monitor 'prometheus' do

instances node['datadog']['prometheus']['instances']

end

This recipe uses the template to create a new prometheus.yaml file in your node’s /etc/datadog-agent/conf.d/ directory. That YAML file provides the Datadog Agent with the configuration details it needs to gather metrics from your Prometheus endpoints. Save the file, and update your role’s default_attributes and run_list to include the Agent’s necessary configurations related to Prometheus:

name 'deploy_dd_agent'

description 'Role that installs and configures the Datadog Agent for Prometheus'

default_attributes(

'datadog' => {

'api_key' => '<YOUR_API_KEY>',

'application_key' => '<YOUR_APP_KEY>',

'agent6' => true,

'prometheus' => {

'instances' => [

{ 'prometheus_url' => 'http://localhost:9090/metrics',

'namespace' => 'web-app',

'metrics' => ['http_requests_*', ‘process_cpu_seconds_total’, ‘go_threads’]

}

]

}

}

)

run_list %w(

recipe[datadog::dd-agent]

recipe[datadog::prometheus]

)

This example specifies three parameters needed to set up Datadog’s Prometheus integration:

  • a Prometheus URL endpoint where the Datadog Agent can retrieve metrics

  • a namespace that serves as a prefix for your metrics

  • a list of metrics to collect

Each Prometheus metric will show as web-app.metric_name in Datadog with this example configuration. For more advanced customization, check out this example configuration file to see a complete list of options available for setting up Datadog’s Prometheus integration. Finally, re-upload both the role and cookbook to the Chef server from your workstation so your node can pick up the latest additions:

knife role from file roles/deploy_dd_agent.rb

berks upload

SSH back into your bootstrapped node and execute the chef-client command again. You should see both the dd-agent and prometheus recipes run. The latter recipe creates a new YAML configuration file and automatically restarts the Agent so it can begin collecting your custom Prometheus metrics and forwarding them to Datadog.

Add Prometheus Integration

Now that the Agent is installed and configured on the new node, you can begin monitoring your Prometheus metrics with Datadog dashboards and alerts, as well as all the detailed, system-level metrics from the node itself. And, of course, you can continually add new recipes and configurations to your Datadog role to ensure that your monitoring automatically covers all the components in your infrastructure.

For more comprehensive monitoring, the Datadog cookbook includes a dd-handler recipe that installs a Chef Report Handler. The handler reports metrics from Chef runs to Datadog’s event stream and includes information about failed executions and run-time performance for the Chef server. This gives you a high-level view into how Chef is performing each time it runs on a managed node.

Datadog Chef Integration Dashboard

Doing more with Datadog + Chef

With Datadog and Chef, you have a repeatable process for managing and monitoring your infrastructure. You can configure Chef to automatically install the Agent and set up integrations for services across your environment, so you never have infrastructure blind spots or gaps in coverage. Datadog provides a collection of recipes for popular integrations to help you get started, and makes it easy to create additional configurations to automatically monitor any of the other 1,000+ integrations that Datadog offers.

If you haven’t already, sign up for a free trial and start monitoring the servers in your infrastructure with Datadog and Chef today.