mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-01 17:34:38 +08:00
Use is_recording flag in flask, django, tornado, boto, botocore instrumentations (#1164)
This commit is contained in:
@ -91,6 +91,8 @@ def collect_request_attributes(scope):
|
|||||||
|
|
||||||
def set_status_code(span, status_code):
|
def set_status_code(span, status_code):
|
||||||
"""Adds HTTP response attributes to span using the status_code argument."""
|
"""Adds HTTP response attributes to span using the status_code argument."""
|
||||||
|
if not span.is_recording():
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
status_code = int(status_code)
|
status_code = int(status_code)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Reference in New Issue
Block a user