This is a demonstrator application using Helidon that hooks into Google Cloud Operations suite of Logging, Monitoring and Tracing:
- Cloud Logging: Java Util Log Handlers using asynchronous processing,
- Cloud Monitoring: Microprofile Metrics,
- Cloud Tracing: Microprofile Trace via OpenTelemetry API and log message correlation,
- Cloud Error Reporting: all
ERROR
messages flagged augmented withserviceContext
version and name fromMANIFEST.MF
.
This has 3 types of images:
- vanilla: OpenJDK Java 16 Alpine JRE,
- jlink: Java Platform Module System OpenJDK Java 16 Alpine,
- native: GraalVM statically linked binary off
scratch
using MUSL libc.
They all have their benefits but also pain-points.
Image | Size | Start | Stop | Notes |
---|---|---|---|---|
helidon:vanilla |
236MB | 3,735ms | 22ms | APKO jre17 image |
helidon:jlink |
148MB | 2,470ms | 18ms | APKO JLink image |
helidon:native |
Build failing |
⚠️ Native image does have some issues around flushing final logs (see Limitations) soSTOP
is artificially fast.
To be able to use the GCP credentials when running locally (via Docker for Desktop or similar):
gcloud auth application-default login
docker run --rm -it `
-p 8080:8080 `
-e CLOUDSDK_CONFIG=/gcloud `
-v $Env:APPDATA/gcloud/:/gcloud:ro `
-v $pwd/error/:/error:rw `
helidon-gcp:<tag>
docker run `
-v $pwd/:/helidon:rw `
-v $HOME/.m2/repository/:/root/.m2/repository/:rw `
-v $Env:APPDATA/gcloud/:/gcloud:ro `
-p 8080:8080 `
--entrypoint bash `
-it `
--rm `
helidon/jdk17-graalvm-maven:21.3.0
- oracle/graal#3351 Just SegFaults every time. On disabling Tracing, the issue appears to stop.