Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

agriconnect / opbeat   python

Repository URL to install this package:

/ instrumentation / packages / jinja2.py

from opbeat.instrumentation.packages.base import AbstractInstrumentedModule
from opbeat.traces import trace


class Jinja2Instrumentation(AbstractInstrumentedModule):
    name = 'jinja2'

    instrument_list = [
        ("jinja2", "Template.render"),
    ]

    def call(self, module, method, wrapped, instance, args, kwargs):
        signature = instance.name or instance.filename
        with trace(signature, "template.jinja2"):
            return wrapped(*args, **kwargs)