Skip to content

Commit

Permalink
Add TLS support via the exporter toolkit
Browse files Browse the repository at this point in the history
Metrics may contain sensitive information, so it should be possible to
scrape them over an encrypted connection. This requires TLS support.
For consistency with other Prometheus exporters, we use the exporter
toolkit to provide TLS support.

Fixes prometheus#413.
  • Loading branch information
CtrlZvi committed Oct 23, 2022
1 parent dbdf4d9 commit 54bd6fa
Show file tree
Hide file tree
Showing 4 changed files with 310 additions and 13 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ NOTE: Version 0.7.0 switched to the [kingpin](https://github.com/alecthomas/king
Flags:
-h, --help Show context-sensitive help (also try
--help-long and --help-man).
--web.listen-address=":9102"
The address on which to expose the web interface
and generated Prometheus metrics.
--web.listen-address=:9102 ...
Addresses on which to expose metrics and web interface. Repeatable for multiple addresses.
--web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.
--web.enable-lifecycle Enable shutdown and reload via HTTP request.
--web.telemetry-path="/metrics"
Path under which to expose metrics.
Expand Down Expand Up @@ -171,6 +171,10 @@ NOTE: Version 0.7.0 switched to the [kingpin](https://github.com/alecthomas/king
--version Show application version.
```
## TLS support
TLS support is provided via the [Prometheus Exporter Toolkit](https://github.com/prometheus/exporter-toolkit). Please see [its configuration documentation]9https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md) for how to configure TLS.
## Lifecycle API
The `statsd_exporter` has an optional lifecycle API (disabled by default) that can be used to reload or quit the exporter
Expand Down
13 changes: 12 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.37.0
github.com/prometheus/exporter-toolkit v0.8.1
github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -18,10 +19,20 @@ require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 54bd6fa

Please sign in to comment.