• EnglishEspañol日本語한국어Português
  • Inicia sesiónComenzar ahora

Te ofrecemos esta traducción automática para facilitar la lectura.

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.

Crea una propuesta

TraceMetadata (API del agente .NET)

Sintaxis

NewRelic.Api.Agent.TraceMetadata;

Devuelve propiedades en el entorno de ejecución actual utilizado para admitir el seguimiento.

Requisitos

Versión del agente 8.19 o superior.

Compatible con todo tipo de aplicaciones.

Rastreo distribuido debe estar habilitado para obtener valores significativos.

Descripción

Proporciona acceso a las siguientes propiedades:

Propiedades

Nombre

Descripción

TraceId

Devuelve una cadena que representa la traza que se está ejecutando actualmente. Si la traza ID no está disponible, o el rastreo distribuido está deshabilitado, el valor será string.Empty.

SpanId

Devuelve una cadena que representa el intervalo de ejecución actual. Si el span ID no está disponible o el rastreo distribuido está deshabilitado, el valor será string.Empty.

IsSampled

Devuelve true si se toma una muestra de la traza actual para su inclusión, false si se toma una muestra.

Ejemplos

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 Inc.

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