       case Version.compare(system_version, "1.5.0") do
         :lt -> "~> 1.2.3"
         _ -> "~> 1.2.3 or ~> 1.3"
+      end
+
+    telemetry_version =
+      case otp_version < "21" do
+        true -> "~> 0.4"
+        false -> "~> 0.4 or ~> 1.0"
       end
 
     mime_dependency =


  defp deps do
    system_version = System.version()

    poison_version =
      case Version.compare(system_version, "1.6.0") do

      {:ex_doc, "~> 0.12", only: :dev, runtime: false},
      {:credo, "~> 1.5.6", only: [:test, :dev], runtime: false},
      {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
      {:telemetry, telemetry_version}
    ] ++ mime_dependency
  end
end
