-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 SSL/TLS support to nginx input plugin #2883
Add SSL/TLS support to nginx input plugin #2883
Conversation
Import required packages
8ec7396
to
30ee576
Compare
Thanks the the PR, we need to make sure we don't create a new transport per interval. I recently fixed this in a few other plugin in #2782. |
d54552c
to
9424e64
Compare
Hey @danielnelson, thanks for the feedback. I've updated this PR so that the transport is re-used, using the apache input plugin as an example for doing so. |
9424e64
to
851493a
Compare
851493a
to
5eb122f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor formatting things to do.
plugins/inputs/nginx/nginx.go
Outdated
## An array of Nginx stub_status URI to gather stats. | ||
urls = ["http://localhost/status"] | ||
# Read Nginx's basic status information (ngx_http_stub_status_module) | ||
[[inputs.nginx]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the toml table header here, it is added automatically when outputting the sample config.
plugins/inputs/nginx/nginx.go
Outdated
# TLS/SSL configuration | ||
ssl_ca = "var/security/ca.pem" | ||
ssl_cert = "var/security/cert.cer" | ||
ssl_key = "var/security/key.key" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the paths to /etc/telegraf/<file>
to match other plugins.
plugins/inputs/nginx/nginx.go
Outdated
insecure_skip_verify = false | ||
|
||
# HTTP response timeout (default: 5s) | ||
response_timeout = "10s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this to 5s since that's the default
Thank you! This will be in 1.4. |
This PR adds support for an optional SSL/TLS config in the nginx input plugin.
Required for all PRs: