Httpc_handler_sup shutdown_error during application stop with OpenTelemetry

Hi guys,

I’m experiencing intermittent httpc_handler_sup shutdown errors when stopping my Erlang release application that uses OpenTelemetry.

Error logs during shutdown:

2025-10-18T18:59:46.083904+00:00 [info] [supervisor_bridge.erl.241] 
  Supervisor: {local,inet_gethost_native_sup}. Started: pid=<0.1621.0>
2025-10-18T19:00:03.006955+00:00 [error] [supervisor.erl.1661] 
  Supervisor: {local,httpc_handler_sup}. Context: shutdown_error. 
  Reason: killed. Offender: id=undefined,nb_children=1.

Context:

  • OpenTelemetry batch processor configured with exporting_timeout_ms => 5000
  • During shutdown, if OTLP exports are in progress via httpc, the HTTP handler processes get killed rather than stopping gracefully
  • Application exits with code 0, but shutdown takes 6-12 seconds (when OTLP exports are active), compared to consistent 2-3 second shutdowns before integrating OpenTelemetry

The issue appears to be that long-running HTTP requests (with DNS lookups) cannot be terminated within the batch processor’s exporting_timeout_ms window, causing forceful kills and the supervisor error.

Any suggestions for handling this gracefully would be appreciatedd.

Environment:

  • Ubuntu 24.04 LTS
  • rebar 3.25.1+build.5474.ref161b38cf on Erlang/OTP 28 Erts 16.
  • Erlang/OTP 28.1
  • opentelemetry, 1.5.1
  • opentelemetry_api 1.4.1
  • opentelemetry_exporter 1.8.1
  • opentelemetry_semantic_conventions 1.27.0
  • opentelemetry_telemetry 1.1.2
  • opentelemetry_cowboy 1.0.0