You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2024/09/27 13:21:00 UTC
[jira] [Updated] (ARTEMIS-5073) Formatting error of some audit log events when using Prometheus JMX Exporter
[ https://issues.apache.org/jira/browse/ARTEMIS-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Bertram updated ARTEMIS-5073:
------------------------------------
Description:
When audit logging is enabled and the Prometheus JMX exporter is used as a Java agent, some errors are written to stdout. It happens when the exporter collects metrics. Username in this case may be null or anonymous.
Reproducible in versions 2.36.0 and 2.37.0.
Steps to reproduce:
# Create Artemis instance.
# Enable base audit logging in {{log4j2.properties}}:
{noformat}
logger.audit_base.level = INFO{noformat}
# Add JMX exporter as Java agent: add following arguments to the {{JAVA_ARGS}} variable in the {{artemis.profile}} (change paths according to the environment):
{noformat}
-javaagent:/path/to/jmx_prometheus_javaagent.jar=9404:/path/to/jmx_exporter_config.yml{noformat}
Example {{jmx_exporter_config.yml}}:
{code:yaml}
lowercaseOutputName: true
lowercaseOutputLabelNames: true
rules:
- pattern: "^org.apache.activemq.artemis<broker=\"([^\"]*)\"><>([^:]*):\\s(.*)"
attrNameSnakeCase: true
name: artemis_$2
type: GAUGE{code}
JMX Exporter can be downloaded [here|https://github.com/prometheus/jmx_exporter/tree/release-1.0.1/docs].
# Start Artemis and access {{http://your-server-name:9404/metrics/}} using a browser or {{curl}} command-line utility.
Event is logged to stdout of Artemis process: [^artemis_log_event.txt].
was:
When audit logging is enabled and JMX exporter is used as a Java agent, some errors are written to stdout. It happens when Prometheus JMX exporter collects metrics. Username in this case may be null or anonymous.
Reproducible in versions 2.36.0 and 2.37.0.
Steps to reproduce:
1. Create Artemis instance.
2. Enable base audit logging in log4j2.properties:
{code:java}
logger.audit_base.level = INFO{code}
3. Add JMX exporter as javaagent: add following arguments to the JAVA_ARGS variable in the artemis.profile (change paths according to the environment):
{code:java}
-javaagent:/path/to/jmx_prometheus_javaagent.jar=9404:/path/to/jmx_exporter_config.yml{code}
Example jmx_exporter_config.yml:
{code:java}
lowercaseOutputName: true
lowercaseOutputLabelNames: true
rules:
- pattern: "^org.apache.activemq.artemis<broker=\"([^\"]*)\"><>([^:]*):\\s(.*)"
attrNameSnakeCase: true
name: artemis_$2
type: GAUGE{code}
JMX Exporter can be downloaded from github: https://github.com/prometheus/jmx_exporter/tree/release-1.0.1/docs
4. Start Artemis, open http://your-server-name:9404/metrics/ using browser or curl command-line utility.
Event is logged to stdout of Artemis process: [^artemis_log_event.txt]
> Formatting error of some audit log events when using Prometheus JMX Exporter
> ----------------------------------------------------------------------------
>
> Key: ARTEMIS-5073
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5073
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.36.0, 2.37.0
> Reporter: Aleksandr Milovidov
> Priority: Minor
> Attachments: artemis_log_event.txt
>
>
> When audit logging is enabled and the Prometheus JMX exporter is used as a Java agent, some errors are written to stdout. It happens when the exporter collects metrics. Username in this case may be null or anonymous.
> Reproducible in versions 2.36.0 and 2.37.0.
> Steps to reproduce:
> # Create Artemis instance.
> # Enable base audit logging in {{log4j2.properties}}:
> {noformat}
> logger.audit_base.level = INFO{noformat}
> # Add JMX exporter as Java agent: add following arguments to the {{JAVA_ARGS}} variable in the {{artemis.profile}} (change paths according to the environment):
> {noformat}
> -javaagent:/path/to/jmx_prometheus_javaagent.jar=9404:/path/to/jmx_exporter_config.yml{noformat}
> Example {{jmx_exporter_config.yml}}:
> {code:yaml}
> lowercaseOutputName: true
> lowercaseOutputLabelNames: true
> rules:
> - pattern: "^org.apache.activemq.artemis<broker=\"([^\"]*)\"><>([^:]*):\\s(.*)"
> attrNameSnakeCase: true
> name: artemis_$2
> type: GAUGE{code}
> JMX Exporter can be downloaded [here|https://github.com/prometheus/jmx_exporter/tree/release-1.0.1/docs].
> # Start Artemis and access {{http://your-server-name:9404/metrics/}} using a browser or {{curl}} command-line utility.
> Event is logged to stdout of Artemis process: [^artemis_log_event.txt].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact