• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

REST API v2에서 NerdGraph로 마이그레이션

이 가이드는 뉴렐릭 REST API v2에서 NerdGraph GraphQL API로 마이그레이션하는 데 도움이 됩니다. NerdGraph는 뉴렐릭에서 권장하는 API로, 단일 통합 엔드포인트, 정확한 데이터 가져오기 및 강력한 타이핑을 제공합니다.

중요

The New Relic REST API v2 (including Alerts endpoints) and the Deployments v0 API will reach end of life on July 31, 2027. After this date, these endpoints will no longer be available. Migrate your integrations to NerdGraph before that date.

이 가이드의 쿼리는 시작점일 뿐 ― REST v2 엔드포인트를 그대로 대체하는 것은 아닙니다. 어떤 기본 쿼리에서든 필요하지 않은 필드를 생략하거나 원래 REST 호출에서 사용할 수 없었던 필드를 추가할 수 있습니다. "개요" 객체 컬렉션 대 세부 필드와 같은 일부 경우에는 정확한 필드 일치가 직접적으로 불가능합니다.

시작하기 전에

사용자 API 키 받기

REST 호출을 수행하는 데 이미 사용하는 사용자 API 키를 재사용할 수 있지만, REST v2 API는 사용자 API 키를 생성하는 데 사용된 계정을 기반으로 가정을 했다는 점에 유의하십시오. NerdGraph는 유사한 가정을 하지 않습니다.

NerdGraph 엔드포인트

  • https://api.newrelic.com/graphql
  • https://api.eu.newrelic.com/graphql

대화형으로 탐색

인라인 문서 및 자동 완성을 사용하여 쿼리를 빌드하고 테스트하려면 NerdGraph API Explorer 를 사용하십시오.

엔티티 GUID

NerdGraph는 일반적으로 숫자 애플리케이션 ID 대신 엔티티 GUID(전역 고유 식별자)를 사용합니다. 엔티티 검색 쿼리를 사용하여 REST API 애플리케이션 ID에서 엔티티 GUID를 조회할 수 있습니다(애플리케이션 참조). appId만으로도 변경 추적을 계속 수행할 수 있습니다.

입증

REST API v2:

bash
$
curl -X GET 'https://api.newrelic.com/v2/applications.json' \
>
-H "Api-Key: $USER_API_KEY"

NerdGraph:

bash
$
curl -X POST 'https://api.newrelic.com/graphql' \
>
-H 'Content-Type: application/json' \
>
-H "Api-Key: $USER_API_KEY" \
>
-d '{"query": "{ actor { user { email } } }"}'

자세한 내용은 NerdGraph 소개를 참조하십시오.

주요 차이점

기능

REST API v2

NerdGraph(GraphQL)

규약

여러 REST 엔드포인트

단일 GraphQL 엔드포인트

입증

사용자 API 키(

Api-Key

또는

X-Api-Key

헤더)

사용자 API 키(

Api-Key

헤더), 시스템 ID

데이터 가져오기

고정된 응답 형태

주어진 쿼리에 따라 결정되는 응답 형태

식별자

숫자 ID(예: 애플리케이션 ID)

계정의 경우 정수, 애플리케이션의 경우 엔티티 GUID 등

목록 대 세부 정보

목록 엔드포인트에서 반환된 전체 객체

많은 컬렉션 필드에는 "Outline" 객체만 포함됩니다. 자세한 내용을 보려면 단일 항목을 쿼리해야 할 수도 있습니다.

쪽수 매기기

페이지 기반(

?page=N

)

커서 기반 페이지네이션

측정항목 데이터

전용 메트릭 엔드포인트

actor.nrql

을(를) 통한 NRQL 쿼리 또는

actor.account.nrql

속도 제한

키별 한도

동시성 및 처리량 한도

애플리케이션

애플리케이션 나열

REST API v2: GET /v2/applications.json

NerdGraph: APM 애플리케이션을 찾으려면 entitySearch 을(를) 사용하십시오. 결과를 특정 계정으로 범위 지정하려면 accountId = YOUR_ACCOUNT_ID 을(를) 추가하십시오. accountId을(를) 제공할 필요는 없으며, AND domainId = <ID of app>을(를) 추가하여 특정 애플리케이션을 검색할 수 있습니다.

{
actor {
entitySearch(
query: "domain = 'APM' AND type = 'APPLICATION' AND accountId = YOUR_ACCOUNT_ID"
) {
results {
entities {
guid
name
reporting
alertSeverity
... on ApmApplicationEntityOutline {
applicationId
language
apmSummary {
responseTimeAverage
throughput
errorRate
apdexScore
}
}
}
nextCursor
}
}
}
}

이름으로 필터링하려면(filter[name]와 동일):

{
actor {
entitySearch(
query: "domain = 'APM' AND type = 'APPLICATION' AND accountId = YOUR_ACCOUNT_ID AND name LIKE 'MyApp'"
) {
results {
entities {
guid
name
}
}
}
}
}

REST API GET /v2/applications.json 은(는) 더 이상 데이터를 보고하지 않거나 삭제된 애플리케이션을 반환할 수 있습니다. NerdGraph entitySearch 은(는) 엔티티 플랫폼에 인덱싱된 엔티티만 반환합니다. NerdGraph에서 더 적은 결과가 표시되는 경우, 보고하지 않거나 오랫동안 비활성 상태인 애플리케이션이 원인일 가능성이 높습니다.

애플리케이션 표시

REST API v2: GET /v2/applications/{id}.json

NerdGraph: 엔티티 GUID로 가져오기:

{
actor {
entity(guid: "YOUR_ENTITY_GUID") {
name
alertSeverity
reporting
... on ApmApplicationEntity {
applicationId
language
apmSummary {
responseTimeAverage
throughput
errorRate
apdexScore
hostCount
instanceCount
}
settings {
apdexTarget
serverSideConfig
}
}
}
}
}

REST API 애플리케이션 ID에서 엔티티 GUID를 찾으려면:

{
actor {
entitySearch(query: "domainId = 'APP_ID' AND domain = 'APM'") {
results {
entities {
guid
name
}
}
}
}
}

애플리케이션 설정 업데이트

REST API v2: PUT /v2/applications/{id}.json

NerdGraph:

mutation {
agentApplicationSettingsUpdate(
guid: "YOUR_ENTITY_GUID"
settings: {
alias: "My App Display Name"
apmConfig: { apdexTarget: 0.5, useServerSideConfig: true }
}
) {
alias
guid
apmSettings {
apdexTarget
useServerSideConfig
}
}
}

사용 가능한 설정이 더 많이 있습니다. 전체 목록은 NerdGraph API 탐색기의 인라인 문서를 참조하십시오.

애플리케이션 삭제

REST API v2: DELETE /v2/applications/{id}.json

NerdGraph:

mutation {
agentApplicationDelete(guid: "YOUR_ENTITY_GUID") {
success
}
}

보다 자세한 내용은 NerdGraph 엔티티 튜토리얼APM 설정 튜토리얼을 참조하십시오.

애플리케이션 메트릭 데이터

메트릭 이름 나열

REST API v2: GET /v2/applications/{app_id}/metrics.json

NerdGraph: NRQL 쿼리를 사용한 사용 가능한 메트릭 이름 나열:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT uniques(metricTimesliceName) FROM Metric WHERE appId = YOUR_APP_ID AND newrelic.timeslice.value IS NOT NULL SINCE 30 MINUTES AGO LIMIT MAX"
) {
results
}
}
}

또는 애플리케이션 이름으로 필터링:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT uniques(metricTimesliceName) FROM Metric WHERE appName = 'YourAppName' AND newrelic.timeslice.value IS NOT NULL SINCE 30 MINUTES AGO LIMIT MAX"
) {
results
}
}
}

REST API는 시간 창과 관계없이 역사적으로 알려진 모든 메트릭 이름을 각 메트릭에 사용 가능한 값 유형(예: average_response_time, call_count, calls_per_minute)과 함께 반환합니다. NRQL 쿼리는 SINCE 창 내에 데이터를 보고한 메트릭만 반환합니다 ― 더 많은 메트릭 이름을 검색하려면 이를 확장하십시오(예: SINCE 1 WEEK AGO). NerdGraph에는 메트릭별 값 유형을 나열하는 것과 동일한 기능이 없습니다. 대신 아래의 요약 매핑 테이블을 사용하거나(또는 더 많은 매핑 링크를 통해) REST API 값 이름을 NRQL 함수로 변환하십시오 ― 모든 타임슬라이스 메트릭은 동일한 집계 함수 세트를 지원합니다.

메트릭 데이터 가져오기

REST API v2: GET /v2/applications/{app_id}/metrics/data.json?names[]=HttpDispatcher&values[]=average_call_time&values[]=call_count

NerdGraph: 적절한 집계 함수와 함께 NRQL 쿼리를 사용합니다. 간격별 데이터 포인트(REST API의 타임슬라이스 어레이와 동일)를 얻으려면 TIMESERIES 을 추가합니다:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT count(newrelic.timeslice.value) AS call_count, average(newrelic.timeslice.value) * 1000 AS average_call_time FROM Metric WHERE appId = YOUR_APP_ID AND metricTimesliceName = 'HttpDispatcher' SINCE 30 MINUTES AGO TIMESERIES"
) {
results
}
}
}

