--- a/src/pyams_apm/packages/chameleon.py Mon Jun 29 22:32:01 2020 +0200
+++ b/src/pyams_apm/packages/chameleon.py Wed Jul 01 12:36:21 2020 +0200
@@ -36,8 +36,10 @@
span_type='template',
span_subtype='chameleon',
span_action='cook',
- extra={'filename': instance.filename},
- leaf=True):
+ extra={
+ 'filename': instance.filename
+ },
+ leaf=False):
return wrapped(*args, **kwargs)
@@ -51,10 +53,22 @@
def call(self, module, method, wrapped, instance, args, kwargs):
# pylint: disable=too-many-arguments
"""Wrapped method call"""
+ view = kwargs.get('view')
+ context = kwargs.get('context')
with capture_span('RENDER',
span_type='template',
span_subtype='chameleon',
span_action='render',
- extra={'filename': instance.filename},
- leaf=True):
+ tags={
+ 'view': '{}.{}'.format(view.__class__.__module__,
+ view.__class__.__name__)
+ if view is not None else None,
+ 'context': '{}.{}'.format(context.__class__.__module__,
+ context.__class__.__name__)
+ if context is not None else None
+ },
+ extra={
+ 'filename': instance.filename
+ },
+ leaf=False):
return wrapped(*args, **kwargs)