# Separate transaction for every resolver in AWS Lambda

**URL:** <https://discuss.elastic.co/t/separate-transaction-for-every-resolver-in-aws-lambda/369688>\
**Category:** APM\
**Tags:** nodejs, aws-lambda\
**Created:** [October 28, 2024, 4:54pm UTC](https://discuss.elastic.co/t/separate-transaction-for-every-resolver-in-aws-lambda/369688 "2024-10-28T16:54:09Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mkaniaa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mkaniaa/32/138787_2.png) [@mkaniaa](https://discuss.elastic.co/u/mkaniaa)\
**Post date:** [November 8, 2024, 1:50pm UTC](https://discuss.elastic.co/t/separate-transaction-for-every-resolver-in-aws-lambda/369688/7 "2024-11-08T13:50:43Z")

</div>

Ad 1:  
In the traces for specific APIs, I can see the URL arguments used for the requests, which is sufficient for my needs.

Ad 2:

- I had to set the flag `ELASTIC_APM_CAPTURE_BODY` to `"all"` for each API called by AppSync to view the request bodies for each call.
- I was able to capture response bodies by using labels.

My remaining concern is the `maxLength` for JSON in labels. Here’s how I’m currently creating the label for responses in my Flask API service:

```auto
@app.after_request
def apm_label_response_data(response):
    response_data = response.get_json(silent=True)
    limited_data = json.dumps(response_data)[:10000]
    elasticapm.label(response_body=limited_data)
        
    return response

```

The problem is that my limit doesn’t seem to take effect, as the JSON is still truncated to only 1024 characters. I believe the reason is explained [**here**](https://discuss.elastic.co/t/character-limit-in-fields-longer-then-1024-truncated-with-ellipsis/280415/5). Is there any way to adjust this limit for my label?

---

_[View the full topic](https://discuss.elastic.co/t/separate-transaction-for-every-resolver-in-aws-lambda/369688)._
