IGNITE-28885 Add JMX Prometheus Exporter to Ducktests for Monitoring#13362
Open
EgorBaranovEnjoysTyping wants to merge 1 commit into
Open
IGNITE-28885 Add JMX Prometheus Exporter to Ducktests for Monitoring#13362EgorBaranovEnjoysTyping wants to merge 1 commit into
EgorBaranovEnjoysTyping wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Prometheus does not support the JMX protocol natively; it only scrapes metrics exposed over HTTP in its own text format. A bridge (JVM agent) is required to make JVM-level metrics accessible to Prometheus.
This task integrates jmx_prometheus_javaagent into the ducktests framework so that every server/client node exposes JVM memory and GC metrics at :8083/metrics in Prometheus format. This enables Grafana
dashboards that mirror the jconsole "Memory" tab (heap, non-heap, memory pools, GC collection count/time).
Changes
1. Dockerfile (modules/ducktests/tests/docker/Dockerfile)
- Download and install jmx_prometheus_javaagent-1.1.0.jar to /opt/jmx_exporter.jar
2. jmx_exporter package (modules/ducktests/tests/ignitetest/services/utils/jmx_exporter/)
-
{}init{}.py— helper module with:- JmxExporterParams — settings from globals config (enabled, port)
- get_jmx_exporter_params() — parse globals
- is_jmx_exporter_enabled() — check if enabled
- get_jmx_exporter_yml_content() — read bundled YAML content
- jmx_agent_jvm_opt() — build -javaagent JVM option string
-
jmx_exporter.yml— rule mappings for JVM memory and GC metrics:- jvm_memory_heap_bytes_{used,max,committed,init}
- jvm_memory_nonheap_bytes_{used,max,committed,init}
- jvm_memory_pool_usage_bytes{pool,attribute}
- jvm_memory_pool_collection_bytes{pool,attribute}
- jvm_gc_collection_count_total{gc}
- jvm_gc_collection_time_seconds_total{gc}
3. ignite_spec.py (modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py)
- In __get_default_jvm_opts(): append -javaagent:/opt/jmx_exporter.jar={port}:{config_dir}/jmx_exporter.yml when jmx_exporter.enabled is true in globals
4. ignite_aware.py (modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py)
- In init_persistent(): download jmx_exporter.jar to node if not present (idempotent: test -f || curl)
- In _prepare_configs(): create jmx_exporter.yml in the node's config directory from bundled resource