我正在akka框架(尤其是2.3版)的帮助下开发Java应用程序。
我需要在运行时监视我的工作角色。更确切地说,我需要获取演员邮箱大小/在职演员数等。

我选择了Kamon framework并尝试将其连接到我的应用程序,但遇到了问题。我根据文档做了所有事情。

正如他们在网站上所说


  将kamon-jmx依赖项添加到您的项目中,并确保它位于
  就是您在运行时的类路径。 Kamon的模块加载器将
  检测到JMX模块在类路径中并自动启动
  它。


好。我添加了kamon-akka,kamon-jmx,kamon-core依赖项(它们都是0.6.7版本),在我的主要方法中添加了一行代码:

public static void main(String[] args) {
    Kamon.start();
    .....
}


我在IDE中按下run键,然后在控制台中收到以下消息:

  ___                           _      ___   _    _                                 ___  ___ _            _
 / _ \                         | |    |_  | | |  | |                                |  \/  |(_)          (_)
/ /_\ \ ___  _ __    ___   ___ | |_     | | | |  | |  ___   __ _ __   __ ___  _ __  | .  . | _  ___  ___  _  _ __    __ _
|  _  |/ __|| '_ \  / _ \ / __|| __|    | | | |/\| | / _ \ / _` |\ \ / // _ \| '__| | |\/| || |/ __|/ __|| || '_ \  / _` |
| | | |\__ \| |_) ||  __/| (__ | |_ /\__/ / \  /\  /|  __/| (_| | \ V /|  __/| |    | |  | || |\__ \\__ \| || | | || (_| |
\_| |_/|___/| .__/  \___| \___| \__|\____/   \/  \/  \___| \__,_|  \_/  \___||_|    \_|  |_/|_||___/|___/|_||_| |_| \__, |
            | |                                                                                                      __/ |
            |_|                                                                                                     |___/

 It seems like your application was not started with the -javaagent:/path-to-aspectj-weaver.jar option but Kamon detected
 the following modules which require AspectJ to work properly:

      kamon-akka, kamon-scala, kamon-play

 If you need help on setting up the aspectj weaver go to http://kamon.io/introduction/get-started/ for more info. On the
 other hand, if you are sure that you do not need or do not want to use the weaver then you can disable this error message
 by changing the kamon.show-aspectj-missing-warning setting in your configuration file.


我已经尝试了以下所有方法:


将kamon-autoweaver添加到依赖项部分
将javaagent参数传递给我的应用程序:
java -javaagent:〜/ .aspectj / aspectj-weaver.jar my-app.jar


但是结果是一样的:AspectJWeaver丢失了。

最佳答案

通过将kamon-akka,kamon-core版本更改为0.5.2并将度量导出到StatsD而不是JMX,解决了此问题。

10-08 08:34