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

問題を作成する

NerdGraph チュートリアル: モバイル エージェントの監視の例

UI を使用する代わりに、NerdGraph API でモバイル アプリケーションを作成できます。これの利点は、モバイル アプリケーションを New Relic で計測するときに、アプリケーション トークンをプログラムで作成および取得して、モバイル アプリケーションにコピー アンド ペーストできることです。

新しいモバイル アプリケーションを作成する

以下は、新しいモバイル アプリケーションを作成するミューテーションの例です。アプリケーションのアカウント ID と名前を指定する必要があります。

突然変異:

mutation CreateExampleMobileApplication($accountId: Int!, $name: String!) {
agentApplicationCreateMobile(accountId: $accountId, name: $name) {
accountId
applicationToken
guid
name
}
}

変数:

{
"accountId": Int!,
"name": String!
}

アプリケーション トークンの取得

次のクエリを使用して、モバイル アプリケーション トークンを取得できます。

クエリ:

query FetchMobileApplicationToken($guid: EntityGuid!) {
actor {
entity(guid: "") {
... on MobileApplicationEntity {
guid
name
mobileProperties {
applicationToken
}
}
}
}
}

変数:

{
"guid": EntityGuid!
}

モバイル アプリの名前を変更する

以下は、New Relic でモバイル アプリの名前を変更するミューテーションの例です。

突然変異:

mutation UpdateMobileApplicationAlias($guid: EntityGuid!, $settings: $AgentApplicationSettingsUpdateInput) {
agentApplicationSettingsUpdate(guid: $guid, settings: $settings) {
alias
guid
errors {
description
errorClass
field
}
}
}

変数:

{
"guid": EntityGuid!,
"settings": {
"alias": String
}
}

モバイル監視の構成例

設定方法の例は次のとおりです NerdGraph による設定:

突然変異:

mutation UpdateMobileSettingsExample(
$guid: EntityGuid!
$settings: AgentApplicationSettingsUpdateInput!
) {
agentApplicationSettingsUpdate(guid: $guid, settings: $settings) {
guid
errors {
description
errorClass
field
}
alias
mobileSettings {
networkSettings {
aliases {
alias
hosts
}
filterMode
hideList
ignoredStatusCodeRules {
hosts
statusCodes
}
showList
}
useCrashReports
}
}
}

変数:

{
"guid": EntityGuid!,
"settings": {
"alias": String,
"mobileSettings": {
"networkSettings": {
"aliases": [
{
"alias": String!,
"hosts": [String!]!
}
],
"filterMode": AgentApplicationSettingsNetworkFilterMode,
"hideList": [String!],
"ignoredStatusCodeRules": [
{
"hosts": [String!]!,
"statusCodes": [String!]!
}
],
"showList": [String!]
},
"useCrashReports": Boolean
}
}
}
Copyright © 2024 New Relic株式会社。

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