Closed pengpj closed 2 years ago
Could you share the jar and/or the source code of your plugin? Am I correct in assuming you have put this jar in a plugins folder and have configured plugins_dir
to point to that?
The kafka-clients
dependency is just available in the plugin's jar and not in your application, is that correct?
Could you please also share the full debug logs of the startup?
fork repository : https://github.com/pengpj/apm-agent-java/tree/log-send path : es-apm-agent/apm-external-plugins
env config :
log_collect_bootstrap_servers=10.21.17.108:9092;
log_collect_level=INFO;
log_collect_sync_send=true;
ELASTIC_APM_PLUGINS_DIR=/opt/plugins-dir
start an spring demo , logging by logback , command for :
java \
-Xms725M \
-Xmx925M \
-XX:+PrintGCDetails \
-Xloggc:/app/logs/gc.log \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseCGroupMemoryLimitForHeap \
-XX:+PrintGCDateStamps \
-XX:+PrintHeapAtGC \
-Dfile.encoding=UTF-8 \
-Dsun.jnu.encoding=UTF-8 \
-server \
-javaagent:/opt/elastic-apm-agent.jar \
-jar \
demo-http.jar
no more debug log.
maven-shade-plugin
in the build , it would not influent either the deme use kafka-client
, Is this still a concern?
Lacking feedback, so closing this now but please reopen if it's still and issue
Refer to integration-tests/external-plugin-test, i create an external plugin related to logback, but when calling a KafkaManager class, an exception occurs:
java.lang.NoClassDefFoundError: Could not initialize class co.elastic.apm.agent.log.collect.kafka.KafkaManager
about KafkaManager
logback instrument call it
use param
ELASTIC_APM_PLUGINS_DIR
to loading, stack :env : jdk 1.8
classloader info :
How can org.springframework.boot.loader.LaunchedURLClassLoader be loaded into KafkaManager? Please!