qos-ch / logback

The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
Other
2.98k stars 1.28k forks source link

Observability of async logging queue #754

Open mathieufortin01 opened 8 months ago

mathieufortin01 commented 8 months ago

Hello. Is there any way to gather metrics on the internal queue used by async logger? Things like current capacity, nb of info logs dropped, nb of logs dropped when full, etc.

If not available would that be an interesting contribution?

Thanks.

tomershafir commented 7 months ago

I think the library must export standard metrics. Buffer monitoring (cap, size, write count, flush count) and rotation monitoring (file set state, rotation count) are also necessary.

ceki commented 7 months ago

@mathieufortin01 Indeed, there seems to be interest in it.

mathieufortin01 commented 7 months ago

Great. Whats the best place to discuss scope/solution? As a side note, this could be a contribution by Autodesk.

ceki commented 7 months ago

@mathieufortin01 Here?

mathieufortin01 commented 7 months ago

@ceki So i would start with metrics around buffer usage in async mode, keeping in mind that other metrics could be added. Question is: Should the lib define metrics interface for major aggregators in the lib itself (like HikariCP is doing) or should it just provide hooks to receive metrics and caller is responsible to hook them up with micrometer, prometheus, etc ?

ceki commented 7 months ago

@mathieufortin01 I would keep it as simple as possible. Providing data around buffer usage sounds good, keeping in mind that other metrics could be added later as necessary. At this early stage, providing explicit support for metrics frameworks seems premature. We can always revisit the issue later.

If you wish to add support for metrics frameworks, this can be done in a separate logback extension.