Charts
Each chart combines all pods of the run, so a run with 50 executors still shows one line per series.
How it works
- When a run starts, every driver and executor pod gets a small init container,
tfy-jmx-agent. It downloads the Prometheus JMX exporter Java agent (version 1.0.1) from Maven Central, checks its SHA-256 checksum, and saves it to a volume shared with the Spark container. - The Spark JVM loads the agent when it starts. The agent serves the JVM’s and Spark’s metrics on port
8090. - Prometheus on the cluster scrapes the pods, and the Metrics tab reads the run’s pods from it.
Requirements
- Network access to the jar. Driver and executor pods download the jar from Maven Central (
https://repo1.maven.org/maven2) by default. If your pods reach the internet through a proxy, setHTTPS_PROXY,HTTP_PROXYandNO_PROXY, in upper or lower case, as environment variables on the Spark job. They can be plain values or secrets, and the download uses them. For clusters without internet access, see Air-gapped clusters. - Access to the downloader image. Nodes must be able to pull
tfy.jfrog.io/tfy-mirror/curlimages/curl:8.23.0, which needs no credentials. - Port 8090 is reserved. The agent listens on port
8090in the driver and executor JVMs, so your job must not use it. - Spark metrics settings are managed. TrueFoundry sets
spark.metrics.confandspark.metrics.namespacefor the run, replacing any values in the job’s Spark config. Java options inspark.driver.extraJavaOptionsandspark.executor.extraJavaOptionsare kept.
Settings
JVM metrics are configured on the control plane, as environment variables ofservicefoundryServer in the values file of the truefoundry Helm chart. They apply to Spark jobs on every cluster connected to the control plane.
Turn JVM metrics off
truefoundry-values.yaml
Air-gapped clusters
In an air-gapped cluster, pods can’t reach Maven Central ortfy.jfrog.io. Make the jar and the downloader image available inside your network, then point the control plane at them. Do this before running Spark jobs on the cluster, or turn JVM metrics off until it’s done.
1
Add the jar to your artifact repository
If your repository manager has a Maven repository that proxies Maven Central, use it as is and go to the next step.Otherwise, download the jar on a machine with internet access and check it:Upload it to a Maven repository at the standard path,
io/prometheus/jmx/jmx_prometheus_javaagent/1.0.1/jmx_prometheus_javaagent-1.0.1.jar, or to any path in a generic repository.The jar must be this exact file, because the init container rejects any other version by its checksum. The pods download it without credentials, so the repository must allow anonymous reads of the file.2
Copy the downloader image to your registry
Copy the image with all its architectures, for example with The image isn’t listed in the
skopeo:artifacts-manifest.json that the upload script reads, so copy it separately. If you set up the Kyverno registry rewrite from the compute plane air-gapped guide, keep this path: Kyverno rewrites the init container’s image to your registry, and you don’t need to set SPARK_JMX_AGENT_DOWNLOADER_IMAGE.Nodes must be able to pull the image without credentials, with registry credentials configured on the nodes, or from the same registry and credentials as your Spark image.3
Point the control plane at your repository
truefoundry-values.yaml
4
Check a run
Trigger a run of a Spark job. The log of the driver pod’s The charts appear in the run’s Metrics tab within a couple of minutes.
tfy-jmx-agent init container should end with: