Comments (7)
Glad I could help :)
from akka-http-metrics.
Hi @gunjdesai
Thanks a lot for the detailed report. It's actually not your fault but mine.
I've actually introduced a regression in the the 1.1.0
release in recordMetrics
:
recordMetrics
has a default value for the implicit ExecutionContextExecutor
set to null (as akka-http does on the route conversion). I forgot to override the null with a default value for the connection metrics. I Will create a bugfix release.
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.
from akka-http-metrics.
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 /metrics
route.
Error during processing of request: 'java.lang.NullPointerException (No error message supplied)'. Completing with 500 Internal Server Error response. To change default exception handling behavior, provide a custom ExceptionHandler.
java.lang.NullPointerException
at fr.davit.akka.http.metrics.prometheus.marshalling.PrometheusMarshallers.$anonfun$marshaller$1(PrometheusMarshallers.scala:36)
at akka.http.scaladsl.marshalling.Marshaller$.$anonfun$opaque$2(Marshaller.scala:162)
at akka.http.scaladsl.marshalling.Marshalling$Opaque.$anonfun$map$7(Marshaller.scala:215)
at akka.http.scaladsl.marshalling.Marshal.$anonfun$toResponseFor$1(Marshal.scala:71)
at akka.http.scaladsl.util.FastFuture$.$anonfun$map$1(FastFuture.scala:23)
at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45)
at akka.http.scaladsl.util.FastFuture$.map$extension(FastFuture.scala:23)
at akka.http.scaladsl.marshalling.Marshal.toResponseFor(Marshal.scala:55)
at akka.http.scaladsl.marshalling.ToResponseMarshallable.apply(ToResponseMarshallable.scala:17)
at akka.http.scaladsl.marshalling.ToResponseMarshallable.apply$(ToResponseMarshallable.scala:16)
at akka.http.scaladsl.marshalling.ToResponseMarshallable$$anon$1.apply(ToResponseMarshallable.scala:22)
at akka.http.scaladsl.server.RequestContextImpl.complete(RequestContextImpl.scala:42)
at akka.http.scaladsl.server.directives.RouteDirectives.$anonfun$complete$1(RouteDirectives.scala:47)
at akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19)
at akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResult$2(BasicDirectives.scala:68)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$textract$2(BasicDirectives.scala:161)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRequestContext$2(BasicDirectives.scala:45)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$textract$2(BasicDirectives.scala:161)
at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation.$anonfun$$tilde$2(RouteConcatenation.scala:47)
at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45)
at akka.http.scaladsl.util.FastFuture$.flatMap$extension(FastFuture.scala:26)
at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation.$anonfun$$tilde$1(RouteConcatenation.scala:44)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResultWith$2(BasicDirectives.scala:74)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$textract$2(BasicDirectives.scala:161)
at akka.http.scaladsl.server.directives.ExecutionDirectives.$anonfun$handleExceptions$2(ExecutionDirectives.scala:32)
at akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$textract$2(BasicDirectives.scala:161)
at akka.http.scaladsl.server.Route$.$anonfun$asyncHandler$1(Route.scala:86)
at fr.davit.akka.http.metrics.core.scaladsl.server.HttpMetricsRoute.$anonfun$recordMetricsAsync$3(HttpMetricsRoute.scala:90)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon$31.onPush(Ops.scala:1401)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:541)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:624)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:501)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:599)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:768)
at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:783)
at akka.actor.Actor.aroundReceive(Actor.scala:534)
at akka.actor.Actor.aroundReceive$(Actor.scala:532)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:690)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:573)
at akka.actor.ActorCell.invoke(ActorCell.scala:543)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:269)
at akka.dispatch.Mailbox.run(Mailbox.scala:230)
at akka.dispatch.Mailbox.exec(Mailbox.scala:242)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Any idea what i am missing here ?
from akka-http-metrics.
I tested the marshaling too yesterday, and it serialized the metrics properly.
Release 1.1.1
should be available now. Can you update and give it another try ?
from akka-http-metrics.
Tried 1.1.1
, dont need the variable for ExecutionContextExecutor
anymore, thank you so much for that update but still facing issue with the metrics api. I am assuming its because of the way, i have initialised it and not because of the library. Will try to debug
Below is the code FYR
import fr.davit.akka.http.metrics.core.scaladsl.server.HttpMetricsDirectives._
import fr.davit.akka.http.metrics.prometheus.marshalling.PrometheusMarshallers._
import com.api.server.Start.registry
object Metrics {
val metricRoute = path("metrics") {
get {
metrics(registry)
}
}
val routes = this.metricRoute
}
from akka-http-metrics.
looking at the stack trace, it seems the registry, or the underlying registry is null.
How is your the com.api.server.Start.registry
initialized ?
from akka-http-metrics.
@RustedBones, extremely sorry, very basic miss, registry was imported from a variable initialised in try - catch block, hence was null.
Thank you so much for helping me out really appreciate it. Kudos !!
from akka-http-metrics.
Related Issues (20)
- Error in stage [fr.davit.akka.http.metrics.core.MeterStage$$anon$1-MeterStage]: No value present HOT 10
- Create grafana dashboard HOT 1
- Hiding metrics route from scrapping HOT 4
- Extension methods from HttpMetrics break Http().newServerAt HOT 5
- Add a method bindFlow(handler: Flow[I,O,Mat]) to HttpMetricsServerBuilder HOT 2
- Getting error when using bindFlow : `.Error in stage [fr.davit.akka.http.metrics.core.MeterStage$$anon$1-MeterStage]: No value present HOT 2
- akka grpc
- 5xx and 4xx responses go to unlabelled when handled with AKKA `ExecutionDirectives.handleExceptions`
- Request/response headers as metric dimensions HOT 2
- Add directive to provide custom dimensions HOT 7
- Status and method labels are swapped in Prometheus metrics
- 1.7.0 not found in repos HOT 2
- bug: prometheus label issues in 1.7.0 HOT 8
- Support for Apache Pekko HOT 4
- StatusGroup / Path for requests? HOT 2
- No akka_http_responses_size_bytes_bucket for streamed endpoints
- Bug 1.4.0: java.lang.IllegalArgumentException: requirement failed: Responses with this status code must have an empty entity HOT 5
- Unable to get started with akk-http-metrics for scala Akka HTTP and prometheus. HOT 17
- Problem with big requests (>~100kb) HOT 9
- Instantiate HttpMetricsNames the same way as HttpMetricsSettings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka-http-metrics.