> For the complete documentation index, see [llms.txt](https://archive-docs.klaytn.foundation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archive-docs.klaytn.foundation/content/dapp/json-rpc/api-references/debug/go_trace.md).

# Runtime Tracing

## debug\_goTrace <a href="#debug_gotrace" id="debug_gotrace"></a>

Turns on Go runtime tracing for the given duration and writes trace data to disk.

|  Client | Method Invocation                                         |
| :-----: | --------------------------------------------------------- |
| Console | `debug.goTrace(file, seconds)`                            |
|   RPC   | `{"method": "debug_goTrace", "params": [string, number]}` |

**Parameters**

| Name    | Type   | Description                        |
| ------- | ------ | ---------------------------------- |
| file    | string | The filename for the trace output. |
| seconds | int    | The tracing duration in seconds.   |

**Return Value**

None

**Example**

Console

```javascript
> debug.goTrace("go.trace", 5)
null
```

HTTP RPC

```shell
$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_goTrace","params":["go.trace",5],"id":1}' https://public-en-baobab.klaytn.net
{"jsonrpc":"2.0","id":1,"result":null}
```

## debug\_startGoTrace <a href="#debug_startgotrace" id="debug_startgotrace"></a>

Starts writing a Go runtime trace to the given file.

|  Client | Method Invocation                                      |
| :-----: | ------------------------------------------------------ |
| Console | `debug.startGoTrace(file)`                             |
|   RPC   | `{"method": "debug_startGoTrace", "params": [string]}` |

**Parameters**

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| file | string | The filename for the tracing output. |

**Return Value**

None

**Example**

Console

```javascript
> debug.startGoTrace("go.trace")
null
```

HTTP RPC

```shell
$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_startGoTrace","params":["go.trace"],"id":1}' https://public-en-baobab.klaytn.net
{"jsonrpc":"2.0","id":1,"result":null}
```

## debug\_stopGoTrace <a href="#debug_stopgotrace" id="debug_stopgotrace"></a>

Stops writing the Go runtime trace.

|  Client | Method Invocation                               |
| :-----: | ----------------------------------------------- |
| Console | `debug.stopGoTrace()`                           |
|   RPC   | `{"method": "debug_stopGoTrace", "params": []}` |

**Parameters**

None

**Return Value**

None

**Example**

Console

```javascript
> debug.stopGoTrace()
null
```

HTTP RPC

```shell
$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_stopGoTrace","params":[],"id":1}' https://public-en-baobab.klaytn.net
{"jsonrpc":"2.0","id":1,"result":null}
```
