I forgot to add the link to our code that starts the Otel Collector on the agent: https://github.com/jenkinsci/opentelemetry-plugin/blob/d978ac10c2ac01ef1ef93071aa160995ff5c4882/src/main/java/io/jenkins/plugins/opentelemetry/job/log/OtelLogSenderBuildListener.java#L167-L177
On Monday, March 21, 2022 at 4:53:50 PM UTC+1 Cyrille Le Clerc wrote: > Dear all, > > The Jenkins OpenTelemetry plugin is now offering the option to store the > pipeline logs in an external observability backend leveraging JEP-210: > External log storage for Pipeline > <https://github.com/jenkinsci/jep/blob/master/jep/210/README.adoc>. > As part of this capability, we start a logs shipper in the Jenkins Agent > JVMs that is batching the log messages and thus need a graceful shutdown to > flush its buffer (logs the shipper is an OpenTelemetry SDK ). > > *Question: is there a Jenkins API to listen to the shutdown event of the > Jenkins Agent? *We can't use the Jenkins Agent JVM shutdown hook because > the classes loaded in the agent JVM by the controller are already unloaded > and we get a NoClassDefFoundError (e.g. here > <https://github.com/jenkinsci/opentelemetry-plugin/issues/340>). > We looked at the EventListener > <https://javadoc.jenkins.io/component/remoting/hudson/remoting/class-use/EngineListener.html> > but > it's not providing the shutdown event we need. > > Cyrille > > Cyrille > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/bf92836c-374c-4e49-9db7-523880076d33n%40googlegroups.com.
