Fix /health endpoint when OTEL is configured (#33362)

This commit is contained in:
Renaud Chaput 2024-12-19 11:44:44 +01:00 committed by GitHub
parent 32184e3f04
commit 22813dbc6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,10 +86,7 @@ if ENV.keys.any? { |name| name.match?(/OTEL_.*_ENDPOINT/) }
def call(env)
span = OpenTelemetry::Trace.current_span
unless span.recording?
@app.call(env)
return
end
return @app.call(env) unless span.recording?
span_id = span.context.hex_span_id
trace_id = span.context.hex_trace_id