Read on to learn how to enable and instrument distributed tracing for the New Relic's C SDK.
Enable distributed tracing
To enable distributed tracing for a New Relic-monitored C application:
Create a default
newrelic_app_config_t
and set thedistributed_tracing.enabled
field totrue
.newrelic_app_config_t* config= newrelic_create_app_config(app_name, license_key);config->distributed_tracing.enabled = true;Continue with the procedures to instrument transactions and HTTP requests.
重要
Span events can be enabled/disabled separately from distributed tracing.
Instrument transactions and HTTP requests
For transactions that occur in multiple services, the distributed trace payload contains information that allows New Relic to stitch them together into a complete transaction trace. However, if New Relic-monitored services are not sending trace context to each other, it will result in incomplete trace details. For more information, see the documentation about passing the distributed tracing API header and the C SDK's distributed tracing documentation on GitHub.
If you want to... | Use this |
---|---|
Create and return a payload to be sent to the called service | |
Accept a payload sent from the first service | This will link these services together in a trace. |
Return a base64-encoded JSON string representation of the payload | This offers the same behavior as |
Accept a base64-encoded string for the payload | This offers the same behavior as |
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。