TIMESERIES이 없으면 NRQL은 전체 시간 범위에 대해 단일 집계 값을 반환합니다. REST API는 기본적으로 분당 타임슬라이스를 반환합니다. REST API의 기본 세분성과 일치하도록 TIMESERIES 1 minute 을 추가합니다.

REST API 메트릭 값을 NRQL 함수로 매핑

REST API 값

NRQL 함수

average_response_time

average(newrelic.timeslice.value) * 1000

calls_per_minute

rate(count(newrelic.timeslice.value), 1 minute)

call_count

count(newrelic.timeslice.value)

min_response_time

min(newrelic.timeslice.value) * 1000

max_response_time

max(newrelic.timeslice.value) * 1000

average_exclusive_time

average(newrelic.timeslice.value['totalExclusive'] / newrelic.timeslice.value['count']) * 1000

average_value

average(newrelic.timeslice.value)

total_call_time_per_minute

rate(sum(newrelic.timeslice.value), 1 minute)

requests_per_minute

rate(count(newrelic.timeslice.value), 1 minute)

standard_deviation

stddev(newrelic.timeslice.value) * 1000

error_count

count(newrelic.timeslice.value)

errors_per_minute

rate(count(newrelic.timeslice.value), 1 minute)

throughput

rate(count(newrelic.timeslice.value), 1 second)

as_percentage

average(newrelic.timeslice.value) * 100

자세한 내용은 메트릭 API 소개, 메트릭 쿼리 가이드지표 타임슬라이스 쿼리를 NRQL로 마이그레이션을 참조하십시오.

애플리케이션 호스트 및 인스턴스

애플리케이션 호스트 나열

REST API v2: GET /v2/applications/{app_id}/hosts.json

NerdGraph: NRQL을 사용한 호스트 수준 데이터 쿼리:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT uniqueCount(host) FROM Transaction WHERE appName = 'YourAppName' SINCE 1 hour ago FACET host"
) {
results
}
}
}

FROM Transaction 접근 방식은 SINCE 기간 내에 트랜잭션을 처리한 호스트만 반환합니다.

애플리케이션 호스트/인스턴스 메트릭 데이터

REST API v2: GET /v2/applications/{app_id}/hosts/{host_id}/metrics/data.json

NerdGraph: 호스트 또는 에이전트 인스턴스별로 NRQL 쿼리 필터링:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT average(newrelic.timeslice.value) * 1000 AS avg_response_time FROM Metric WHERE appName = 'YourAppName' AND host = 'your-host.example.com' AND metricTimesliceName = 'HttpDispatcher' SINCE 30 MINUTES AGO"
) {
results
}
}
}

배포

배포 나열

REST API v2: GET /v2/applications/{app_id}/deployments.json

NerdGraph: NRQL을 통해 배포 쿼리:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT eventType(), deploymentId or changeTrackingId AS 'id', * FROM ChangeTrackingEvent, Deployment WHERE (eventType() = 'Deployment' OR (eventType() = 'ChangeTrackingEvent' AND category = 'Deployment')) AND entity.guid = 'YOUR_ENTITY_GUID' SINCE 1 WEEK AGO LIMIT 100"
) {
results
}
}
}

배포 만들기

REST API v2: POST /v2/applications/{app_id}/deployments.json

NerdGraph: changeTrackingCreateEvent 뮤테이션을 사용하십시오.

mutation {
changeTrackingCreateEvent(
changeTrackingEvent: {
entitySearch: {
query: "name = 'YOUR_ENTITY_NAME' and accountId = YOUR_ACCOUNT_ID"
}
categoryAndTypeData: {
kind: { category: "DEPLOYMENT", type: "BASIC" }
categoryFields: {
deployment: {
version: "1.2.3"
changelog: "Fixed authentication bug"
commit: "abc123def456"
}
}
}
description: "Production deployment of auth fix"
shortDescription: "user deployer@example.com deployed version 1.2.3 to environment: commerce_prod"
user: "deployer@example.com"
customAttributes: {
cloud_vendor: "vendor_name"
region: "us-east-1"
environment: "commerce_prod"
}
}
) {
changeTrackingEvent {
changeTrackingId
timestamp
user
description
entity {
guid
domain
name
}
customAttributes
}
}
}

