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

문제 신고

최소 API 끝점은 하나의 트랜잭션으로 나타납니다.

문제

.NET 에이전트가 Asp.Net Core "최소 API" 애플리케이션을 모니터링하는 경우 여러 엔드포인트가 단일 웹 트랜잭션으로 나타날 수 있습니다. HTTP 요청 메서드가 다르더라도 엔드포인트가 동일한 경로 경로를 공유하기 때문입니다.

이러한 엔드포인트를 차별화하려면 SetTransactionName() API 호출을 적용하는 것이 좋습니다.

해결책

SetTransactionName() 추가하여 각 엔드포인트에 고유한 트랜잭션 이름을 지정합니다. API 호출에 대한 인수는 다를 수 있지만 아래 예와 같이 SetTransactionName() 추가하는 것이 좋습니다.

// 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”);
});

SetTransactionName 문서에서 트랜잭션 이름 설정에 대해 읽을 수 있습니다.

Copyright © 2024 New Relic Inc.

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