You’re correct that Mendix Runtime is Java-based, so opentelemetry-instrument
(Python) only catches the buildpack startup logs — it won’t instrument the Mendix Runtime itself.To capture Runtime traces/metrics (and optionally logs) you need the OpenTelemetry Java Agent.
Two ways to enable it on Kubernetes
1. Use the OpenTelemetry Operator (recommended in K8s)
Install the OpenTelemetry Operator in your cluster.
Create an Instrumentation
resource for Java, pointing to your OTLP endpoint.
Annotate your Mendix Deployment/StatefulSet with:
instrumentation.opentelemetry.io/inject-java: "true"
The operator will inject the Java agent and configure JAVA_TOOL_OPTIONS
automatically.
2. Bake the agent into your Mendix Docker image
Start FROM the Mendix Docker Buildpack v6.0.0 image.
Download opentelemetry-javaagent.jar
(Java 17 compatible) and COPY it into the image.
Add environment variables:
ENV JAVA_TOOL_OPTIONS="-javaagent:/opt/otel/opentelemetry-javaagent.jar" ENV OTEL_SERVICE_NAME=my-mendix-app ENV OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 ENV OTEL_TRACES_SAMPLER=parentbased_always_on ENV OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod
Logs vs traces/metrics
The Java agent will automatically give you traces (HTTP, JDBC, etc.) and metrics.
For application logs, the simplest production approach is to let Mendix write logs to stdout (default) and have your OTel Collector (or Fluent Bit → Collector) scrape container logs and forward them to your backend.
Direct log shipping from Mendix via OTLP is possible but requires custom logging config and is more brittle.