[
https://issues.apache.org/jira/browse/ARTEMIS-4655?focusedWorklogId=907591&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-907591
]
ASF GitHub Bot logged work on ARTEMIS-4655:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 29/Feb/24 11:23
Start Date: 29/Feb/24 11:23
Worklog Time Spent: 10m
Work Description: gemmellr commented on code in PR #4830:
URL: https://github.com/apache/activemq-artemis/pull/4830#discussion_r1507420822
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/MetricsManager.java:
##########
@@ -86,6 +87,9 @@ public MetricsManager(String brokerName,
if (metricsConfiguration.isUptime()) {
new UptimeMetrics().bindTo(meterRegistry);
}
+ if (metricsConfiguration.isLogging()) {
+ new Log4j2Metrics().bindTo(meterRegistry);
+ }
Review Comment:
Not sure the new doc is clear enough / goes far enough. This thing actually
depends on Log4J API and Log4J Core, but neither the broker (no dep at all) or
micrometer core (optional dep) have a hard dep on them to bring them in...so
for anyone e.g embedding, it seems likely to blow up at this point unless some
other dep has actually brought in log4j-core. Our tests happen to do that and
so wont show any issue.
https://github.com/micrometer-metrics/micrometer/blob/v1.12.2/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/Log4j2Metrics.java
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/LoggingMetricsTest.java:
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <br>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <br>
Review Comment:
Shouldnt have the <br> tags in the licence comment and the URL isnt indented
as it normally is. See most other java files in the codebase (and if using an
auto-insert, perhaps update it).
Issue Time Tracking
-------------------
Worklog Id: (was: 907591)
Time Spent: 40m (was: 0.5h)
> Report logging metrics
> ----------------------
>
> Key: ARTEMIS-4655
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4655
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> External systems (e.g. Prometheus & Grafana) can consume metrics to visualize
> and monitor the health and performance of the broker. These systems often
> support configurable alerts to inform administrators of problems (e.g. long
> GC pauses, message accumulation, etc.). It may be useful to configure alerts
> for {{ERROR}} or {{WARN}} events in the log which may go unnoticed otherwise.
> The
> [Log4j2Metrics.java|https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/Log4j2Metrics.java]
> provided by Micrometer will report metrics for each logging category so
> administrators can see when unexpected events occur.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)