Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on unsupported architecture #12

Open
wbwork opened this issue Jan 8, 2021 · 1 comment
Open

NullPointerException on unsupported architecture #12

wbwork opened this issue Jan 8, 2021 · 1 comment

Comments

@wbwork
Copy link

wbwork commented Jan 8, 2021

What happened

When trying to use Kamon on aarch64, Kamon fails with a NPE:

Exception in thread "main" java.lang.NullPointerException
  at kamon.sigar.SigarProvisioner.transfer(SigarProvisioner.java:209)
  at kamon.sigar.SigarProvisioner.provision(SigarProvisioner.java:173)
  at kamon.system.SystemMetrics$.collectSigarMetrics(SystemMetrics.scala:88)
  at kamon.system.SystemMetrics$.startCollecting(SystemMetrics.scala:72)
  at kamon.system.SystemMetrics.startCollecting(SystemMetrics.scala)
  at com.example.myapp.startKamon(MyApp.java:94)

Investigating I found a 0 byte file native/libsigar-aarch64-linux.so in my application directory. Checking the contents of sigar-loader-1.6.5-rev003.jar I found that this architecture is not included.

Version info

java: openjdk version "1.8.0_275"
Kamon: kamon-core_2.11-1.1.5.jar, kamon-system-metrics_2.11-1.0.1.jar
sigar-loader: sigar-loader-1.6.5-rev003.jar

What I would expect to happen

  • Have system metrics for this architecture
  • Or have a meaningful error message and in best case just have no system metrics, but system continues to work.

Workaround

I build libsigar-aarch64-linux.so myself from this branch and repackaged it into sigar-loader-1.6.5-rev003.jar. This is an very inconvenient workflow, so it would be better to have it directly included.

@SimunKaracic
Copy link

You're using kamon 1.x, please upgrade to 2.x, we're not using Sigar anymore, Oshi is now in charge of getting system metrics!

Is there anything specific keeping you on that version of kamon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants