Skip to content

Commit

Permalink
fix: add backup case for Finch (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaAK authored Jul 7, 2023
1 parent 1dbd353 commit 3ee033a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/prometheus_telemetry/metrics/finch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ if PrometheusTelemetry.Utils.app_loaded?(:finch) do
Map.merge(metadata, %{host: host, port: port, method: method})
end

defp add_extra_metadata(%{host: _, port: _, scheme: _} = metadata) do
Map.put(metadata, :method, "GET")
end

defp add_status_metadata(%{result: {:error, _}} = metadata) do
Map.put(metadata, :status, 500)
end
Expand Down

0 comments on commit 3ee033a

Please sign in to comment.