* feat: add remote_file probe
* fix: use tls module config
* chore: write http/https tests for probing remote file
* chore: get rid of useless lines
* fix: get rid of useless file download, check body directly
* fix: use checkCertificateMetrics to actually check values
* Rename remote_file to http_file
You can fetch remote content with a lot of different protocols, so I
think it's worth being specific here.
As part of this change I've fixed up some of the logic in the code. I've
also created a separate `http_file` block in the module config.
* Actually include renamed files
---------
Co-authored-by: Anthony LE BERRE <aleberre@veepee.com>
Co-authored-by: Rob Best <rob.best@jetstack.io>
If default_module is set then the exporter will use that when the module
parameter isn't set.
If target is set for a module then the module will use that target,
ignoring the target parameter completely.
* Support TLS renegotiation
* Bump version
* Revert version bump
* Extend TLSConfig with renegotiation support
* Update config/config.go - comment formatting
Co-authored-by: Rob Best <robertbest89@gmail.com>
* add dedicated renegotiation example
* Create local NewTLSConfig in order to incorporate local extentions
* go mod tidy
* Move TLS renegotiation parsing into UnmarshalYAML
Co-authored-by: Rob Best <robertbest89@gmail.com>
* Support getting certificate information from a kubeconfig file
* Support relative paths for cluster CA and user certificate in kubeconfig
* Determine relative using filepath.IsAbs
* Make relative path logic actually work, add test. Move all kubeconfig parsing into parsing specific function
There are a number of reasons for this change:
- Modules allow a single instance of the exporter to be configured with numerous
different tls configs. Previously you had to run a different exporter for each
combination.
- Adding new and more complicated options to the exporter should be easier with
modules than if I was to go down the route of accepting configuration directly through url params
- I prefer defining a specific prober (https,tcp) over using the URL to guess
what the user wants
There are some advantages to using a http client over tcp. For instance,
using http allows you to take advatange of a http proxy, which may be necessary
in some environments.
This commit puts the http client back, alongside tcp, and decides which one to use
based on the target address.