Created
December 16, 2022 17:42
-
-
Save linktohack/a0207744dee84fb870eef9ab1df378f9 to your computer and use it in GitHub Desktop.
Pattern to match loki's log (Nginx and LB app)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api.driver.cloud.private | |
api.driver.cloud.transalliance.eu | |
|~ "(?i)error" | |
|= `ms {` | |
| pattern `<ts> stdout F <method> <url> <code> <ms>ms {` | |
| pattern `<_> "request_method": "<request_method>", "request_uri": "<request_uri>", "request_id": "<request_id>", "status": <status>, "upstream_status": <upstream_status>, "request_time": <request_time>, "upstream_response_time": <upstream_response_time>, "upstream_connect_time": <upstream_connect_time>, "upstream_header_time": <upstream_header_time>` | |
{job=~"kube-system/.*-crc81um9ef04uh4042gpug-.*"} | |
|= "api.driver.cloud.private" | |
!= "/upload" | |
!= "/download" | |
!= "getAverageTrip" | |
| unwrap request_time | |
| __error__ = "" | |
count_over_time( | |
[1m]) | |
rate( | |
[1m]) | |
sum(count_over_time( | |
[1m])) | |
sum(rate( | |
[1h])) | |
quantile_over_time(0.99, | |
[1m]) by (request_uri) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment