Skip to content

In certain scenarios, it may be necessary to manually shut down the Agent Proxy when the main container has exited but the sidecar process continues running.

This situation commonly occurs with Kubernetes jobs, where the main container exits upon job completion. Terminating the entire job in this case might appear as a cancelled job. To avoid that, Aembit provides a way to gracefully stop the sidecar, allowing the job to complete cleanly.

The Agent Proxy can be shut down by sending an HTTP POST request to its /quit endpoint.

An example command using curl:

Terminal window
curl -X POST localhost:<HEALTH_CHECK_PORT>/quit

When the Agent Proxy is properly configured to receive this request, it will flush any remaining events to the backend before exiting gracefully.

The behavior of the Agent Proxy can be controlled through specific environment variables outlined below:

AEMBIT_ENABLE_HTTP_SHUTDOWN Environment Variable

This variable controls whether the Agent Proxy supports the /quit endpoint.

  • Default Value - false
  • Accepted Values - false or true

AEMBIT_SERVICE_PORT Environment Variable

This variable specifies the port on which the Agent Proxy responds to the diagnostic and configuration endpoint /quit.

  • Default Value - 51234
  • Accepted Values - an integer number in the range 1 to 65535 (inclusive)