Skip to content
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

Feature Request: Support for gRPC endpoint #725

Closed
autumnw opened this issue Dec 28, 2020 · 5 comments
Closed

Feature Request: Support for gRPC endpoint #725

autumnw opened this issue Dec 28, 2020 · 5 comments

Comments

@autumnw
Copy link

autumnw commented Dec 28, 2020

Host operating system: output of uname -a

CentOS 7

blackbox_exporter version: output of blackbox_exporter --version

blackbox_exporter, version 0.18.0 (branch: HEAD, revision: 60c86e6)
build user: root@53d72328d93f
build date: 20201012-09:46:31
go version: go1.15.2

What is the blackbox.yml module config.

tls_net:
prober: tcp
tcp:
tls: true
tls_config:
insecure_skip_verify: false
ca_file: "/etc/blackbox_exporter/certs/net/ca.crt"
cert_file: "/etc/blackbox_exporter/certs/net/client.crt"
key_file: "/etc/blackbox_exporter/certs/net/client.key"

What is the prometheus.yml scrape config.

What logging output did you get from adding &debug=true to the probe URL?

# curl http://blackbox-exporter-1.***:9115/probe?target=management-stg-int.*.net:443&module=tls_net&debug=true
[1] 13383
[2] 13384
# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 0.031345432
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 0.033132346
# HELP probe_failed_due_to_regex Indicates if probe failed due to regex
# TYPE probe_failed_due_to_regex gauge
probe_failed_due_to_regex 0
# HELP probe_http_content_length Length of http content response
# TYPE probe_http_content_length gauge
probe_http_content_length 0
# HELP probe_http_duration_seconds Duration of http request by phase, summed over all redirects
# TYPE probe_http_duration_seconds gauge
probe_http_duration_seconds{phase="connect"} 0.001016902
probe_http_duration_seconds{phase="processing"} 0
probe_http_duration_seconds{phase="resolve"} 0.031345432
probe_http_duration_seconds{phase="tls"} 0
probe_http_duration_seconds{phase="transfer"} 0
# HELP probe_http_redirects The number of redirects
# TYPE probe_http_redirects gauge
probe_http_redirects 0
# HELP probe_http_ssl Indicates if SSL was used for the final redirect
# TYPE probe_http_ssl gauge
probe_http_ssl 0
# HELP probe_http_status_code Response HTTP status code
# TYPE probe_http_status_code gauge
probe_http_status_code 0
# HELP probe_http_uncompressed_body_length Length of uncompressed response body
# TYPE probe_http_uncompressed_body_length gauge
probe_http_uncompressed_body_length 0
# HELP probe_http_version Returns the version of HTTP of the probe response
# TYPE probe_http_version gauge
probe_http_version 0
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 3.978219834e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_success Displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 0

[1]-  Done                    curl http://blackbox-exporter-1.*.pan.local:9115/probe?target=management-stg-int.dev.net:443
[2]+  Done                    module=tls_net

What did you do that produced an error?

I have a server which is implemented by golang. It is a gRPC server with server certificate and client certificate enabled.
I want to have blackbox_exporter to probe the endpoint with SSL enabled with tcp_probe

What did you expect to see?

Expect to blackbox_exporter can probe if the tls connection was establish successfully and the certificate expiry.

What did you see instead?

[root@prometheus-stg-1 prometheus]# # HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 0.031345432
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 0.033132346
# HELP probe_failed_due_to_regex Indicates if probe failed due to regex
# TYPE probe_failed_due_to_regex gauge
probe_failed_due_to_regex 0
# HELP probe_http_content_length Length of http content response
# TYPE probe_http_content_length gauge
probe_http_content_length 0
# HELP probe_http_duration_seconds Duration of http request by phase, summed over all redirects
# TYPE probe_http_duration_seconds gauge
probe_http_duration_seconds{phase="connect"} 0.001016902
probe_http_duration_seconds{phase="processing"} 0
probe_http_duration_seconds{phase="resolve"} 0.031345432
probe_http_duration_seconds{phase="tls"} 0
probe_http_duration_seconds{phase="transfer"} 0
# HELP probe_http_redirects The number of redirects
# TYPE probe_http_redirects gauge
probe_http_redirects 0
# HELP probe_http_ssl Indicates if SSL was used for the final redirect
# TYPE probe_http_ssl gauge
probe_http_ssl 0
# HELP probe_http_status_code Response HTTP status code
# TYPE probe_http_status_code gauge
probe_http_status_code 0
# HELP probe_http_uncompressed_body_length Length of uncompressed response body
# TYPE probe_http_uncompressed_body_length gauge
probe_http_uncompressed_body_length 0
# HELP probe_http_version Returns the version of HTTP of the probe response
# TYPE probe_http_version gauge
probe_http_version 0
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 3.978219834e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_success Displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 0

[1]-  Done                    curl http://blackbox-exporter-1.*.pan.local:9115/probe?target=management-stg-int.*.net:443
[2]+  Done                    module=tls_net
@brian-brazil
Copy link
Contributor

I'm confused, is this intended as a bug report or a feature request?

If you have a TCP server which implements standard TLS then this exporter is sufficient to do what you want. If you have some other protocol, then you'll want to write an exporter to handle it. The output you've shared does not indicate any bugs with the blackbox exporter as you failed to escape the ampersands.

@autumnw
Copy link
Author

autumnw commented Dec 28, 2020

Sorry for confusion.
I found if I put the single quote for the full URL, it works.

However, the original purpose of this issue is for a feature request:
We want the prometheus server can send a request to blackbox_exporter with a gRPC proble, like:

  grpc_net:
    prober: grpc
    timeout: 5s
    grpc:
      send: "ping"
      expect: "pong"
      tls_config:
        ca_file: "/etc/blackbox_exporter/certs/_net/ca.crt"
        cert_file: "/etc/blackbox_exporter/certs/net/client.crt"
        key_file: "/etc/blackbox_exporter/certs/net/client.key"

@brian-brazil
Copy link
Contributor

GRPC is out of scope, this exporter only covers the basic standard protocols that it does. If you need this I suggest writing a new exporter, as handling arbitrary proto exchanges doesn't belong here.

@mlazowik
Copy link

This is resolved by #835, right?

@SuperQ
Copy link
Member

SuperQ commented Jan 22, 2022

Yup, I think so.

@SuperQ SuperQ closed this as completed Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants