Closed frenkye closed 1 year ago
Sorry to reply you so late.
When new line log writing, it will trigger the one before it to collect. So if we want the example works, just write two lines logs or a blank line as end.
The new test.log
file:
192.168.21.1 [07/Mar/2023:13:19:17 +0100] "GET /XXXX HTTP/1.1" 200 122524 "https://referer/XXXX" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0" 3.680 "unix:/var/lib/php/7.4/fpm/name.sock" 3.680 - a7b4j3m1cq205qurit808a9qfk 1c6394284038c167766bfd4ab3b3be72 request_id=1c6394284038c167766bfd4ab3b3be72 trace_id=ef499069fb92418e
192.168.21.1 [07/Mar/2023:13:19:17 +0100] "GET /XXXX HTTP/1.1" 200 122524 "https://referer/XXXX" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0" 3.680 "unix:/var/lib/php/7.4/fpm/name.sock" 3.680 - a7b4j3m1cq205qurit808a9qfk 1c6394284038c167766bfd4ab3b3be72 request_id=1c6394284038c167766bfd4ab3b3be72 trace_id=ef499069fb92418e
CURL with openmetrics accept header:
$ curl -H 'accept: application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1' http://localhost:9999/metrics | grep test_http_response_time_seconds_bucket
The output:
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="0.1"} 0
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="0.3"} 0
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="0.5"} 0
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="1.0"} 0
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="2.0"} 0
test_http_response_time_seconds_bucket{method="GET",request="/XXXX",status="200",le="+Inf"} 1 # {trace_id="ef499069fb92418e",remote_addr="192.168.21.1",request_id="1c6394284038c167766bfd4ab3b3be72"} 3.68 1.6784166345202973e+09
Hi, I wanted to test the exemplars part of this exporter, if it would be to our interest, but I have problem to enable this feature.
First I found out the exemplars was added after the 0.2.0 version, so i build from source, but still can't manage to show them on histograms.
Any advice?
Log line (is a bit messy but i trying the new fields):