Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D6308200D07 for ; Sun, 1 Oct 2017 11:24:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D4D801609D9; Sun, 1 Oct 2017 09:24:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F23EC1609C0 for ; Sun, 1 Oct 2017 11:24:32 +0200 (CEST) Received: (qmail 41638 invoked by uid 500); 1 Oct 2017 09:24:27 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 41627 invoked by uid 99); 1 Oct 2017 09:24:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Oct 2017 09:24:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8BCEC1808DC for ; Sun, 1 Oct 2017 09:24:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.129 X-Spam-Level: *** X-Spam-Status: No, score=3.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id UJL6mHoFEWLs for ; Sun, 1 Oct 2017 09:24:24 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 942515F239 for ; Sun, 1 Oct 2017 09:24:24 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id u130so5153122oib.11 for ; Sun, 01 Oct 2017 02:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+8xtr8PdV4NJ9ryKW5+s+X/AJvnF1NslmGaYrBZy8mI=; b=X3vkjAfrfKJ+dHNaUdOQTgRqzI8SXjmlLkEzMgIHi7HmVJ/n4xMXW/fSD6tc16vZEr F8fDXEYSWGDMF/CRg8KXlxGSbbxW2ubra+fSDSiYXfgN7djc5W8UcYvoXn545l+MJZqe VSG7pJZqnqq9y4GlnV4Ip2ZI6A+BO4g6LHObwaTV1clzz4g2GJH2x7Z4WtY3pPEHgrPS FO4QlYOVnwIOK/uVSWw5ggh20NRj5R42tklpBWWPPfDCz8dNtzy2rDEjWFvTo3JSsnDs Y85M1NEb+jtpoEQbePvSKYAAoRlxsUdgAVHElBt1dDeAtgRCxbh2rwVB6e9WzzIhpZlS sK6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+8xtr8PdV4NJ9ryKW5+s+X/AJvnF1NslmGaYrBZy8mI=; b=adqPBBSD8ScnJG6i++QF+VtCrNzDEzWdHaIAnhOM43i9B7ZZ2h3SpwhZrrc0RNSfBE HiC9KRfZGNW450Wl1l8dTVWQtTtrmG4iDqUjpuNR+/1zTspxD6xYW+uC3XrkOeUnUyLJ O69QMF8rswEuwyjizq6X2Tcy6V4Ee/8cnmo2Hqe+UCTP7K1o35tDUdT+gsxTvbfsh5vd 15wN0ZSuwjnqUU0E4st8cOVHzZBi7KrQCnWv/W77RT0oGh6Oy1hBucoW4fa1VKZXsCDX RzK0SHLo4DWscWoh/vLtU9+GeUTCF7FF55JYMCmttPaP72Sb3OqYKPTYyoSTVsqfvP1S JHXA== X-Gm-Message-State: AMCzsaUUHAygdQ+OhcMia06SIMeTm3onX5fJkZxRAZtL458fZb6Hnrjk xab71QtUnOlIQNSHTR9xZwaGGg07zcQfyDDk6TgdRw== X-Google-Smtp-Source: AOwi7QCAe5+NtEVYvgVBH5IaNhQbGTp87mnhFJIFudKCcm/gU/SkCH+5wY+2dOGa48T02C886QkabupYdACCNVSYO0U= X-Received: by 10.202.194.213 with SMTP id s204mr4745219oif.401.1506849858129; Sun, 01 Oct 2017 02:24:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.22.157 with HTTP; Sun, 1 Oct 2017 02:24:17 -0700 (PDT) In-Reply-To: <64568E59-EA9B-4D98-B53F-F2AD02901440@gmail.com> References: <64568E59-EA9B-4D98-B53F-F2AD02901440@gmail.com> From: Yaroslav Skopets Date: Sun, 1 Oct 2017 11:24:17 +0200 Message-ID: Subject: Re: Do you have any plans to instrument `log4j2` with metrics? To: Log4J Users List Content-Type: multipart/alternative; boundary="001a113d65c886147d055a78d29d" archived-at: Sun, 01 Oct 2017 09:24:34 -0000 --001a113d65c886147d055a78d29d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks a lot already! @Ralph Besides `AsyncAppender`, other good candidates for instrumentation would be `BurstFilter` and `DefaultErrorHandler`. Another angle to this are custom plugins. E.g., we've got our own `RedisAppender` that is guarded by a rate limit, a throughput limit, etc. And while we would like to expose how those limits work out in practice, we don't see examples/guidelines in `log4j2` code. By the way, how could we integrate our own plugin with JMX ? So that it would be registered/unregistered at the same time as components provided out-of-the-box. @Remko Regarding performance of counters, I've just double checked that both `Dropwizard` and `Prometheus` address this problem by including a copy of JDK 8 `LongAdder`/`DoubleAdder` into their own codebase (e.g., https://github.com/dropwizard/metrics/blob/3.2-development/metrics-core/src= /main/java/com/codahale/metrics/LongAdder.java#L37 and https://github.com/prometheus/client_java/blob/master/simpleclient/src/main= /java/io/prometheus/client/DoubleAdder.java#L35 ) So, may be `log4j2` could introduce a notion of `AdderFactory` and use it for counters and gauges? On Sun, Oct 1, 2017 at 3:09 AM, Remko Popma wrote: > Ralph beat me to it. :-) > > We could add counters to various components and make those counters > visible via JMX. Surely the libraries you mention know how to consume > metrics from a JMX data source. > > To me a key point would be to avoid impacting performance while updating > counters in multi-threaded situations. > > Patches are welcome! > > Remko > > (Shameless plug) Every java main() method deserves http://picocli.info > > > On Oct 1, 2017, at 10:00, Ralph Goers > wrote: > > > > Development of Log4j happens based on a) what committers are interested > in doing or b) patches that are submitted by users. Sometimes we discuss > things we want to develop in advance but most of the time we decide to do > something and just do it. > > > > You are the first person to ask for metrics from the AsyncAppender. We > already have a JMX component so I would imagine reporting of those metric= s > would be integrated with that if it was implemented. > > > > I=E2=80=99ve not heard anyone mention integrating with those 3 librarie= s. > > > > As I noted above, patches are always welcome! > > > > Ralph > > > > > >> On Sep 30, 2017, at 4:16 PM, Yaroslav Skopets > wrote: > >> > >> Hi guys, > >> > >> I was going through the source code of `log4j2` and didn't notice any > >> metrics that could tell how the system is doing. > >> > >> Most importantly, classes like `AsyncAppender` might just silently dro= p > >> errors instead of making such incidents noticeable. > >> > >> So, do you have any plans to introduce metrics for those cases? And, > >> ideally, provide bindings to libraries like `Dropwizard`, `Prometheus`= , > >> `Micrometer` ? > >> > >> Thanks in advance! > >> > >> -- > >> Best regards, > >> Yaroslav Skopets > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org > > --=20 Best regards, Yaroslav Skopets --001a113d65c886147d055a78d29d--