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

# Troubleshooting | Sentry for Google Cloud Functions

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/gcp-functions/tracing/troubleshooting.md#group-transactions)

When Sentry captures transactions, they are assigned a transaction name. This name is generally auto-generated by the Sentry SDK based on the framework integrations you are using. If you can't leverage the automatic transaction generation (or want to customize how transaction names are generated) you can use a global event processor that is registered when you initialize the SDK with your configuration.

For example:

```javascript
// All JavaScript-based SDKs include this function, so it's safe to replace `@sentry/node`
// with your particular SDK
import { addEventProcessor } from "@sentry/node";

addEventProcessor((event) => {
  if (event.type === "transaction") {
    event.transaction = sanitizeTransactionName(event.transaction);
  }
  return event;
});
```

## [Control Data Truncation](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/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/gcp-functions/tracing/troubleshooting.md#traces-miss-spans-high-memory-usage-or-data-loss-after-crashes)

If you're hitting the 1,000-span limit, experiencing high memory usage from long-running processes, or losing span data when your process crashes, consider enabling stream mode. Stream mode sends spans to Sentry in batches as they finish rather than holding them in memory until the transaction ends.

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

## [`ignoreSpans` Rules No Longer Work As Expected After Migrating to Stream Mode](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/tracing/troubleshooting.md#ignorespans-rules-no-longer-work-as-expected-after-migrating-to-stream-mode)

In [stream mode](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/tracing/streamed-spans.md), `ignoreSpans` is evaluated at span start rather than at transaction end as in transaction mode. This means rules that match on names and attributes added or updated while a span is active may no longer match the intended spans. Review your `ignoreSpans` rules after migrating to make sure the names and attributes you're matching on are 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/gcp-functions/configuration/options.md#debug) when initializing the SDK.

Finally, make sure you've migrated any entries from `ignoreTransactions` to `ignoreSpans`, as `ignoreTransactions` is not applied in stream mode.
