Skip to content

Commit c482b7f

Browse files
authored
Discover Apache web server on Debian based distros (#5361)
1 parent 5208240 commit c482b7f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cmd/otelcol/config/collector/config.d.linux/receivers/apache.discovery.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# apache:
1010
# enabled: true
1111
# rule:
12-
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)httpd.*"}) and not (command matches "splunk.discovery")
13-
# host_observer: type == "hostport" and command matches "(?i)httpd.*" and not (command matches "splunk.discovery")
14-
# k8s_observer: type == "port" and pod.name matches "(?i)httpd.*"
12+
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)(httpd|apache2).*"}) and not (command matches "splunk.discovery")
13+
# host_observer: type == "hostport" and command matches "(?i)(httpd|apache2).*" and not (command matches "splunk.discovery")
14+
# k8s_observer: type == "port" and pod.name matches "(?i)(httpd|apache2).*"
1515
# config:
1616
# default:
1717
# endpoint: "http://`endpoint`/server-status?auto"

internal/confmapprovider/discovery/bundle/bundle.d/receivers/apache.discovery.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
apache:
66
enabled: true
77
rule:
8-
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)httpd.*"}) and not (command matches "splunk.discovery")
9-
host_observer: type == "hostport" and command matches "(?i)httpd.*" and not (command matches "splunk.discovery")
10-
k8s_observer: type == "port" and pod.name matches "(?i)httpd.*"
8+
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)(httpd|apache2).*"}) and not (command matches "splunk.discovery")
9+
host_observer: type == "hostport" and command matches "(?i)(httpd|apache2).*" and not (command matches "splunk.discovery")
10+
k8s_observer: type == "port" and pod.name matches "(?i)(httpd|apache2).*"
1111
config:
1212
default:
1313
endpoint: "http://`endpoint`/server-status?auto"

internal/confmapprovider/discovery/bundle/bundle.d/receivers/apache.discovery.yaml.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{{ receiver "apache" }}:
22
enabled: true
33
rule:
4-
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)httpd.*"}) and not (command matches "splunk.discovery")
5-
host_observer: type == "hostport" and command matches "(?i)httpd.*" and not (command matches "splunk.discovery")
6-
k8s_observer: type == "port" and pod.name matches "(?i)httpd.*"
4+
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)(httpd|apache2).*"}) and not (command matches "splunk.discovery")
5+
host_observer: type == "hostport" and command matches "(?i)(httpd|apache2).*" and not (command matches "splunk.discovery")
6+
k8s_observer: type == "port" and pod.name matches "(?i)(httpd|apache2).*"
77
config:
88
default:
99
endpoint: "http://`endpoint`/server-status?auto"

tests/receivers/apache/testdata/docker_observer_apache_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ receivers:
99
apache:
1010
config:
1111
endpoint: http://`endpoint`/server-status?auto
12-
rule: type == "container" and any([name, image, command], {# matches "(?i)httpd"}) and not (command matches "splunk.discovery")
12+
rule: type == "container" and any([name, image, command], {# matches "(?i)(httpd|apache2).*"}) and not (command matches "splunk.discovery")
1313
status:
1414
metrics:
1515
- status: successful

0 commit comments

Comments
 (0)