• EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

この機械翻訳は、参考として提供されています。

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

問題を作成する

TraceMetadata(.NETエージェントAPI)

構文

NewRelic.Api.Agent.TraceMetadata;

トレースをサポートするために使用されている現在の実行環境のプロパティを返します。

要件

Agentバージョン8.19以上。

すべてのアプリタイプに対応しています。

意味のある値を得るためには、Distributed tracingを有効にする必要があります

説明

以下のプロパティへのアクセスを提供します。

プロパティ

名前

説明

TraceId

現在実行中のトレースを表す文字列を返します。トレース ID が利用できない場合、または分散トレースが無効になっている場合、値はstring.Emptyになります。

SpanId

現在実行中のスパンを表す文字列を返します。スパン ID を使用できない場合、または分散トレースが無効になっている場合、値はstring.Emptyになります。

IsSampled

現在のトレースが含めるためにサンプリングされている場合はtrueを返し、サンプリングされている場合はfalseを返します。

IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();
TraceMetadata traceMetadata = agent.TraceMetadata;
string traceId = traceMetadata.TraceId;
string spanId = traceMetadata.SpanId;
bool isSampled = traceMetadata.IsSampled;
Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.