Plugin capturing the shutdown event when running on the Jenkins Agents?

76 views
Skip to first unread message

Cyrille Le Clerc

unread,
Mar 21, 2022, 11:53:50 AM3/21/22
to Jenkins Developers
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.
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).
We looked at the EventListener but it's not providing the shutdown event we need.

Cyrille

Cyrille


Cyrille Le Clerc

unread,
Mar 21, 2022, 11:55:38 AM3/21/22
to Jenkins Developers
Reply all
Reply to author
Forward
0 new messages