다른 일부 NerdGraph 작업과 마찬가지로 changeTrackingCreateEvent 은(는) entitySearch 을(를) 허용하여 REST API에서 가장 쉬운 마이그레이션 경로를 제공합니다. name (으)로 검색할 수 있으며, entityGuid 이(가) 있는 경우 (으)로도 검색할 수 있습니다. 사용 가능한 모든 필드는 NerdGraph를 사용하여 변경 사항 추적 을 참조하십시오.

배포 삭제

REST API v2: DELETE /v2/applications/{app_id}/deployments/{id}.json

NerdGraph: NerdGraph에는 배포에 대한 직접적인 삭제 뮤테이션이 없습니다. 배포 레코드는 변경할 수 없는 변경 추적 이벤트입니다.

보다 자세한 내용은 NerdGraph를 사용한 변경 사항 추적을 참조하십시오.

주요 거래

주요 트랜잭션 목록

REST API v2: GET /v2/key_transactions.json

NerdGraph: KEY_TRANSACTION 유형과 함께 엔티티 검색을 사용하십시오. 특정 계정으로 범위를 지정하려면 accountId 을(를) 추가하십시오:

{
actor {
entitySearch(
query: "type = 'KEY_TRANSACTION' AND accountId = YOUR_ACCOUNT_ID"
) {
results {
entities {
guid
name
reporting
alertSeverity
}
nextCursor
}
}
}
}

KeyTransactionEntityOutline 유형에는 응답 시간이나 처리량과 같은 요약 메트릭이 직접 포함되지 않습니다. 주요 트랜잭션에 대한 성능 데이터를 얻으려면 아래의 전체 엔티티 쿼리를 사용하거나 주요 트랜잭션의 메트릭 이름에 대해 NRQL 쿼리를 실행하십시오.

주요 트랜잭션 표시

REST API v2: GET /v2/key_transactions/{id}.json

NerdGraph:

{
actor {
entity(guid: "KEY_TRANSACTION_ENTITY_GUID") {
name
... on KeyTransactionEntity {
apdexTarget
metricName
application {
guid
entity {
name
}
}
}
}
}
}

동등한 성능 메트릭(예: 처리량)을 얻으려면 주요 트랜잭션의 메트릭 이름과 함께 NRQL 쿼리를 사용합니다:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT average(newrelic.timeslice.value) * 1000 AS responseTimeAverage, rate(count(newrelic.timeslice.value), 1 minute) AS throughput FROM Metric WHERE entity.guid = 'ENTITY_GUID' SINCE 30 minutes AGO TIMESERIES"
) {
results
}
}
}

모바일 애플리케이션

모바일 애플리케이션 나열

REST API v2: GET /v2/mobile_applications.json

NerdGraph:

{
actor {
entitySearch(
query: "domain = 'MOBILE' AND type = 'APPLICATION' AND accountId = YOUR_ACCOUNT_ID"
) {
results {
entities {
guid
name
reporting
... on MobileApplicationEntityOutline {
applicationId
mobileSummary {
appLaunchCount
crashCount
crashRate
httpErrorRate
httpRequestCount
httpRequestRate
httpResponseTimeAverage
mobileSessionCount
networkFailureRate
usersAffectedCount
}
}
}
nextCursor
}
}
}
}

모바일 애플리케이션 표시

REST API v2: GET /v2/mobile_applications/{id}.json

NerdGraph:

{
actor {
entity(guid: "MOBILE_APP_ENTITY_GUID") {
name
... on MobileApplicationEntity {
applicationId
mobileSummary {
appLaunchCount
crashCount
crashRate
httpErrorRate
httpRequestCount
httpResponseTimeAverage
mobileSessionCount
networkFailureRate
usersAffectedCount
}
}
}
}
}

REST API 모바일 애플리케이션 ID에서 엔티티 GUID를 찾으려면:

{
actor {
entitySearch(query: "domainId = 'MOBILE_APP_ID' AND domain = 'MOBILE'") {
results {
entities {
guid
name
}
}
}
}
}

모바일 애플리케이션 메트릭 데이터

REST API v2: GET /v2/mobile_applications/{id}/metrics/data.json

NerdGraph: NRQL을 사용한 모바일 메트릭 데이터 쿼리:

{
actor {
nrql(
accounts: [YOUR_ACCOUNT_ID]
query: "SELECT average(duration) FROM Mobile WHERE appName = 'YourMobileApp' SINCE 1 HOUR AGO TIMESERIES"
) {
results
}
}
}

모바일 애플리케이션 생성

REST API v2: POST /v2/mobile_applications.json

NerdGraph: agentApplicationCreateMobile 뮤테이션을 사용합니다:

mutation {
agentApplicationCreateMobile(
accountId: YOUR_ACCOUNT_ID
name: "My New Mobile App"
) {
accountId
applicationToken
guid
name
}
}

