Apache
This integration is enabled by default.
Versions supported: 2.4
This integration uses a sidecar exporter that is available in UBI or scratch base image.
This integration has 11 metrics.
Timeseries generated: 100 timeseries
List of Alerts
Alert | Description | Format |
---|---|---|
[Apache] No Instance Up | No instances up | Prometheus |
[Apache] Up Time Less Than One Hour | Instance with UpTime less than one hour | Prometheus |
[Apache] Time Since Last OK Request More Than One Hour | Time since last OK request higher than one hour | Prometheus |
[Apache] High Error Rate | High error rate | Prometheus |
[Apache] High Rate Of Busy Workers In Instance | Low workers in open_slot state | Prometheus |
List of Dashboards
Apache App Overview
The dashboard provides information on the status of the Apache resources.
List of Metrics
Metric name |
---|
apache_accesses_total |
apache_connections |
apache_cpuload |
apache_duration_ms_total |
apache_http_last_request_seconds |
apache_http_response_codes_total |
apache_scoreboard |
apache_sent_kilobytes_total |
apache_up |
apache_uptime_seconds_total |
apache_workers |
Prerequisites
Create Grok Configuration
You need to add the Grok configuration in order to parse Apache logs and get metrics from them.
Install It Directly In Your Cluster
helm install -n Your-Application-Namespace apache-exporter --repo https://sysdiglabs.github.io/integrations-charts --set configmap=true
Download and Apply
You can download the file and execute the next command
kubectl -n Your-Application-Namespace apply -f grok-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: grok-config
data:
config.yml: |
global:
config_version: 3
input:
type: file
path: /tmp/logs/accesss.log
fail_on_missing_logfile: false
readall: true
imports:
- type: grok_patterns
dir: ./patterns
metrics:
- type: counter
name: apache_http_response_codes_total
help: HTTP requests to Apache
match: '%{COMMONAPACHELOG}'
labels:
code: '{{.response}}'
method: '{{.verb}}'
- type: gauge
name: apache_http_response_bytes_total
help: Size of HTTP responses
match: '%{COMMONAPACHELOG}'
value: '{{.bytes}}'
cumulative: true
labels:
code: '{{.response}}'
method: '{{.verb}}'
- type: gauge
name: apache_http_last_request_seconds
help: Timestamp of the last HTTP request
match: '%{COMMONAPACHELOG}'
value: '{{timestamp "02/Jan/2006:15:04:05 -0700" .timestamp}}'
labels:
code: '{{.response}}'
method: '{{.verb}}'
server:
protocol: http
Check Apache Configuration
Apache provides metrics in its own format via its ServerStatus module. To enable this module, include (or uncomment) the following line in your apache configuration file:
LoadModule status_module modules/mod_status.so
<Location "/server-status">
SetHandler server-status
</Location>
To configure Apache server to produce common logs, include (or uncomment) the following in your Apache configuration file:
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /usr/local/apache2/logs/accesss.log common
</IfModule>
Installation
An automated wizard is present in the Monitoring Integrations in Sysdig Monitor. Expert users can also use the Helm chart for installation: https://github.com/sysdiglabs/integrations-charts/tree/main/charts/apache-exporter
Agent Configuration
The default agent jobs for this integration are as follows:
- job_name: apache-exporter-default
tls_config:
insecure_skip_verify: true
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
source_labels: [__meta_kubernetes_pod_host_ip]
regex: __HOSTIPS__
- action: keep
source_labels:
- __meta_kubernetes_pod_annotation_promcat_sysdig_com_integration_type
regex: "apache"
- source_labels: [__meta_kubernetes_pod_phase]
action: keep
regex: Running
- action: replace
source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:9117
target_label: __address__
- action: replace
source_labels: [__meta_kubernetes_pod_uid]
target_label: sysdig_k8s_pod_uid
- action: replace
source_labels: [__meta_kubernetes_pod_container_name]
target_label: sysdig_k8s_pod_container_name
- job_name: apache-grok-default
tls_config:
insecure_skip_verify: true
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
source_labels: [__meta_kubernetes_pod_host_ip]
regex: __HOSTIPS__
- action: keep
source_labels:
- __meta_kubernetes_pod_annotation_promcat_sysdig_com_integration_type
regex: "apache"
- source_labels: [__meta_kubernetes_pod_phase]
action: keep
regex: Running
- action: replace
source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:9144
target_label: __address__
- action: replace
source_labels: [__meta_kubernetes_pod_uid]
target_label: sysdig_k8s_pod_uid
- action: replace
source_labels: [__meta_kubernetes_pod_container_name]
target_label: sysdig_k8s_pod_container_name
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.