Hi,
I am using puppet to manage my .mtail files, and I just found out that mtail should notice changes to .mtail files without having to be restarted, which seems a nice feature.
However, when I tried this out, with puppet updating a .mtail file and adding a new metric, mtail started returning the new metric as expected, but also returned two copies of some existing metrics.
My mtail program was like this:
hidden gauge start_processing_time by pid
counter processing_time_total
/^(?P<date>\w+\s+\d+\s+\d+:\d+:\d+) <some pattern> [(?P<pid>\d+)\]: / {
strptime($date, "Jan _2 15:04:05")
/Starting/ {
start_processing_time[$pid] = timestamp()
}
/Finished/ {
start_processing_time[$pid] > 0 {
processing_time_total += timestamp() - start_processing_time[$pid]
del start_processing_time[$pid]
}
}
}
and after the update like this:
hidden gauge start_processing_time by pid
gauge processing_time
counter processing_time_total
/^(?P<date>\w+\s+\d+\s+\d+:\d+:\d+) <some pattern> [(?P<pid>\d+)\]: / {
strptime($date, "Jan _2 15:04:05")
/Starting/ {
start_processing_time[$pid] = timestamp()
}
/Finished/ {
start_processing_time[$pid] > 0 {
processing_time = timestamp() - start_processing_time[$pid]
processing_time_total += timestamp() - start_processing_time[$pid]
del start_processing_time[$pid]
}
}
}
After the update mtail returned two copies of the processing_time_total metric.
Is this a feature, or a known issue?
Chris