Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ARG MYSQL_VERSION

ARG JMX_PROMETHEUS_VERSION=1.0.1

# --- OpenTelemetry Java Agent version argument ---
ARG OPENTELEMETRY_AGENT_VERSION=2.19.0

RUN apk add --no-cache \
bash \
ca-certificates \
Expand All @@ -30,12 +33,18 @@ COPY settings.xml download.sh cibseven-run.sh cibseven-tomcat.sh cibseven-wildfl
RUN /tmp/download.sh
COPY wait_for_it-lib.sh /camunda/

# --- Create javaagent directory and download the OpenTelemetry agent ---
RUN mkdir -p /camunda/javaagent && \
wget -O /camunda/javaagent/opentelemetry-javaagent-${OPENTELEMETRY_AGENT_VERSION}.jar \
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_AGENT_VERSION}/opentelemetry-javaagent.jar

##### FINAL IMAGE #####

FROM alpine:3.22

ARG VERSION=2.1.0
ARG OPENTELEMETRY_AGENT_VERSION=2.19.0
ENV OPENTELEMETRY_AGENT_VERSION=$OPENTELEMETRY_AGENT_VERSION

ENV DB_DRIVER=
ENV DB_URL=
Expand All @@ -52,11 +61,23 @@ ENV WAIT_FOR_TIMEOUT=30
ENV TZ=UTC
ENV DEBUG=false
ENV JAVA_OPTS=""

# --- Use OpenTelemetry agent by default ---
ENV JAVA_TOOL_OPTIONS="-javaagent:/camunda/javaagent/opentelemetry-javaagent-${OPENTELEMETRY_AGENT_VERSION}.jar"

ENV JMX_PROMETHEUS=false
ENV JMX_PROMETHEUS_CONF=/camunda/javaagent/prometheus-jmx.yml
ENV JMX_PROMETHEUS_PORT=9404

EXPOSE 8080 8000 9404
# OpenTelemetry default exporter settings (all exporters disabled, user must configure)
ENV OTEL_SERVICE_NAME=cibseven-java17 \
OTEL_JMX_CONFIG=/camunda/javaagent/jmx_config.yaml,/camunda/javaagent/jmx_custom_config.yaml \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORTER=none \
OTEL_TRACES_EXPORTER=none \
OTEL_EXPORTER_PROMETHEUS_PORT=9464

EXPOSE 8080 8000 9404 9464

# Downgrading wait-for-it is necessary until this PR is merged
# https://github.com/vishnubob/wait-for-it/pull/68
Expand All @@ -81,3 +102,7 @@ ENTRYPOINT ["/sbin/tini", "--"]
CMD ["./cibseven.sh"]

COPY --chown=camunda:camunda --from=builder /camunda .

# --- Add JMX config files (ensure these are present in your build context) ---
COPY opentelemetry/jmx_config.yaml /camunda/javaagent/jmx_config.yaml
COPY opentelemetry/jmx_custom_config.yaml /camunda/javaagent/jmx_custom_config.yaml
31 changes: 31 additions & 0 deletions opentelemetry/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
cibseven:
image: cibseven/cibseven:tomcat-amd64
container_name: cibseven
environment:
OTEL_METRICS_EXPORTER: "otlp"
OTEL_LOGS_EXPORTER: "otlp"
OTEL_TRACES_EXPORTER: "otlp"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4318"
ports:
- 8080:8080
- 9464:9464
depends_on:
otel-collector:
condition: service_started
networks:
- otelnet

otel-collector:
image: otel/opentelemetry-collector:latest
container_name: otel-collector
ports:
- "4318:4318"
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
networks:
- otelnet

networks:
otelnet:
51 changes: 51 additions & 0 deletions opentelemetry/jmx_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
rules:
- bean: java.lang:type=OperatingSystem
mapping:
AvailableProcessors:
metric: java_lang_operatingsystem_availableprocessors
type: updowncounter
desc: java_lang_operatingsystem_availableprocessors
ProcessCpuLoad:
metric: java_lang_operatingsystem_processcpuload
type: updowncounter
desc: java_lang_operatingsystem_processcpuload. The recent cpu usage for the Java Virtual Machine process.
SystemCpuLoad:
metric: java_lang_operatingsystem_systemcpuload
type: updowncounter
desc: java_lang_operatingsystem_systemcpuload. The recent cpu usage for the whole system.
ProcessCpuTime:
metric: java_lang_operatingsystem_processcputime
type: updowncounter
desc: java_lang_operatingsystem_processcputime
SystemLoadAverage:
metric: java_lang_operatingsystem_systemloadaverage
type: updowncounter
desc: java_lang_operatingsystem_systemloadaverage
CommittedVirtualMemorySize:
metric: java_lang_operatingsystem_committedvirtualmemorysize
type: updowncounter
desc: java_lang_operatingsystem_committedvirtualmemorysize
FreePhysicalMemorySize:
metric: java_lang_operatingsystem_freephysicalmemorysize
type: updowncounter
desc: java_lang_operatingsystem_freephysicalmemorysize
TotalPhysicalMemorySize:
metric: java_lang_operatingsystem_totalphysicalmemorysize
type: updowncounter
desc: java_lang_operatingsystem_totalphysicalmemorysize
FreeSwapSpaceSize:
metric: java_lang_operatingsystem_freeswapspacesize
type: updowncounter
desc: java_lang_operatingsystem_freeswapspacesize
TotalSwapSpaceSize:
metric: java_lang_operatingsystem_totalswapspacesize
type: updowncounter
desc: java_lang_operatingsystem_totalswapspacesize
OpenFileDescriptorCount:
metric: java_lang_operatingsystem_openfiledescriptorcount
type: updowncounter
desc: java_lang_operatingsystem_openfiledescriptorcount
MaxFileDescriptorCount:
metric: java_lang_operatingsystem_maxfiledescriptorcount
type: updowncounter
desc: java_lang_operatingsystem_maxfiledescriptorcount
Empty file.
21 changes: 21 additions & 0 deletions opentelemetry/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
receivers:
otlp:
protocols:
http:
endpoint: "0.0.0.0:4318"

exporters:
debug:
verbosity: detailed

service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
logs:
receivers: [otlp]
exporters: [debug]
Loading