As of April 2022, we're discontinuing support for several capabilities, including the C SDK. For more details, including how you can easily prepare for this transition, see our Explorers Hub post.
Instrument transactions 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 in the New Relic UI.
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.
Add the following code immediately before the transaction that you want to monitor:
For web transactions:
For non-web transactions:
newrelic_txn_t *txn; /* ... */ txn = newrelic_start_non_web_transaction(app, "NAME_YOUR_TRANSACTION");
Add the following code immediately after the web or non-web transaction that you want to monitor:newrelic_end_transaction(&txn);
Segments are the functions and calls that make up a transaction. After you instrument transactions, you can: