-
Notifications
You must be signed in to change notification settings - Fork 23
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 when running with recordMetrics #51
Comments
Hi @gunjdesai Thanks a lot for the detailed report. It's actually not your fault but mine.
For now you can add this to your code: implicit val system: ActorSystem = ActorSystem()
implicit val ec: ExecutionContextExecutor = implicitly[Materializer].executionContext This import the default materializer explicitly and should make your project run. Sorry for the inconvenience. |
Thanks @RustedBones for looking into this so fast, adding the execution context executor does work for other routes, but still facing an issue while trying
Any idea what i am missing here ? |
I tested the marshaling too yesterday, and it serialized the metrics properly. |
Tried
|
looking at the stack trace, it seems the registry, or the underlying registry is null. |
@RustedBones, extremely sorry, very basic miss, registry was imported from a variable initialised in try - catch block, hence was null. |
Glad I could help :) |
I am trying to use the
akka-http-metrics-prometheus
registryScala Version: 2.12.11
Akka Http Version: 10.1.12
Akka Http Metrics Prometheus Version: 1.1.0
My Code looks like this
When i try to run any route, I am facing a NullPointerException.
I am pretty sure that i have made some sort of mistake during initialisation and hence the issue.
Would really appreciate if you can point me in the right direction.
Thanks
The text was updated successfully, but these errors were encountered: