Quarkus extension: quarkus-opentelemetry-exporter-gcp
Quarkiverse extension?: Yes
Exporters are OpenTelemetry SDK Plugins which implement the Exporter interface, and emit telemetry to consumers, usually observability vendors. This exporter sends data to Google Cloud Platform using opentelemetry-operations-java library.
For more information, check the Quarkiverse OTel Exporter guide, and the Google Cloud guides.
WARN: This example is only experimental and you should verify it works as expected - this is only a possible theoretical solution.
- Add the extension:
./kc-extension.sh add io.quarkiverse.opentelemetry.exporter:quarkus-opentelemetry-exporter-gcp:3.16.2.0
- Add Quarkus properties in root
quarkus.properties
to disable the default exporter and enable the GCP:
quarkus.otel.exporter.otlp.enabled=false
quarkus.opentelemetry.tracer.exporter.gcp.enabled=true
- Build the extended Keycloak distribution:
./kc-extension.sh build
- Verify it works by running the distribution in dev mode (access at
localhost:8080
):
./kc-extension.sh start-dev --tracing-enabled=true
The generated distribution should be available in the root directory with prefix keycloak-extended-*.tar.gz
.
- Create a builder image:
./kc-extension.sh image
- Create your Containerfile/Dockerfile with the builder image
FROM localhost/keycloak-extended:nightly AS builder
# Put your build-time config options
ENV KC_TRACING_ENABLED true
RUN /opt/keycloak/bin/kc.sh build
FROM localhost/keycloak-extended:nightly
COPY --from=builder /opt/keycloak/ /opt/keycloak/
# Put your runtime config options
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
- Execute the Containerfile/Dockerfile
podman build --tag keycloak-otel-gcp -f Dockerfile .
- Start the optimized image
podman run -p 8080:8080 \
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
-e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
keycloak-otel-gcp \
start --hostname-strict=false --http-enabled=true --optimized
You should be able to use OpenTelemetry Exporter for GCP now.
For more information, check the Quarkiverse OTel Exporter guide, and the Google Cloud guides.