GetLinkingMetadata

NewRelic.Api.Agent.NewRelic.GetLinkingMetadata();
Returns key/value pairs which can be used to link traces or entities.

Requirements

Agent version 8.19 or higher.

Compatible with all app types.

Description

The Dictionary of key/value pairs returned includes items used to link traces and entities in the New Relic APM product. It will only contain items with meaningful values. For instance, if distributed tracing is disabled, trace.id will not be included.

Return value(s)

Dictionary <string, string>() returned includes items used to link traces and entities in the New Relic APM product.

Example(s)

NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent();
var linkingMetadata = Agent.GetLinkingMetadata();
foreach (KeyValuePair<string, string> kvp in linkingMetadata)
{
     Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
}

For more help

Recommendations for learning more: