Commit 99041626 authored by Jérome Perrin's avatar Jérome Perrin

grafana: simplify multiline detection or mariadb slow query

The previous approach was ingesting uless "Time" lines sometimes
parent 73fe6879
......@@ -23,7 +23,7 @@ md5sum = 86e379ac6ba789d65369ca1e0d4dfa3f
[instance-agent]
filename = instance-agent.cfg.in
md5sum = c6bc76d39dd51b3072d2c47a9a2de7e9
md5sum = 11cd081c2196f73441cd677b0d74b16a
[influxdb-config-file]
......
......@@ -658,19 +658,24 @@ init =
cfg['scrape_configs'].append({
"job_name": job_name,
"pipeline_stages": [
{
# between each slow query, slow query log has a first line like:
# # Time: 231008 16:29:01
# and then a second like:
# # User@Host: user[user] @ [10.0.71.207]
# but the first line is not repeated for subsequent queries that happens
# at the same second. Drop this "Time:" line
"drop": {
"expression": r"^# Time: \d+.*",
}
},
{
"match": {
"selector": get_job_selector(partition, job_name, application['name']),
"stages": [
{
"multiline": {
# between each slow query, slow query log has a first line like:
# # Time: 231008 16:29:01
# and then a second like:
# # User@Host: user[user] @ [10.0.71.207]
# but the first line is not repeated for subsequent queries that happens
# at the same second
"firstline": r"(^# Time: \d{2}.*\n^# User@Host:.*|^# User@Host:.*)",
"firstline": "^# User@Host:.*",
"max_lines": 1024,
"max_wait_time": "5s"
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment