SetTransactionName

NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name)
Sets the name of the current transaction.

Requirements

Compatible with all agent versions.

Must be called inside a transaction.

Description

Sets the name of the current transaction. Before you use this call, ensure you understand the implications of metric grouping issues.

If you use this call multiple times within the same transaction, each call overwrites the previous call and the last call sets the name.

Do not use brackets [suffix] at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses (suffix) or other symbols if needed.

Parameters

Parameter Description

$category

string

The category of this transaction, which you can use to distinguish different types of transactions. Defaults to Custom. Only the first 255 characters are retained.

$name

string

The name of the transaction. Only the first 255 characters are retained.

Example(s)

NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction");