kubernetes artemis 系列 |promethus + grafana监控 activemq artemis
ActiveMQ Artemis Prometheus Metrics 插件是 ActiveMQ Artemis 消息代理的扩展,它向流行的开源监控系统和时间序列数据库 Prometheus 公开指标。然后,Prometheus 可以按照配置的时间间隔抓取(收集)这些指标,从而可以监控、警报和分析 ActiveMQ Artemis 实例的性能和运行状况。
一、Artemis Prometheus Metrics 插件介绍
ActiveMQ Artemis Prometheus Metrics 插件是 ActiveMQ Artemis 消息代理的扩展,它向流行的开源监控系统和时间序列数据库 Prometheus 公开指标。然后,Prometheus 可以按照配置的时间间隔抓取(收集)这些指标,从而可以监控、警报和分析 ActiveMQ Artemis 实例的性能和运行状况。
项目地址:
https://github.com/rh-messaging/artemis-prometheus-metrics-plugin
二、配置Metrics 插件
git clone https://github.com/rh-messaging/artemis-prometheus-metrics-plugin.git
yum install maven
mvn install 构建
我个人是直接使用官方构建好的包,如果你也使用官网的包就不用下载构建上面的artemis-prometheus-metrics-plugin了;
https://maven.repository.redhat.com/ga/org/apache/activemq/artemis-prometheus-metrics-plugin/1.0.0.CR1-redhat-00010/artemis-prometheus-metrics-plugin-1.0.0.CR1-redhat-00010.jar
https://maven.repository.redhat.com/ga/org/apache/activemq/artemis-prometheus-metrics-plugin-servlet/1.0.0.CR1-redhat-00010/artemis-prometheus-metrics-plugin-servlet-1.0.0.CR1-redhat-00010.war
将jar包和war包下载到本地。
将jar包 cp至lib目录下,war包cp 至web目录下(web目录需自行创建)
$ cp amq-broker-7.9.0/lib/artemis-prometheus-metrics-plugin-1.0.0.CR1-redhat-00010.jar <broker_instance_dir>/lib
mkdir /home/ubuntu/artemis-broker/web
cp artemis-prometheus-metrics-plugin-servlet-1.0.0.CR1-redhat-00010.war artemis-broker/web/
/etc/broker.xml 配置
<metrics>
<jvm-gc>true</jvm-gc>
<jvm-memory>true</jvm-memory
<jvm-threads>true</jvm-threads>
<plugin class-name="org.apache.activemq.artemis.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"/>
</metrics>

/etc/bootstrap.xml配置
<app url="metrics" war="metrics.war"/>

配置后就重启artemis即可
测试 curl 10.103.29.218:8161/metrics/
如果看到artemis指标就成功了
三、promethus配置
在配置文件中加上地址端口即可;例如 10.103.29.218:8161
四·、grafana面板配置
导入
ActiveMQArtemisSampleDashboard.json 即可
https://github.com/artemiscloud/grafana/blob/master/ActiveMQArtemisSampleDashboard.json
更多推荐
所有评论(0)