Skip to content

Commit

Permalink
Rename config file parameter for tls certificate to tls_cert
Browse files Browse the repository at this point in the history
  • Loading branch information
phlipse committed Jan 30, 2018
1 parent 7f39fc5 commit de9d7fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/outputs/prometheus_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This plugin starts a [Prometheus](https://prometheus.io/) Client, it exposes all
# Use TLS
tls = true
tls_crt = "/etc/ssl/telegraf.crt"
tls_cert = "/etc/ssl/telegraf.crt"
tls_key = "/etc/ssl/telegraf.key"
# Use http basic authentication
Expand Down
6 changes: 3 additions & 3 deletions plugins/outputs/prometheus_client/prometheus_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type MetricFamily struct {
type PrometheusClient struct {
Listen string
TLS bool `toml:"tls"`
TLSCrt string `toml:"tls_crt"`
TLSCert string `toml:"tls_cert"`
TLSKey string `toml:"tls_key"`
BasicAuth bool `toml:"basic_auth"`
Username string `toml:"username"`
Expand All @@ -79,7 +79,7 @@ var sampleConfig = `
## Use TLS
# tls = true
tls_crt = "/etc/ssl/telegraf.crt"
tls_cert = "/etc/ssl/telegraf.crt"
tls_key = "/etc/ssl/telegraf.key"
## Use http basic authentication
Expand Down Expand Up @@ -165,7 +165,7 @@ func (p *PrometheusClient) Start() error {
}

go func() {
if err := p.server.ListenAndServeTLS(p.TLSCrt, p.TLSKey); err != nil {
if err := p.server.ListenAndServeTLS(p.TLSCert, p.TLSKey); err != nil {
if err != http.ErrServerClosed {
log.Printf("E! Error creating prometheus tls secured metric endpoint, err: %s\n",
err.Error())
Expand Down

0 comments on commit de9d7fa

Please sign in to comment.