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

推荐订阅源

B
Blog RSS Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
D
Docker
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Forbes - Security
Forbes - Security
MongoDB | Blog
MongoDB | Blog
Attack and Defense Labs
Attack and Defense Labs
Webroot Blog
Webroot Blog
A
About on SuperTechFans
Schneier on Security
Schneier on Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
IT之家
IT之家
The Last Watchdog
The Last Watchdog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
Project Zero
Project Zero
B
Blog
Recorded Future
Recorded Future
博客园_首页
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
SegmentFault 最新的问题
Security Archives - TechRepublic
Security Archives - TechRepublic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
T
Threatpost
H
Heimdal Security Blog
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
云风的 BLOG
云风的 BLOG
V
Visual Studio 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
How to monitor Apache web server with Datadog
2017-03-16 · via Datadog | The Monitor blog

This post is the last of a 3-part series about monitoring Apache performance. Part 1 provides an overview of the Apache web server and its key performance metrics, and part 2 describes how to collect and monitor Apache metrics using native and open source tools.

If you’ve read Part 2 of this series, you know that there are a variety of ways to collect metrics from your Apache web servers, both natively and using open source tools. Although these methods are useful for checking Apache metrics in real time, they do not readily reveal long-term trends and patterns, nor do they offer any context about the rest of your infrastructure and applications. Datadog allows you to zoom out to see long-term performance trends across your Apache servers, or to zoom in to see your real-time and historical metrics at full granularity. And with more than 1,000 integrations with popular infrastructure technologies, plus distributed tracing and APM, Datadog enables you to monitor Apache in context with the rest of your stack.

In this post, we’ll show you how to:

Apache default dashboard in Datadog

Set up Datadog’s Apache integration

1. Configure Apache to send metrics

In order to collect metrics from Apache, you need to enable the status module and make sure that ExtendedStatus is on, as outlined in Part 2.

2. Install the Datadog Agent

The Datadog Agent is open source software that collects metrics and events from your hosts and forwards them to Datadog so that you can visualize, analyze, and alert on performance data, all in one place. Installing the Agent usually just takes a single command; see instructions for various platforms here. If you prefer, you can also install the Agent using tools like Chef, Puppet, or Ansible.

3. Configure the Agent to collect Apache metrics

Once you’ve installed the Agent, you will need to create an Apache configuration file so that the Agent will know where to fetch your Apache metrics. The location of the Agent’s directory for integration-specific configuration files varies from platform to platform—consult the documentation for details.

In that directory, you should see an apache.d subdirectory, which contains conf.yaml.example, an example configuration file for Apache. Copy that file, save it as conf.yaml, and update it with the mod_status URL of your Apache instance (replacing “localhost” with the IP/hostname of your Apache instance, if you installed the Agent on a different host). The example below shows the configuration file for a user who is running Apache on the same host as the Agent.

init_config:

instances:

- apache_status_url: http://localhost/server-status?auto

# apache_user: example_user

# apache_password: example_password

# tags:

# - optional_tag

If your Apache instance is not being accessed by localhost, make sure to enable access to your Agent’s IP address in your Apache status module’s configuration file, and replace “localhost” in the URL with the IP of your Apache server. You also have the option to add a user and password if you configured one (see Part 2 for details on how to only allow authenticated users to access the mod_status page).

Save your changes and exit the file. Restart the Agent to load your new Apache configuration file.

4. Enable the Apache integration

To start seeing your Apache metrics in Datadog, navigate to the Integrations page of the Datadog App, and click on the Apache integration tile. In the Configuration tab, click on “Install Integration”. You should now be able to see your host reporting metrics in Datadog’s infrastructure list, as shown below:

Apache server in Datadog app

Customize your Apache dashboard

An Apache dashboard should now appear in your list of integration dashboards. This out-of-the-box dashboard displays most of the key metrics covered in Part 1 of this series, along with helpful pre-computed metrics that make it easier to understand real-time usage and performance. For example, the metrics apache.net.hits and apache.net.bytes are taken directly from mod_status and represent ever-increasing counters of the total number of requests and bytes that have been served over the lifetime of the server. The Datadog Agent provides these metrics, but also provides per-second rates (apache.net.request_per_s and apache.net.bytes_per_s), which are calculated by averaging the change in the number of requests and bytes served over each ~15–20 second collection period.

(Similarly, you should favor the real-time CPU metrics reported by the Datadog Agent over the CPU metrics collected from Apache’s mod_status page, which are aggregated over the lifetime of the server.)

You can clone this dashboard and customize it with system-level metrics that are not available from Apache’s status module, like memory usage and network traffic metrics, to add more context to your request throughput graphs. And because you can mix and match metrics from any source in Datadog, you can add metrics from databases, load balancers, or other services you are running alongside Apache, such as Tomcat or NGINX.

How to send Apache logs to Datadog

As mentioned in Part 1, certain metrics (including 5xx error rate and request processing time) are only available through Apache’s access logs. With Datadog log management, you can parse, filter, and analyze your Apache logs by using facets like HTTP response code and URL path, and monitor them alongside the mod_status metrics you’re already collecting.

