• 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

Los extremos mínimos de API aparecen como una transacción

Problema

Si el agente .NET está monitoreando una aplicación Asp..NET Core “API mínimas”, pueden aparecer múltiples extremos como una sola transacción web. Esto se debe a que los extremos comparten la misma ruta incluso si tienen diferentes métodos de solicitud HTTP.

Para diferenciar estos extremos, recomendamos aplicar la llamada API SetTransactionName() .

Solución

Agregue SetTransactionName() para darle a cada extremo un nombre de transacción único. Si bien sus argumentos para la llamada API pueden variar, recomendamos agregar SetTransactionName() como en el siguiente ejemplo:

// map a minimal API with GET and POST endpoints on the same route
app.MapGet(/minimalApi”, () =>
{
NewRelic.Api.Agent.NewRelic.SetTransactionName(null, name: “minimalApi/Get”);
return Results.Ok(“Get: minimalApi”);
});
app.MapPost(/minimalApi”, () =>
{
NewRelic.Api.Agent.NewRelic.SetTransactionName(null, name: “minimalApi/Post”);
return Results.Ok(“Post: minimalApi”);
});

Puede leer sobre cómo configurar nombres para transacciones en nuestro documento SetTransactionName.

Copyright © 2024 New Relic Inc.

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