Skip to content

Latest commit

 

History

History
89 lines (57 loc) · 2.73 KB

otel-gcp-exporter.md

File metadata and controls

89 lines (57 loc) · 2.73 KB

OpenTelemetry Exporter for Google Cloud Platform (experimental)

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.

Guide

  1. Add the extension:
./kc-extension.sh add io.quarkiverse.opentelemetry.exporter:quarkus-opentelemetry-exporter-gcp:3.16.2.0
  1. 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
  1. Build the extended Keycloak distribution:
./kc-extension.sh build
  1. Verify it works by running the distribution in dev mode (access at localhost:8080):
./kc-extension.sh start-dev --tracing-enabled=true

Container support

The generated distribution should be available in the root directory with prefix keycloak-extended-*.tar.gz.

  1. Create a builder image:
./kc-extension.sh image
  1. 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"]
  1. Execute the Containerfile/Dockerfile
podman build --tag keycloak-otel-gcp -f Dockerfile .
  1. 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

Summary

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.