# Python ZOPE Application Framework Integration to Elastic APM

**URL:** <https://discuss.elastic.co/t/python-zope-application-framework-integration-to-elastic-apm/315277>\
**Category:** APM\
**Tags:** python\
**Created:** [September 27, 2022, 2:44pm UTC](https://discuss.elastic.co/t/python-zope-application-framework-integration-to-elastic-apm/315277 "2022-09-27T14:44:11Z")\
**Posts on this page:** 1\
**Showing post:** 40

<div class="post-metadata">

**Author:** ![basepi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/basepi/32/53056_2.png) [@basepi](https://discuss.elastic.co/u/basepi)\
**Post date:** [November 9, 2022, 2:57pm UTC](https://discuss.elastic.co/t/python-zope-application-framework-integration-to-elastic-apm/315277/40 "2022-11-09T14:57:21Z")

</div>

No, typically you would surround the contents. Something like this:

```python
client.begin_transaction('request')
try:
    response = publish(request, module_name, after_list, debug=debug)
except Exception:
    elasticapm.capture_exception(handled=False)
    raise
finally:
    client.end_transaction(request.method + " " + request.get('PATH_INFO'), response.status)

```

---

_[View the full topic](https://discuss.elastic.co/t/python-zope-application-framework-integration-to-elastic-apm/315277)._
