Current section
Files
Jump to
Current section
Files
lib/chromic_pdf/api/telemetry.ex
# SPDX-License-Identifier: Apache-2.0
defmodule ChromicPDF.Telemetry do
@moduledoc false
def with_telemetry(operation, opts, fun) do
metadata = Keyword.get(opts, :telemetry_metadata, %{})
:telemetry.span([:chromic_pdf, operation], metadata, fn ->
{fun.(), metadata}
end)
end
end