Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable OOTB discovery for Apache Web Server #5353

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

- (Splunk) Add `apachespark` receiver ([#5318](https://github.com/signalfx/splunk-otel-collector/pull/5318))

### 💡 Enhancements 💡

- (Splunk) Apache Web Server Auto Discovery: set the default discovered endpoint to match the OpenTelemetry `apachereceiver` default: `http://`endpoint`/server-status?auto` ([#5353](https://github.com/signalfx/splunk-otel-collector/pull/5353))
If the collector is running as a process on the host OS and the Apache Web Server is in a Docker container add `--set=splunk.discovery.extensions.docker_observer.config.use_host_bindings=true` to the command-line arguments for the discovery to create the correct endpoint.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already know facts here. I meant to say it holds for all discovery apps/services/dbs. May be we can skip linke16

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, unfortunately, use_host_bindings is not explicitly listed there. To be fair I didn't read that doc carefully, but, I will add a task to review and update the doc, I think that there are a few things that we should be more explicit about.


## v0.108.1

This Splunk OpenTelemetry Collector release includes changes from the [opentelemetry-collector v0.108.1](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.108.1) and the [opentelemetry-collector-contrib v0.108.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.108.0) releases where appropriate.
Expand Down Expand Up @@ -300,7 +305,7 @@ Note: Some `core` dependencies were incorrectly still set to `v0.105.0` for this
### 💡 Enhancements 💡

- (Splunk) Auto Discovery for Linux:
- Bring Apache Web Server receiver into the discovery mode ([#5109](https://github.com/signalfx/splunk-otel-collector/pull/5109))
- Bring Apache Web Server receiver into the discovery mode ([#5116](https://github.com/signalfx/splunk-otel-collector/pull/5116))
- (Splunk) linux installer script: decouple the endpoint and protocol options ([#5164](https://github.com/signalfx/splunk-otel-collector/pull/5164))
- (Splunk) Bump version of com.signalfx.public:signalfx-commons-protoc-java to 1.0.44 ([#5186](https://github.com/signalfx/splunk-otel-collector/pull/5186))
- (Splunk) Bump version of github.com/snowflakedb/gosnowflake from to 1.11.0 ([#5176](https://github.com/signalfx/splunk-otel-collector/pull/5176))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#####################################################################################
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. #
# #
# It reflects the default configuration bundled in the Collector executable for use #
# in discovery mode (--discovery) and is provided for reference or customization. #
# Please note that any changes made to this file will need to be reconciled during #
# upgrades of the Collector. #
#####################################################################################
# apache:
# enabled: true
# rule:
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)httpd.*"}) and not (command matches "splunk.discovery")
# host_observer: type == "hostport" and command matches "(?i)httpd.*" and not (command matches "splunk.discovery")
# k8s_observer: type == "port" and pod.name matches "(?i)httpd.*"
# config:
# default:
# endpoint: "http://`endpoint`/server-status?auto"
# status:
# metrics:
# - status: successful
# strict: apache.uptime
# message: apachereceiver receiver is working!
# statements:
# - status: failed
# regexp: 'connect: network is unreachable'
# message: The container cannot be reached by the Collector. Make sure they're in the same network.
# - status: failed
# regexp: 'connect: connection refused'
# message: The container is refusing apache webserver connections.
2 changes: 1 addition & 1 deletion docker/apache/status.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ExtendedStatus on
<Location /mod_status>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what mod_status as have not played with Apache web server for a while but will go with your way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the path that one would use on the endpoint for the Apache receiver. The OTel receiver and most of the samples defaults to server-status, confusingly the name of the module that provides the functionality is actually mod_status, see https://httpd.apache.org/docs/2.4/mod/mod_status.html

<Location /server-status>
SetHandler server-status
</Location>
8 changes: 1 addition & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
image: quay.io/splunko11ytest/apache:latest
profiles:
- smartagent
- integration-test-apache-discovery
build: ./apache
ports:
- "18080:80"
Expand Down Expand Up @@ -298,10 +299,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
httpd-apache-discovery:
image: httpd:2.4
build: ./httpd-discovery
profiles:
- integration-test-apache-discovery
ports:
- "8080:80"
3 changes: 0 additions & 3 deletions docker/httpd-discovery/Dockerfile

This file was deleted.

Loading
Loading