Skip to content

Commit 560aacc

Browse files
committed
Add TLS support via the exporter toolkit
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.
1 parent dbdf4d9 commit 560aacc

File tree

4 files changed

+310
-13
lines changed

4 files changed

+310
-13
lines changed

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ NOTE: Version 0.7.0 switched to the [kingpin](https://github.com/alecthomas/king
112112
Flags:
113113
-h, --help Show context-sensitive help (also try
114114
--help-long and --help-man).
115-
--web.listen-address=":9102"
116-
The address on which to expose the web interface
117-
and generated Prometheus metrics.
118115
--web.enable-lifecycle Enable shutdown and reload via HTTP request.
119116
--web.telemetry-path="/metrics"
120117
Path under which to expose metrics.
@@ -164,13 +161,20 @@ NOTE: Version 0.7.0 switched to the [kingpin](https://github.com/alecthomas/king
164161
The UDP relay target address (host:port)
165162
--statsd.relay.packet-length=1400
166163
Maximum relay output packet length to avoid fragmentation
164+
--web.listen-address=:9102 ...
165+
Addresses on which to expose metrics and web interface. Repeatable for multiple addresses.
166+
--web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.
167167
--log.level=info Only log messages with the given severity or
168168
above. One of: [debug, info, warn, error]
169169
--log.format=logfmt Output format of log messages. One of: [logfmt,
170170
json]
171171
--version Show application version.
172172
```
173173
174+
## TLS support
175+
176+
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.
177+
174178
## Lifecycle API
175179
176180
The `statsd_exporter` has an optional lifecycle API (disabled by default) that can be used to reload or quit the exporter

go.mod

+12-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/prometheus/client_golang v1.13.0
99
github.com/prometheus/client_model v0.2.0
1010
github.com/prometheus/common v0.37.0
11+
github.com/prometheus/exporter-toolkit v0.8.1
1112
github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807
1213
gopkg.in/alecthomas/kingpin.v2 v2.2.6
1314
gopkg.in/yaml.v2 v2.4.0
@@ -18,10 +19,20 @@ require (
1819
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
1920
github.com/beorn7/perks v1.0.1 // indirect
2021
github.com/cespare/xxhash/v2 v2.1.2 // indirect
22+
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
2123
github.com/go-logfmt/logfmt v0.5.1 // indirect
2224
github.com/golang/protobuf v1.5.2 // indirect
25+
github.com/jpillora/backoff v1.0.0 // indirect
2326
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
27+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
2428
github.com/prometheus/procfs v0.8.0 // indirect
25-
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
29+
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
30+
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
31+
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
32+
golang.org/x/sync v0.1.0 // indirect
33+
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
34+
golang.org/x/text v0.3.7 // indirect
35+
google.golang.org/appengine v1.6.7 // indirect
2636
google.golang.org/protobuf v1.28.1 // indirect
37+
gopkg.in/yaml.v3 v3.0.1 // indirect
2738
)

0 commit comments

Comments
 (0)