Public interface ISpan
Provides access to span-specific methods in the New Relic API.
Provides access to span-specific methods in the New Relic .NET agent API. To obtain a reference to
This section contains descriptions and parameters of
Add contextual information from your application to the current span in form of attributes.
Adds contextual information about your application to the current span in the form of attributes.
This method requires .NET agent version and .NET agent API version 8.25 or higher.
ISpan AddCustomAttribute(string key, object value)
Identifies the information being reported. Also known as the name.
The value being reported.
A reference to the current span.
For details about supported data types, see the Custom Attributes guide.
IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();ISpan currentSpan = agent.CurrentSpan;currentSpan.AddCustomAttribute("customerName","Bob Smith").AddCustomAttribute("currentAge",31).AddCustomAttribute("birthday", new DateTime(2000, 02, 14)).AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842));
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.