简体   繁体   中英

Using JMeter Docker image, Prometheus throws ConversionException

If I get the following error, is it because the Docker image does not have the plugin, and would the solution be to me to create an image containing that plugin?

Or can I use the Gitlab CI file to copy the plugin JAR into lib/ext on the image?

I am using the image justb4/jmeter:latest .

Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/builds/guyl/web-performance-testing/./DCS_login_dashboard_machine_actor_card_DTM.jmx'. 
Cause:
CannotResolveClassException: com.github.johrstrom.config.PrometheusMetricsConfig
 Detail:com.thoughtworks.xstream.converters.ConversionException: 
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : 
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:66)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jmeter.save.ScriptWrapper
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/com.github.johrstrom.config.PrometheusMetricsConfig
line number         : 132
version             : 5.4.3
-------------------------------

It is, looking at the Dockerfile the image contains vanilla JMeter only without any plugins.

I think you need to add a custom RUN directive which will:

Example code to be added to the Dockerfile:

RUN curl -L --silent https://jmeter-plugins.org/get/ > ${JMETER_HOME}/lib/ext/jmeter-plugins-manager.jar \
    && curl -L --silent https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar >${JMETER_HOME}/lib/cmdrunner-2.2.jar \
    && java -cp ${JMETER_HOME}/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller \
    && ${JMETER_BIN}/./PluginsManagerCMD.sh install jmeter-prometheus

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM