# HG changeset patch # User Thierry Florac # Date 1537353610 -7200 # Node ID 6fb8165a78b93020d6092b21c463fcc27e06c2fa # Parent 1718075e542c242c9d850698ce0c9293d74a8d57 Updated LDAP module diff -r 1718075e542c -r 6fb8165a78b9 src/pyams_apm/packages/ldap3.py --- a/src/pyams_apm/packages/ldap3.py Wed Sep 19 11:03:57 2018 +0200 +++ b/src/pyams_apm/packages/ldap3.py Wed Sep 19 12:40:10 2018 +0200 @@ -19,7 +19,7 @@ class LDAP3BindInstrumentation(AbstractInstrumentedModule): name = "ldap.bind" - instrument_list = [("ldap3.connection", "Connection.bind")] + instrument_list = [("ldap3", "Connection.bind")] def call(self, module, method, wrapped, instance, args, kwargs): with capture_span('LDAP.BIND', "db.ldap", leaf=True): @@ -29,8 +29,13 @@ class LDAP3SearchInstrumentation(AbstractInstrumentedModule): name = "ldap.search" - instrument_list = [("ldap3.connection", "Connection.search")] + instrument_list = [("ldap3", "Connection.search")] def call(self, module, method, wrapped, instance, args, kwargs): - with capture_span('LDAP.SEARCH', "db.ldap", leaf=True): + with capture_span('LDAP.SEARCH', "db.ldap", { + 'db': { + 'type': 'ldap', + 'statement': kwargs.get('search_filter') or args[1] + } + }, leaf=True): return wrapped(*args, **kwargs)