• /
  • ログイン

Instrument transactions with the C SDK

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.

Contents

For an index of documentation during the private Beta, see the C SDK table of contents.

Instrument a transaction

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.

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

    For web transactions:

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

    For non-web transactions:

    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:

    newrelic_end_transaction(&txn);

Instrument segments and errors

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

  • Instrument segments of a transaction if you want more data about functions called during that transaction.
  • Instrument errors so that you can use the New Relic UI to monitor errors that occur during your transactions.

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.