export function _shutdownHook(sdk: { shutdown: () => Promise<void> }) {
  process.on("SIGTERM", async () => {
    try {
      // Flushing before shutdown is implemented on a per-exporter basis.
      await sdk.shutdown();
      console.log("NodeJS OpenTelemetry instrumentation shutdown successfully");
    } catch (error) {
      console.error(
        "Error shutting down NodeJS OpenTelemetry instrumentation:",
        error,
      );
    }
  });
}
