Record an exception as an error only when Plug.Exception.status/1 (#165)
returns 500..599. It is encouraged in the Phoenix docs to use `Plug.Exception` with custom exceptions to generate for example 404 responses at certain places. These 404s should not be marked as error, since simple "route not found" 404s are also not marked as error. Co-authored-by: Tristan Sloughter <t@crashfast.com>
This commit is contained in:
parent
4dfda22cef
commit
7119c4bd42
|
@ -226,7 +226,6 @@ defmodule OpentelemetryPhoenix do
|
||||||
|
|
||||||
# record exception and mark the span as errored
|
# record exception and mark the span as errored
|
||||||
Tracer.record_exception(exception, stacktrace, attrs)
|
Tracer.record_exception(exception, stacktrace, attrs)
|
||||||
Tracer.set_status(OpenTelemetry.status(:error, ""))
|
|
||||||
|
|
||||||
# do not close the span as endpoint stop will still be called with
|
# do not close the span as endpoint stop will still be called with
|
||||||
# more info, including the status code, which is nil at this stage
|
# more info, including the status code, which is nil at this stage
|
||||||
|
|
Loading…
Reference in New Issue