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

Add monitor.pl metrics exporters to web servers #672

Draft
wants to merge 1 commit into
base: production
Choose a base branch
from

Conversation

daaang
Copy link
Collaborator

@daaang daaang commented Mar 15, 2024

No description provided.

@daaang
Copy link
Collaborator Author

daaang commented Mar 15, 2024

In case anybody is curious, this is what the apache::vhost resource creates:

# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************
#
<VirtualHost *:9180>
  ServerName prometheus-webserver-exporter

  ## Vhost docroot
  DocumentRoot "/usr/local/lib/prom_web_exporter"
  ## Alias declarations for resources outside the DocumentRoot
  ScriptAlias / "/usr/local/lib/prom_web_exporter/"

  ## Directories, there should at least be a declaration for /usr/local/lib/prom_web_exporter

  <Directory "/usr/local/lib/prom_web_exporter">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>

  ## Logging
  ErrorLog "/var/log/apache2/prometheus-webserver-exporter_error.log"
  ServerSignature Off
  CustomLog "/var/log/apache2/prometheus-webserver-exporter_access.log" combined
  ## Rewrite rules
  RewriteEngine On

  RewriteRule ^/$ /metrics [last,redirect=permanent]

  ## Shibboleth
</VirtualHost>

This implements everything except the http check, which I believe we are
only using for fulcrum. Everything that can has a 1-second timeout, so
slow services will be considered down.
include apache
}

apache::vhost { "prometheus-webserver-exporter":
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if you can override the default Options for the doc root, but if you can this vhost can function with None.

Copy link
Member

@skorner skorner left a comment

Choose a reason for hiding this comment

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

This approach to, and first pass at, replicating the legacy web server monitoring that haproxy relies on to a prometheus exporter looks great to me.

@daaang daaang marked this pull request as ready for review November 5, 2024 15:19
@daaang daaang marked this pull request as draft November 5, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants