The OpenTelemetry Collector provides an integration with Apache to ingest metrics. The Collector fetches metrics from the configured path in the Apache receiver. From there the metrics are processed and exported to Cloud Observability.
To complete the integration, you will:
Apache emits metrics using the mod_status module that provides an endpoint with information about the state of the server. To enable the status endpoint for Apache, load the
mod_statusmodule into your
httpd.conf file using the following directive::
1 LoadModule status_module modules/mod_status.so
httpd.conf is used for configuring these parameters, but Apache also supports files. Depending on your setup, this module may need to go in another location.
Additionally, access to the server status endpoint is restricted and additional configuration is required to ensure the OpenTelemetry Collector can access the endpoint. Add the following
location object to your
1 2 3 4 <Location /server-status> SetHandler server-status Require host <OpenTelemetry Collector host> </Location>
For more details regarding configuring the Apache remote connection, see the official Apache documentation.
In the Collector configuration file, add Apache as a receiver and set the
endpoint to address of the Apache server.
1 2 3 receivers: apache: endpoint: "http://<address of server>:<port>/server-status?auto"
The OpenTelemetry repo’s readme provides additional details about Apache configuration.
Once the Apache receiver is configured, enable it by adding it to one or more pipelines as described in the Collector configuration documentation.
You can validate that metrics are reporting to Cloud Observability on the Metrics details page in Project settings.
In Cloud Observability, click Project settings > Metric details.
Search for Apache metric names.
See the receiver’s metadata file for a complete list of emitted metrics.
If needed, click on the metric to edit the description and how the units are displayed in Cloud Observability.
Use the Cloud Observability Terraform Provider to create a dashboard for the metrics.
For a more complete example that’s ready to run, see the Apache integration in Cloud Observability OpenTelemetry Examples.
Updated Dec 1, 2022