Last active
July 18, 2023 21:33
-
-
Save rga-odoo/fa604821923a6ba948358477d079b3ee to your computer and use it in GitHub Desktop.
This file contains 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
server: | |
http_listen_port: 9080 | |
grpc_listen_port: 0 | |
# log_level: debug | |
positions: | |
filename: /tmp/positions.yaml | |
clients: | |
- url: http://loki:3100/loki/api/v1/push | |
scrape_configs: | |
- job_name: Odoo | |
static_configs: | |
- targets: | |
- localhost | |
labels: | |
job: Odoo | |
__path__: /var/log/*log | |
pipeline_stages: | |
- multiline: | |
firstline: '^\d{4}-\d{2}-\d{2}\s\d{1,2}\:\d{2}\:\d{2}\,\d{3} ' | |
max_wait_time: 3s | |
max_lines: 300 | |
- regex: | |
expression: '^(?P<time>\d{4}-\d{2}-\d{2}\s\d{1,2}\:\d{2}\:\d{2}\,\d{3}) (?P<message>(?s:.*))' | |
- labels: | |
time: | |
- timestamp: | |
source: time | |
format: '2006-01-02 15:04:05,000' | |
- output: | |
source: message | |
# <pid> <level> <db_name> <dummy> <ip> - - [<http_time>] "<method> <path>" <status> - <query> <t1> <t2> | |
#quantile_over_time(0.9, {filename="/var/log/rga_aa.log"} | __error__=`` |= `INFO` | pattern `<pid> <level> <db_name> <dummy> <ip> - - [<http_time>] "<method> <path>" <status> - <query> <t1> <t2>` | t1 > 0.5 | __error__=`` | unwrap t1 [$__interval]) by (t1, t2) | |
#sum(sum_over_time({filename="/var/log/rga_aa.log"} | __error__=`` |= `INFO` | pattern `<pid> <level> <db_name> <dummy> <ip> - - [<http_time>] "<method> <path>" <status> - <query> <t1> <t2>` | t1 > 0.01 | __error__=`` | unwrap t1 [1s])) | |
#sum(sum_over_time({filename="/var/log/rga_aa.log"} | __error__=`` |= `INFO` | pattern `<pid> <level> <db_name> <dummy> <ip> - - [<http_time>] "<method> <path>" <status> - <query> <t1> <t2>` | t2 > 0.01 | __error__=`` | unwrap t2 [1s])) |
pattern
<db_name> - - [<http_time>] " " - <query_time>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IMP