---
title: Instrument transactions with the C SDK
source: https://docs.newrelic.com/docs/apm/agents/c-sdk/instrumentation/instrument-transactions-c-sdk
---

> #### ⚠️ EOL NOTICE
>
> From April 2022, we don't support the C SDK capability. For more details, see our [Support Forum post](https://support.newrelic.com/s/hubtopic/aAX8W0000008d0r/q1-bulk-eol-announcement-fy23).

Instrument [transactions](https://docs.newrelic.com/docs/apm/transactions/intro-transactions/transactions-new-relic-apm) using the C SDK so you can monitor any application on Linux that uses a language that can import C libraries. After you manually instrument transactions in your source code by adding New Relic functions, you can view the data on the [**Transactions** page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-page) in the New Relic UI.

## Instrument a transaction [#c-agent-txn]

To instrument a transaction so you can monitor it in the New Relic UI, wrap the New Relic functions that start and stop instrumentation around the transaction. The function that you use depends on whether you want to instrument a [web or non-web transaction](https://docs.newrelic.com/docs/apm/transactions/intro-transactions/transactions-new-relic-apm#types).

1.  Add the following code immediately **before** the transaction that you want to monitor:

    For web transactions:

    ```c
    newrelic_txn_t *txn;
    /* ... */
    txn = newrelic_start_web_transaction(app, "NAME_YOUR_TRANSACTION");
    ```

    For non-web transactions:

    ```c
    newrelic_txn_t *txn;
    /* ... */
    txn = newrelic_start_non_web_transaction(app, "NAME_YOUR_TRANSACTION");
    ```
2.  Add the following code immediately after the web or non-web transaction that you want to monitor:

    ```c
    newrelic_end_transaction(&txn);
    ```

## Instrument segments and errors [#segments-errors]

Segments are the functions and calls that make up a transaction. After you instrument transactions, you can:

-   [Instrument segments](https://docs.newrelic.com/docs/instrument-segments-c-agent) of a transaction if you want more data about functions called during that transaction.
-   [Instrument errors](https://docs.newrelic.com/docs/instrument-errors-c-agent) so that you can use the New Relic UI to monitor errors that occur during your transactions.
