Syntax
public interface IDistributedTracePayload
Provides access to distributed trace payload.
Requirements
Agent version 8.9 or higher.
Compatible with all app types.
Distributed tracing must be enabled.
Description
Provides access to distributed trace payload.
Methods
Name | Description |
---|---|
HttpSafe() | Returns a serialized, Base64-encoded version of the distributed trace payload. |
Text() | Returns a serialized, plain text version of the distributed trace payload. |
IsEmpty() | Returns |
Examples
HttpSafe()
KeyValuePair<string, string> metadata;IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();ITransaction transaction = agent.CurrentTransaction;IDistributedTracePayload payload = transaction.CreateDistributedTracePayload();metadata.Key = NewRelic.Api.Agent.Constants.DistributedTracePayloadKey;metadata.Value = payload.HttpSafe();
Text()
KeyValuePair<string, string> metadata;IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();ITransaction transaction = agent.CurrentTransaction;IDistributedTracePayload payload = transaction.CreateDistributedTracePayload();metadata.Key = NewRelic.Api.Agent.Constants.DistributedTracePayloadKey;metadata.Value = payload.Text();
IsEmpty()
KeyValuePair<string, string> metadata;IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();ITransaction transaction = agent.CurrentTransaction;IDistributedTracePayload payload = transaction.CreateDistributedTracePayload();if (!payload.IsEmpty()){ metadata.Key = NewRelic.Api.Agent.Constants.DistributedTracePayloadKey; metadata.Value = payload.HttpSafe();}
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.