Last active
October 9, 2021 02:03
-
-
Save mattwelke/12cb6503dfb90d1a9b445ab7babc33ab to your computer and use it in GitHub Desktop.
Javalin and GCP Monitoring with custom runtime issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[main] INFO io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability. | |
[main] INFO io.javalin.Javalin - | |
__ __ _ __ __ | |
/ /____ _ _ __ ____ _ / /(_)____ / // / | |
__ / // __ `/| | / // __ `// // // __ \ / // /_ | |
/ /_/ // /_/ / | |/ // /_/ // // // / / / /__ __/ | |
\____/ \__,_/ |___/ \__,_//_//_//_/ /_/ /_/ | |
https://javalin.io/documentation | |
Defaulting Uptime to NOIMPL due to (java.lang.UnsupportedOperationException) Implementation not available in this environment | |
[main] INFO org.eclipse.jetty.util.log - Logging initialized @-1ms to org.eclipse.jetty.util.log.Slf4jLog | |
[main] INFO io.javalin.Javalin - Starting Javalin ... | |
[main] INFO io.javalin.Javalin - You are running Javalin 4.1.0 (released October 2, 2021). | |
[main] INFO io.javalin.Javalin - Listening on http://localhost:7000/ | |
[main] INFO io.javalin.Javalin - Javalin started in 85ms \o/ | |
[qtp858423246-40] INFO com.gcma.App - Received request for metric requests. | |
[qtp858423246-40] INFO com.gcma.App - Parsed data point: DataPoint[labels={day_of_week=Friday, sender=Matt}, value=1.23] | |
[grpc-default-executor-0] WARN io.grpc.netty.shaded.io.netty.channel.DefaultChannelId - Failed to find the current process ID from ''; using a random value: 832851030 | |
[qtp858423246-40] WARN io.javalin.Javalin - Uncaught exception | |
com.google.api.gax.rpc.DeadlineExceededException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 11.987863400s. [closed=[], open=[[buffered_nanos=133560800, buffered_nanos=11854480800, waiting_for_connection]]] | |
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:51) | |
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72) | |
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60) | |
at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97) | |
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68) | |
at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1074) | |
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30) | |
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1213) | |
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983) | |
at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771) | |
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:563) | |
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533) | |
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:463) | |
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:427) | |
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:460) | |
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:557) | |
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:69) | |
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:738) | |
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:717) | |
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) | |
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) | |
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) | |
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) | |
at java.base/java.lang.Thread.run(Unknown Source) | |
Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed | |
at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57) | |
at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112) | |
at com.google.cloud.monitoring.v3.MetricServiceClient.createTimeSeries(MetricServiceClient.java:1526) | |
at com.gcma.TimeSeriesSender.sendDataPoint(TimeSeriesSender.java:65) | |
at com.gcma.App.lambda$main$0(App.java:49) | |
at io.javalin.core.security.SecurityUtil.noopAccessManager(SecurityUtil.kt:20) | |
at io.javalin.http.JavalinServlet.addHandler$lambda-5(JavalinServlet.kt:113) | |
at io.javalin.http.JavalinServlet$service$tryBeforeAndEndpointHandlers$1.invoke(JavalinServlet.kt:44) | |
at io.javalin.http.JavalinServlet$service$tryBeforeAndEndpointHandlers$1.invoke(JavalinServlet.kt:39) | |
at io.javalin.http.JavalinServlet.service$tryWithExceptionMapper(JavalinServlet.kt:129) | |
at io.javalin.http.JavalinServlet.service$tryBeforeAndEndpointHandlers(JavalinServlet.kt:39) | |
at io.javalin.http.JavalinServlet.service(JavalinServlet.kt:87) | |
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) | |
at io.javalin.jetty.JavalinJettyServlet.service(JavalinJettyServlet.kt:58) | |
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) | |
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) | |
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) | |
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) | |
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) | |
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) | |
at io.javalin.jetty.JettyServer$start$wsAndHttpHandler$1.doHandle(JettyServer.kt:52) | |
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) | |
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) | |
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) | |
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) | |
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) | |
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) | |
at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179) | |
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) | |
at org.eclipse.jetty.server.Server.handle(Server.java:516) | |
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) | |
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) | |
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) | |
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) | |
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) | |
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) | |
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) | |
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) | |
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) | |
... 1 more | |
Caused by: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 11.987863400s. [closed=[], open=[[buffered_nanos=133560800, buffered_nanos=11854480800, waiting_for_connection]]] | |
at io.grpc.Status.asRuntimeException(Status.java:535) | |
... 13 more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of custom Java runtime using jlink in a multi-stage container build | |
FROM mcr.microsoft.com/openjdk/jdk:16-ubuntu as runtime-build | |
# Create a custom Java runtime | |
RUN $JAVA_HOME/bin/jlink \ | |
--add-modules java.base,java.logging,java.net.http \ | |
--strip-debug \ | |
--no-man-pages \ | |
--no-header-files \ | |
--compress=2 \ | |
--output /javaruntime | |
# Define your base image. You may use any base OS and version of your choice. | |
FROM debian:buster-slim | |
ENV JAVA_HOME /usr/lib/jvm/msopenjdk-16-amd64 | |
ENV PATH "${JAVA_HOME}/bin:${PATH}" | |
COPY --from=runtime-build /javaruntime $JAVA_HOME | |
# Continue with your application deployment | |
RUN mkdir /opt/app | |
COPY app/build/libs/app-all.jar /opt/app/japp.jar | |
CMD ["java", "-jar", "/opt/app/japp.jar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[main] INFO io.javalin.Javalin - | |
__ __ _ __ __ | |
/ /____ _ _ __ ____ _ / /(_)____ / // / | |
__ / // __ `/| | / // __ `// // // __ \ / // /_ | |
/ /_/ // /_/ / | |/ // /_/ // // // / / / /__ __/ | |
\____/ \__,_/ |___/ \__,_//_//_//_/ /_/ /_/ | |
https://javalin.io/documentation | |
[main] INFO org.eclipse.jetty.util.log - Logging initialized @432ms to org.eclipse.jetty.util.log.Slf4jLog | |
[main] INFO io.javalin.Javalin - Starting Javalin ... | |
[main] INFO io.javalin.Javalin - You are running Javalin 4.1.0 (released October 2, 2021). | |
[main] INFO io.javalin.Javalin - Listening on http://localhost:7000/ | |
[main] INFO io.javalin.Javalin - Javalin started in 78ms \o/ | |
[qtp611289995-40] INFO com.gcma.App - Received request for metric requests. | |
[qtp611289995-40] INFO com.gcma.App - Parsed data point: DataPoint[labels={day_of_week=Friday, sender=Matt}, value=1.23] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example using MS Build of OpenJDK image directly | |
FROM mcr.microsoft.com/openjdk/jdk:16-ubuntu | |
# Continue with your application deployment | |
RUN mkdir /opt/app | |
COPY app/build/libs/app-all.jar /opt/app/japp.jar | |
CMD ["java", "-jar", "/opt/app/japp.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment