---
title: "Troubleshooting"
description: "Learn how to troubleshoot your tracing setup."
url: https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/troubleshooting/
---

# Tracing Troubleshooting | Sentry for AWS Lambda

If you need help managing transactions or spans, start with this page. If you need additional help, you can ask on GitHub. Customers on a paid plan may also contact support.

## [Group Transactions](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/troubleshooting.md#group-transactions)

The SDK groups spans by service span. Integrations usually name these spans automatically. To change a service span's name before it is sent, use `beforeSendSpan` and check `is_segment`:

```javascript
Sentry.init({
  beforeSendSpan(span) {
    if (
      span.is_segment &&
      span.attributes["http.route"] === "/users/:id"
    ) {
      span.name = "GET /users/:id";
    }
    return span;
  },
});
```

Event processors do not apply to streamed spans. In transaction mode, use `beforeSendTransaction` to change `event.transaction`. See [Transaction Name](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/enriching-events/transaction-name.md) for other ways to set names.

## [Control Data Truncation](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/troubleshooting.md#control-data-truncation)

Currently, every tag has a maximum character limit of 200 characters. Tags over the 200 character limit will become truncated, losing potentially important information. To retain this data, you can split data over several tags instead.

For example, a 200+ character tag like this:

`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=161803398874989484820458683436563811772030917980576`

...will become truncated to:

`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=1618033988749894848`

Instead of using tags, it is recommended to add data to spans as attributes. Using `span.setAttribute()` allows to add data with arbitrary length to a span. You can add as many attributes to your span as you want.

```javascript
const baseUrl = "https://empowerplant.io";
const endpoint = "/api/0/projects/ep/setup_form";
const parameters = {
  user_id: 314159265358979323846264338327,
  tracking_id: "EasyAsABC123OrSimpleAsDoReMi",
  product_name: PlantToHumanTranslator,
  product_id: 161803398874989484820458683436563811772030917980576,
};

startSpan(
  {
    op: "http.client",
    name: "setup form",
    // you can add attributes when starting the span
    attributes: {
      baseUrl,
      endpoint,
    },
  },
  (span) => {
    // or you can add attributes to an existing span
    for (const key of parameters) {
      span.setAttribute(`parameters.${key}`, parameters[key]);
    }

    // do something to be measured
  },
);
```

## [Traces Miss Spans, High Memory Usage, or Data Loss After Crashes](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/troubleshooting.md#traces-miss-spans-high-memory-usage-or-data-loss-after-crashes)

With `traceLifecycle: 'static'`, the SDK holds spans in memory until the root span ends. This can cause high memory usage, hit the 1,000-span limit, or lose spans if the process crashes. Use the default `traceLifecycle: 'stream'` to send spans in batches as they finish. In stream mode, pass `beforeSendSpan` directly without a `withStaticSpan` wrapper.

See [Streamed Spans](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/streamed-spans.md) for more information.

## [`ignoreSpans` Rules Do Not Match Spans](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/tracing/troubleshooting.md#ignorespans-rules-do-not-match-spans)

The SDK evaluates `ignoreSpans` when a span starts. Names and attributes added or updated later do not affect matching. Make sure your rules match values available when the span is created.

If you're auto-instrumenting and don't know what the initial name of a span is when it starts, enable SDK debug logging during development by setting [`debug: true`](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/configuration/options.md#debug) when initializing the SDK.

Use the object form of `ignoreSpans` to match both name and operation when you need to distinguish service spans from child spans with the same name.