Datadog’s Apache logging integration supports two log formats by default—common and combined—and processes the log variables in those log formats into facets that you can search, visualize, and monitor in Datadog. If you’re using a custom log format, skip ahead to see how you can set up Datadog to process your Apache logs.

Let’s take a closer look at the variables that appear in the combined log format:

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" combined

The combined log format includes the following variables:

  • remote hostname (%h)
  • remote logname (%l)
  • remote user (%u)
  • the time Apache received the request (%t)
  • the first line of the request in quotes (\"%r\")
  • the final HTTP status of the response (%>s)
  • the size of the response in bytes (%O)
  • the referer (\"%{Referer}i\")
  • the user agent (\"%{User-Agent}i\")

Each of these log variables will be processed as a log attribute in Datadog. Note that the first line of the request (\"%r\") will appear as two log attributes: the HTTP request method (e.g., GET) and the URL path requested (e.g., /index.html).

Enable the Agent to collect logs

Log collection is disabled by default in the Datadog Agent, but you can enable it by making a quick update to the Agent configuration file, datadog.yaml. The location of the file will vary according to your platform; see the documentation for details. You’ll need to uncomment the line that starts with logs_enabled and set it to true:

# Logs agent is disabled by default

logs_enabled: true

Update the Agent’s Apache configuration file

Now you’ll need to edit the Datadog Agent’s configuration file for the Apache integration (conf.d/apache.d/conf.yaml). Update the logs section to specify the correct path to your access log:

logs:

# - type : (mandatory) type of log input source (tcp / udp / file)

# port / path : (mandatory) Set port if type is tcp or udp. Set path if type is file

# service : (mandatory) name of the service owning the log

# source : (mandatory) attribute that defines which integration is sending the logs

# sourcecategory : (optional) Multiple value attribute. Can be used to refine the source attribute

# tags: (optional) add tags to each logs collected

- type: file

path: /var/log/apache2/access.log

service: apache_gob_test

source: apache

sourcecategory: http_web_access

This configuration will tag all of your Apache logs with the name of the service specified above (service:apache_gob_test), which will help you easily link logs to any request traces and application performance metrics from that same service. Save and exit the file, and restart the Agent by using the correct restart command for your platform, according to the documentation.

Inspect your Apache access logs in Datadog

If you navigate to your Datadog account, you should see your Apache logs in the Log Explorer view. In the sidebar, you can click to filter the logs by one or more facets, such as the host, service, or source you’re interested in viewing.

Datadog’s Apache integration includes a log processing pipeline that automatically parses Apache logs that adhere to either the combined or common log format. This means that it can parse and extract key information from the log message, which is useful for graphing and alerting. In the Web Access section of the sidebar, you can filter by one or more of these facets, such as URL path or HTTP status code.

In the example log entry below, you can see that Apache received a GET request for the URL path /contact, and that it returned a status code of 404. All of this information was automatically parsed from the log message.

Monitor Apache Datadog log 404 status code

As you are inspecting a log, you can navigate to other sources of monitoring data to get a better sense of what was happening. You can click on the host to view a dashboard of system-level metrics from the host that generated this log, or click on the service to view application performance metrics and request traces collected over the time period in question.

Similarly, you can easily pivot from any metric graph to view logs that help provide more context about the situation. For example, if you see a spike in any server’s rate of Apache requests, you can investigate by clicking the graph to view related logs collected from the server during that time period.

Monitor Apache Datadog navigate from metric graph to logs

And, because you have access to all of these sources of data in one place, you can create custom dashboards that provide deep visibility into the health and performance of your Apache web servers, whether that data comes from mod_status or the access logs.

Monitor Apache Datadog custom dashboard with metrics, apm, logs

Doing more with custom Apache logs

We’ve seen how Datadog’s Apache integration automatically parses useful information from your logs if they’re following the common or combined log format. However, if you’d like to use a custom log format, you can modify the pipeline so that the Agent can parse your logs for any data you want to be able to monitor and analyze in Datadog.

In this section, we will show you how to collect request processing time as a metric from your Apache logs, and analyze this data in Datadog.

Create a custom log format for your Apache access log

Apache provides many options that allow you to customize the type of data you would like to include in the access log. Consult the Apache documentation for a list of all of the variables that you can use.

For example, let’s say that you want to create a custom log format that is identical to the combined format, except that it also logs the amount of time that it took to process the request (%D):

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D" reqtime

Add this line to your Apache configuration file (apache2.conf). The last word should be whatever “nickname” you want to apply to your custom LogFormat (in this example, reqtime). You’ll need to use this nickname in the next step.

Apply your custom log format

To apply this custom log format, you’ll need to update your Virtual Host’s configuration file. Locate the line that starts with CustomLog /path/to/apache/access.log. The last word in the line specifies which LogFormat the access log should use, so you need to edit it to point to your newly created reqtime log format (along with the correct path to your Apache access log):

CustomLog /path/to/apache/access.log reqtime

Save and exit the file, and restart Apache so that the changes will take effect. Your Apache server should now start including the request processing time in each access log entry.

Clone and customize the Datadog Apache log processing pipeline

To create a new pipeline to parse your custom log format, locate the Apache integration pipeline on the Log Pipelines page of your Datadog account, and click “Clone.”

Monitor Apache Datadog: clone pipeline to add request time

If you inspect the Grok Parser step of the cloned Apache integration pipeline, you can see that it includes two parsing rules that are designed to extract Apache log variables as attributes from the common and combined log formats in Apache:

Monitor Apache Datadog: log parsing pipeline rules

In this example, we’ve added a new parsing rule, access.reqtime, which builds on the existing access.combined rule. The new rule will parse the variable that appears as an integer at the end of our custom log format (request processing time), and extract it as an attribute called request_time:

access.reqtime %{access.combined} %{integer:request_time}

After you save and enable the pipeline, Datadog will start processing your incoming Apache access logs correctly. This is just one example of how you might parse a custom log format for information you’d like to collect—consult the documentation for more details about parsing your logs.

Datadog can parse your custom Apache log formats for key information (such as request processing time), so you can visualize and alert on this data.
Monitor Apache Datadog: see new parsed request time
Datadog can parse your custom Apache log formats for key information (such as request processing time), so you can visualize and alert on this data.

Create a measure for the log variable

Now that Datadog is parsing the request processing time from your custom Apache log format, you can create a measure for this attribute, in order to use it like a metric in graphs and alerts. When you’re inspecting a log entry, you can create a measure for any numerical log attribute by clicking on it and selecting “Create measure for @<LOG_ATTRIBUTE_NAME>,” as shown below.

Monitor Apache Datadog: see new parsed request time

You can give the measure a descriptive name (e.g., “Apache Request Time”) and indicate the correct unit for the measure. In this case, since Apache measures the request processing time (%D) in microseconds, we’ve specified the unit accordingly.

Monitor Apache Datadog: add new measure for request processing time in microseconds

Now we should be able to visualize and alert on our log measure, Apache Request Time, just like any other metric in Datadog.

Visualizing your logs in Datadog

Once your logs are being parsed and processed in Datadog, you can explore and filter all of that log data to derive specific insights from real-time Apache server activity. To create custom views of your log data, you can filter and aggregate by facets like URL path, HTTP response code, and other key information from your access logs. For example, in the Log Explorer’s Analytics view, it’s easy to visualize which URL paths were associated with the slowest request processing times.

Monitor Apache Datadog: toplist of request processing time

Or you can visualize the same data in a timeseries graph if you’d prefer to analyze trends over a specific period of time. You may also wish to export this graph to a dashboard so that you can correlate it with other metrics across the rest of your infrastructure and applications.

Monitor Apache Datadog: toplist of request processing time

Now that you’re collecting metrics from Apache mod_status and your access logs, you can set up alerts to automatically detect issues that affect the health and performance of your Apache servers. In the next section, we will explore several types of alerts that can notify you about potential issues with your Apache servers.

Alerting on Apache issues

Alerts can help notify you when important issues occur on your Apache servers. In this section, we will walk through some examples of setting up Datadog to detect potential issues and notify you based on Apache metrics and logs.

Status check

The Apache integration includes a status check that can help you find out when one or more of your Apache servers is down—ideally before you hear about it from your users.

You can set up Datadog to automatically notify you if the Agent fails to connect to one or more of your Apache servers x consecutive times. Setting up an alert is easy; within the Datadog app, navigate to Monitors > New Monitor > Integration. After clicking on the Apache tile, navigate to the “Integration Status” tab.

Below, we set up the alert to notify us each time any particular Apache host fails the check two consecutive times. The alert will resolve on its own once the Agent is able to connect successfully.

Datadog alert to detect when Apache host fails

Threshold alert

You can also create alerts to get notified when metrics cross fixed or dynamic thresholds. If load testing has shown you that your servers’ performance starts to degrade when they process more than a certain number of requests per second, you can set an alert to find out when you’re nearing that threshold, as shown below.

Datadog alert to detect high number of Apache hits

If you get notified that this alert has triggered, you may need to scale up or out to handle the increased load, with some guidance from the Apache documentation’s performance tuning tips.

Log alert

If you set up Datadog to collect and process your Apache logs, you can create a log alert based on specific facets and measures, like HTTP status code or the Apache Request Time measure we created earlier. The example below shows how you can use the Service and Status Code facets to create an alert that notifies you if your Apache service returns a large number of 5xx HTTP responses.

Monitor Apache Datadog log alert to detect high 5xx error rate from Apache logs

Start the monitoring process

We’ve shown you a few of the ways you can use Datadog to collect, visualize, and alert on Apache metrics and logs. In just a few minutes you can start capturing Apache metrics and logs, building custom dashboards, and setting up alerts. Because Datadog also integrates with more than 1,000 other services and tools, you can quickly create a comprehensive view of your servers along with all the other components of your stack.

If you don’t yet have a Datadog account, start monitoring Apache today with a free trial.