응답에는 애플리케이션에서 모바일 에이전트를 구성하는 데 필요한 applicationToken 이(가) 포함됩니다. guid 은(는) 후속 NerdGraph 쿼리를 위한 엔티티 GUID입니다.

자세한 내용은 모바일 설정 튜토리얼을 참조하십시오.

브라우저 애플리케이션

브라우저 애플리케이션 나열

NerdGraph:

{
actor {
entitySearch(
query: "domain = 'BROWSER' AND type = 'APPLICATION' AND accountId = YOUR_ACCOUNT_ID"
) {
results {
entities {
guid
name
reporting
... on BrowserApplicationEntityOutline {
applicationId
browserSummary {
ajaxRequestThroughput
ajaxResponseTimeAverage
jsErrorRate
pageLoadThroughput
pageLoadTimeAverage
spaResponseTimeAverage
}
}
}
nextCursor
}
}
}
}

숫자 애플리케이션 ID에서 브라우저 애플리케이션 엔티티 GUID를 찾으려면:

{
actor {
entitySearch(query: "domainId = 'BROWSER_APP_ID' AND domain = 'BROWSER'") {
results {
entities {
guid
name
}
}
}
}
}

독립 실행형 브라우저 애플리케이션 생성

REST API v2: POST /v2/browser_applications.json (복사/붙여넣기 설치 방법)

NerdGraph: agentApplicationCreateBrowser 뮤테이션을 사용합니다:

mutation {
agentApplicationCreateBrowser(
accountId: YOUR_ACCOUNT_ID
name: "My New Browser App"
settings: {
cookiesEnabled: true
distributedTracingEnabled: true
loaderType: SPA
}
) {
guid
name
settings {
cookiesEnabled
distributedTracingEnabled
loaderType
}
}
}

settings 파라미터는 선택 사항입니다. 생략하면 기본값이 사용됩니다. loaderType 옵션은 SPA (기본값), PROLITE입니다.

APM 애플리케이션에서 브라우저 모니터링 활성화

REST API v2: 기존 APM 앱에서 브라우저 모니터링을 활성화하는 작업은 애플리케이션 설정을 통해 수행되었습니다.

NerdGraph: APM 애플리케이션의 엔티티 GUID와 함께 agentApplicationEnableApmBrowser 뮤테이션을 사용하십시오:

mutation {
agentApplicationEnableApmBrowser(
guid: "YOUR_APM_ENTITY_GUID"
settings: {
cookiesEnabled: true
distributedTracingEnabled: true
loaderType: SPA
}
) {
name
settings {
cookiesEnabled
distributedTracingEnabled
loaderType
}
}
}

이렇게 하면 APM 애플리케이션에서 제공하는 페이지에 브라우저 에이전트의 자동 주입이 활성화됩니다. settings 파라미터는 선택 사항입니다. guid 은(는) 브라우저 엔티티 GUID가 아니라 APM 애플리케이션 엔티티 GUID여야 합니다. 로컬 설정을 사용하여 실사용자 모니터링을 제어하는 경우 새로운 APM 애플리케이션에는 이 작업이 필요하지 않은 경우가 많습니다.

보다 자세한 내용은 브라우저 설정 튜토리얼을 참조하십시오.

경고

채널 목록

REST API v2: GET /v2/alerts_channels.json

NerdGraph: NerdGraph에는 채널에 대한 직접적인 쿼리가 없습니다. 공지 워크플로우를 사용하도록 마이그레이션해야 합니다.

{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiWorkflows {
workflows {
entities {
guid
name
workflowEnabled
destinationConfigurations {
channelId
name
type
}
destinationsEnabled
lastRun
}
}
}
}
}
}

이벤트 나열

REST API v2: GET /v2/alerts_events.json

NerdGraph:

인시던트 나열

REST API v2: GET /v2/alerts_incidents.json

NerdGraph:

{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiIssues {
issues {
issues {
account {
id
}
activatedAt
closedAt
conditionFamilyId
conditionName
description
deepLinkUrl
entityGuids
entityNames
}
}
}
}
}
}

위반 나열

REST API v2: GET /v2/alerts_violations.json

NerdGraph: aiIssues 인시던트 쿼리를 사용하십시오:

{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiIssues {
incidents(
filter: {}
timeWindow: { startTime: 1779905700000, endTime: 1779905800000 }
) {
incidents {
account {
id
name
}
closedAt
createdAt
description
entityGuids
entityNames
entityTypes
incidentId
issueId
priority
state
timestamp
title
updatedAt
}
}
}
}
}
}
Copyright © 2026 New Relic Inc.

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