Skip to content

Commit ad99e40

Browse files
authored
Handle bandit start event with no conn (#403)
1 parent 3f43ca2 commit ad99e40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

instrumentation/opentelemetry_bandit/lib/opentelemetry_bandit.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ defmodule OpentelemetryBandit do
262262
end
263263
end
264264

265+
# error with no conn
266+
def handle_request_start(_meta, _config) do
267+
Tracer.start_span(:HTTP, %{kind: :server})
268+
|> Tracer.set_current_span()
269+
end
270+
265271
defp public_endpoint?(_conn, %{public_endpoint: true}), do: true
266272

267273
defp public_endpoint?(conn, %{public_endpoint_fn: {m, f, a}}) do

0 commit comments

Comments
 (0)