GET POST start end time metrics.

74 views
Skip to first unread message

birbhadra dhungana

unread,
Mar 25, 2020, 12:56:19 AM3/25/20
to Prometheus Users
I want to be able to query the values that Probe Logs have when requsting a GET or a POST request: For example: Response timings for roundtrip" roundtrip=0 start=2020-03-25T03:35:13.715468308Z end=2020-03-25T03:35:13.865802576Z module=http_post_2xx.

Probe logs show this information but prometheus UI when using PRMQL there is noway to get this informaiton. Please suggest.


birbhadra dhungana

unread,
Apr 14, 2020, 12:07:01 PM4/14/20
to Prometheus Users
Any update on this one.

Brian Candler

unread,
Apr 14, 2020, 12:46:57 PM4/14/20
to Prometheus Users
I am guessing - because you didn't say - that you are talking about blackbox_exporter.  I suggest in future you make your request clearer: describe what software you're using, show your configurations, show what test you're doing, and what result you get.

Anyway, you can find all the metrics available from blackbox_exporter by probing it yourself using curl.  You will see the metrics for the round-trip time (the total, and also broken into the different sub-parts of the request), and these are the metrics you can query using promQL.

Like this:

root@prometheus:~# curl 'localhost:9115/probe?module=http_2xx_example&target=http:%2F%2Fwww.google.com'
# 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.001660343
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 0.075831917
# 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 -1
# 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.011122309
probe_http_duration_seconds{phase="processing"} 0.052277206
probe_http_duration_seconds{phase="resolve"} 0.001660343
probe_http_duration_seconds{phase="tls"} 0
probe_http_duration_seconds{phase="transfer"} 0.009934561
# 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 200
# 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 1.1
# 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 1

birbhadra dhungana

unread,
Apr 14, 2020, 12:50:10 PM4/14/20
to Prometheus Users
that is a limitation right, because probe logs show a little bit more  than this ti shows

"For example: Response timings for roundtrip" roundtrip=0 start=2020-03-25T03:35:13.715468308Z end=2020-03-25T03:35:13.865802576Z module=http_post_2xx." at least in the prometheus i am in.
So, why does blackbox exporter not ship these data and only ship the ones you showed below.


On Tuesday, March 24, 2020 at 11:56:19 PM UTC-5, birbhadra dhungana wrote:

Brian Candler

unread,
Apr 14, 2020, 1:25:01 PM4/14/20
to Prometheus Users
What exactly is the additional information you want to record?

The difference between the start and end times is the probe_duration_seconds metric.  If you want the end time, use timestamp(probe_duration_seconds).  If you want the start time, subtract one from the other.

birbhadra dhungana

unread,
Apr 14, 2020, 1:28:00 PM4/14/20
to Prometheus Users
Instead of the probe _duration time can we not just have 
responseStartTime =2020-04-14T17:26:19.596192526Z 
responseendTime=2020-04-14T17:26:19.596383186Z
target=https://localhost.. 

I was trying to plot this information from prometheus into grafana .. and to get info such as target  and start  end time it is not possible.
Reply all
Reply to author
Forward
0 new messages