Syntax
NewRelic.Api.Agent.NewRelic.TraceMetadata;
Returns properties in the current execution environment used to support tracing.
Requirements
Agent version 8.19 or higher.
Compatible with all app types.
Distributed tracing must be enabled to get meaningful values.
Description
Provides access to the following properties:
Properties
Name | Description |
---|---|
TraceId | Returns a string representing the currently executing trace. If the trace ID is not available, or distributed tracing is disabled, the value will be string.Empty. |
SpanId | Returns a string representing the currently executing span. If the span ID is not available, or distributed tracing is disabled, the value will be string.Empty. |
IsSampled | Returns |
Examples
NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent();var traceMetadata = Agent.TraceMetadata;var traceId = traceMetadata.TraceId;var spanId = traceMetadata.SpanId;var isSampled = traceMetadata.IsSampled;
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。