Skip to content

Commit

Permalink
Use is_recording flag in jinja, celery, esearch, falcon instrumentati…
Browse files Browse the repository at this point in the history
…ons (#1241)
  • Loading branch information
lzchen committed Oct 14, 2020
1 parent d602a1f commit b51e772
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ def _wrap_cmd(tracer, cmd, wrapped, instance, args, kwargs):
_CMD, kind=SpanKind.INTERNAL, attributes={}
) as span:
try:
if not args:
vals = ""
else:
vals = _get_query_string(args[0])
if span.is_recording():
if not args:
vals = ""
else:
vals = _get_query_string(args[0])

query = "{}{}{}".format(cmd, " " if vals else "", vals)
span.set_attribute(_RAWCMD, query)
query = "{}{}{}".format(cmd, " " if vals else "", vals)
span.set_attribute(_RAWCMD, query)

_set_connection_attributes(span, instance)
_set_connection_attributes(span, instance)
except Exception as ex: # pylint: disable=broad-except
logger.warning(
"Failed to set attributes for pymemcache span %s", str(ex)
Expand Down

0 comments on commit b51e772

Please sign in to comment.