[
https://issues.apache.org/jira/browse/LOG4J2-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17203634#comment-17203634
]
Remko Popma commented on LOG4J2-2937:
-------------------------------------
[~rgoers], I see. I assume that this design has a time-series database on the
querying side (the application monitoring tooling you mentioned). This has some
trade-offs:
* Disadvantage 1: Timestamps are generated by the querying process, rather
than timestamps of the process that is being measured. These will never be
exactly the same. If both machines use PTP, or at least NTP, to prevent
timestamps from going out of sync too much, that probably gives sufficient
precision.
* Disadvantage 2: it is not possible to get more granularity than the rate at
which the monitoring service is querying the process that is being monitored.
* Advantage 1: very efficient memory usage in the process that is being
measured
* Advantage 2: time-efficient in the process that is being measured (although
Log4j already has timestamps, so we would not need to take a new timestamp, but
ok...)
All in all probably acceptable trade-offs. Makes sense.
So we can just provide an API to define and increment counters (for the
application being measured), and an API to list the counters and query their
current value, to be used by the (potentially remote) querying service.
> Provide counters to measure log rate
> ------------------------------------
>
> Key: LOG4J2-2937
> URL: https://issues.apache.org/jira/browse/LOG4J2-2937
> Project: Log4j 2
> Issue Type: New Feature
> Reporter: Dennys Fredericci
> Priority: Major
> Attachments: image-2020-09-28-21-10-13-850.png
>
>
> As a Log4j API user will be really nice to have a way to get the number of
> log calls for each level without any instrumentation or bytecode
> manipulation, something native from log4j API.
> Once this interface is implemented this can be exposed through JMX or used by
> other libraries to send the log rate to monitoring systems such as Datadog,
> NewRelic, Dynatrace, etc. :)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)