qos-ch / logback

The reliable, generic, fast and flexible logging framework for Java.

Home Page:http://logback.qos.ch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Observability of async logging queue

mathieufortin01 opened this issue · comments

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.

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.

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

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

@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 ?

@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.