> ## Documentation Index
> Fetch the complete documentation index at: https://otel.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Apache

> OpenTelemetry receiver for Apache

# Apache Receiver

![Status](https://img.shields.io/badge/status-beta-yellow)

**Available in:** `contrib`

**Maintainers:** [@colelaven](https://github.com/colelaven), [@ishleenk17](https://github.com/ishleenk17)

**Source:** [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/apachereceiver)

## Supported Telemetry

![Metrics](https://img.shields.io/badge/metrics-beta-green)

## Overview

## Prerequisites

This receiver supports Apache Web Server version 2.4.13+.

### mod\_status module

In order to receive server statistics, you must configure the server's `httpd.conf` file to [enable status support](https://httpd.apache.org/docs/2.4/mod/mod_status.html).

### Configuration

The following settings are required:

* `endpoint` (default: `http://localhost:8080/server-status?auto`): The URL of the httpd status endpoint

The following settings are optional:

* `collection_interval` (default = `10s`): This receiver collects metrics on an interval. This value must be a string readable by Golang's [time.ParseDuration](https://pkg.go.dev/time#ParseDuration). Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
* `initial_delay` (default = `1s`): defines how long this receiver waits before starting.

### Example Configuration

```yaml theme={null}
receivers:
  apache:
    endpoint: "http://localhost:8080/server-status?auto"
```

The full list of settings exposed for this receiver are documented in [config.go](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/apachereceiver/config.go) with detailed sample configurations in [testdata/config.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/apachereceiver/testdata/config.yaml).

## Metrics

Details about the metrics produced by this receiver can be found in [metadata.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/apachereceiver/metadata.yaml)

## Metric and Attribute Name Migration

The receiver's metric and attribute names are being migrated to a new, more
consistent naming scheme (tracked in
[#47327](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/47327)).
Because this component is in beta, the change is being rolled out gradually,
behind feature gates, so that existing dashboards, alerts, OTTL statements and
routing rules keep working while you migrate.

### Rollout

Two feature gates control the migration:

| Feature gate | Default | Effect when enabled |
| - | - | - |
| `receiver.apache.enableNewFormatMetrics` | disabled | Emit the new metric/attribute names. On its own, the new names are emitted **alongside** the original ones. |
| `receiver.apache.disableOldFormatMetrics` | disabled | Stop emitting the original metric/attribute names. Requires `receiver.apache.enableNewFormatMetrics` to also be enabled. |

This gives three phases you can move through at your own pace:

1. **Default (both gates disabled):** only the original names are emitted. A
   warning is logged at startup pointing to this guide.
2. **Transition (`enableNewFormatMetrics` only):** both the original and the new
   names are emitted at the same time, so you can update your dashboards, alerts,
   OTTL statements and routing to the new names without gaps.
3. **New only (both gates enabled):** only the new names are emitted.

Enable a gate with the `--feature-gates` flag, for example:

```shell theme={null}
otelcol --feature-gates=receiver.apache.enableNewFormatMetrics

otelcol --feature-gates=receiver.apache.enableNewFormatMetrics,receiver.apache.disableOldFormatMetrics
```

The gates start at `alpha` (disabled by default). Following the
[collector's stability guidelines](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md),
the new names will later become the default (`beta`), and eventually the old
names and gates will be removed (`stable`).

### What changed

Renamed metrics:

| Original name | New name |
| - | - |
| `apache.current_connections` | `apache.connection.active` |
| `apache.connections.async` | `apache.connection.status` |
| `apache.requests` | `apache.request.count` |
| `apache.scoreboard` | `apache.worker.status` |
| `apache.workers` | split into `apache.worker.active` (busy) and `apache.worker.idle` (idle) |

Renamed attributes:

| Metric | Original attribute | New attribute |
| - | - | - |
| `apache.connection.status` (was `apache.connections.async`) | `connection_state` | `apache.connection.state` |
| `apache.worker.status` (was `apache.scoreboard`) | `state` | `apache.worker.state` |
| `apache.cpu.time` | `level` | `apache.process.level` |
| `apache.cpu.time` | `mode` | `cpu.mode` |

> \[!NOTE]
> The `apache.cpu.time` metric keeps its name; only its `level` and `mode`
> attribute keys are renamed. The original `apache.workers` metric (busy/idle
> counts) is replaced by the separate `apache.worker.active` and
> `apache.worker.idle` metrics, which have no state attribute.

### What to update

Before enabling `receiver.apache.disableOldFormatMetrics`, review anything that
references the original names, including:

* Dashboards and visualizations.
* Alerting and recording rules.
* OTTL statements (e.g. in the `transform` or `filter` processors).
* Routing and pipeline configuration that matches on metric or attribute names.

## Metrics

| Metric Name | Description | Unit | Type | Attributes |
| - | - | - | - | - |
| ✅ `apache.connection.active` | The number of active connections currently attached to the HTTP server. | \{connection} | UpDownCounter | |
| ✅ `apache.connection.status` | The number of connections in different asynchronous states reported by Apache's server-status. | 1 | UpDownCounter | apache.connection.state |
| ✅ `apache.connections.async` | The number of connections in different asynchronous states reported by Apache's server-status. | \{connections} | Gauge | connection\_state |
| ✅ `apache.cpu.load` | Current load of the CPU. | % | Gauge | |
| ✅ `apache.cpu.time` | Jiffs used by processes of given category. | \{jiff} | Counter | cpu\_level, cpu\_mode |
| ✅ `apache.current_connections` | The number of active connections currently attached to the HTTP server. | \{connections} | UpDownCounter | |
| ✅ `apache.load.1` | The average server load during the last minute. | % | Gauge | |
| ✅ `apache.load.15` | The average server load during the last 15 minutes. | % | Gauge | |
| ✅ `apache.load.5` | The average server load during the last 5 minutes. | % | Gauge | |
| ✅ `apache.request.count` | The number of requests serviced by the HTTP server. | \{request} | Counter | |
| ❌ `apache.request.rate` | Average number of requests served per second since the server was started, as reported by mod\_status. | \{request}/s | Gauge | |
| ✅ `apache.request.time` | Total time spent on handling requests. | ms | Counter | |
| ✅ `apache.requests` | The number of requests serviced by the HTTP server per second. | \{requests} | Counter | |
| ✅ `apache.scoreboard` | The number of workers in each state. | \{workers} | UpDownCounter | scoreboard\_state |
| ✅ `apache.traffic` | Total HTTP server traffic. | By | Counter | |
| ❌ `apache.traffic.rate` | Average number of bytes transmitted per second since the server was started, as reported by mod\_status. | By/s | Gauge | |
| ✅ `apache.uptime` | The amount of time that the server has been running in seconds. | s | Counter | |
| ✅ `apache.worker.active` | The number of busy workers currently attached to the HTTP server. | \{worker} | UpDownCounter | |
| ✅ `apache.worker.idle` | The number of idle workers currently attached to the HTTP server. | \{worker} | UpDownCounter | |
| ✅ `apache.worker.limit` | The maximum number of worker slots configured for the HTTP server, derived from the scoreboard length. | \{worker} | UpDownCounter | |
| ✅ `apache.worker.status` | The number of workers in each state. | 1 | UpDownCounter | apache.worker.state |
| ✅ `apache.workers` | The number of workers currently attached to the HTTP server. | \{workers} | UpDownCounter | workers\_state |

## Attributes

| Attribute Name | Description | Type | Values |
| - | - | - | - |
| `apache.connection.state` | The asynchronous connection state reported by Apache's server-status. | string | `writing`, `keepalive`, `closing` |
| `apache.worker.state` | The state of a worker. | string | `open`, `waiting`, `starting`, `reading`, `sending`, `keepalive`, `dnslookup`, `closing`, `logging`, `finishing`, `idle_cleanup`, `unknown` |
| `connection_state` | The asynchronous connection state reported by Apache's server-status. | string | `writing`, `keepalive`, `closing` |
| `level` | Level of processes. | string | `self`, `children` |
| `mode` | Mode of processes. | string | `system`, `user` |
| `state` | The state of a connection. | string | `open`, `waiting`, `starting`, `reading`, `sending`, `keepalive`, `dnslookup`, `closing`, `logging`, `finishing`, `idle_cleanup`, `unknown` |
| `state` | The state of workers. | string | `busy`, `idle` |

## Resource Attributes

| Attribute Name | Description | Type | Enabled |
| - | - | - | - |
| `apache.server.name` | The name of the Apache HTTP server. | string | ✅ |
| `apache.server.port` | The port of the Apache HTTP server. | string | ✅ |

## Configuration

### Example Configuration

```yaml theme={null}
apache:
  endpoint: "http://localhost:8080/server-status?auto"
  collection_interval: 10s
```

***

*Last generated: 2026-10-05*
