fluent / fluent-plugin-prometheus

A fluent plugin that collects metrics and exposes for Prometheus.
Apache License 2.0
258 stars 79 forks source link

prometheus_tail_monitor change position file pos #49

Closed jl2005 closed 5 years ago

jl2005 commented 6 years ago

When I use prometheus_tail_monitor, I found that Fluend pos_file is incorrect. This is because prometheus_tail_monitor will call FilePositionEntry::read_inode and FilePositionEntry::read_pos to modify the file pointer. When Fluentd is writing pos_file, it is possible to write to the wrong location. Related issues see pos file error #1953

At the same time, prometheus_tail_monitor will also iterate Fluentd tails variable. When Fluentd is updated tails, it will cause can't add a new key into hash during iteration. Related issues see can't add a new key into hash during iteration #1804

It is recommended to temporarily Disable prometheus_tail_monitor and add it when there is a better implementation.

kazegusuri commented 6 years ago

Thank you for filing an issue. I will check the detail. BTW, I'm not sure why the plugin should be disabled. Is it enough to just stop using the plugin?

kazegusuri commented 6 years ago

Okay, I got the details. First one is a big bug and complicated, second one is easy to fix. Both cases are caused by concurrent access to a value.

kazegusuri commented 5 years ago

I think this was fixed.