setTransactionName() function is used to set a name for a new transaction.

Add dependency before starting with the api.

pom.xml

<dependency>
    <groupId>com.atatus.apm</groupId>
    <artifactId>atatus-agent-api</artifactId>
    <version>1.4.0</version>
</dependency>

Compatibility

Compatible with all Java agent versions.

Syntax

copy
icon/buttons/copy
Atatus.setTransactionName(name);

Parameter

Parameter Type Description
name String (Required) Transaction name.

Example

copy
icon/buttons/copy
import com.atatus.apm.api.Atatus;

public class BookController {

    public String createBook() {

        Atatus.setTransactionName("/books/create");
        // code here
    }
}