-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Expose metrics using https #359
Comments
I was looking for this feature as well. I have all my exporters connected via TLS and this is the exception. I think that adding Example from my Node Exporter on the same LXC as my NGINX: # Prometheus Node Exporter configuration
# See: https://prometheus.io/docs/prometheus/latest/configuration/https/
# Allow TLS connections
tls_server_config:
cert_file: /etc/ssl/certs/domain.com.crt
key_file: /etc/ssl/private/domain.com.key
min_version: TLS12
# Enable HTTP/2 support
http_server_config:
http2: true |
What do you mean by "adding scheme (default http) and cert and key inside the listen block"? |
Hi, @roberto-jobet-g2m . At the moment I have the configuration file listen {
port = 4040
address = "0.0.0.0"
metrics_endpoint = "/metrics"
}
namespace "default" {
# Main (combined) log format
format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$
http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\""
source = {
files = [
"/var/log/nginx/access.log"
]
}
labels {
format="combined"
service_name = "nginx"
environment = "production"
}
metrics_override = { prefix = "" }
namespace_label = "vhost"
}
namespace "myapp.domain.com" {
# APM log format
format = "$remote_addr - $remote_user [$time_local] \"$request\" $request_length $request_time $status $bytes_sent $body_bytes_sent $sent_http_content_type \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\" $upstream_addr $upstream_status $upstream_cache_status $upstream_response_time $upstream_connect_time $upstream_header_time $gzip_ratio $ssl_protocol $ssl_cipher $ssl_curve $ssl_early_data $request_id $request_method"
source = {
files = [
"/var/log/nginx/myapp.domain.com.apm.log"
]
}
labels {
format="apm"
service_name = "myapp"
environment = "production"
}
metrics_override = { prefix = "" }
namespace_label = "vhost"
}
# [..]
} My proposal, in line with what @milap-form3 suggested, would be to allow the listen {
port = 4040
address = "0.0.0.0"
metrics_endpoint = "/metrics"
scheme: "https"
cert: "/etc/ssl/certs/domain.com.crt"
key: "/etc/ssl/private/domain.com.key"
} Moreover, when I provided the other example, I was talking about the usual web configuration # Prometheus Node Exporter configuration
# See: https://prometheus.io/docs/prometheus/latest/configuration/https/
# Allow TLS connections
tls_server_config:
cert_file: /etc/ssl/certs/domain.com.crt
key_file: /etc/ssl/private/domain.com.key
min_version: TLS12
# Enable HTTP/2 support
http_server_config:
http2: true Either would do. I suppose the first option would be easier to implement, of course. Thanks. |
Is your feature request related to a problem? Please describe.
The /metrics endpoint exposed is only serving via http which is not within compliance and we require the traffic to be encrypted using https.
Describe the solution you'd like
Be able to enable
https
from configuration. We could add configuration options like:Describe alternatives you've considered
There is not much of a alternative unless we add something proxying the https connection
Additional context
The text was updated successfully, but these errors were encountered: