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

이 한글 문서는 사용자의 편의를 위해 기계 번역되었습니다.

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

문제 신고

Ionic Capacitor 모바일 앱을 모니터링하세요

New Relic Ionic Capacitor 에이전트는 Ionic Capacitor 모바일 앱을 모니터링하고 앱 성능, 오류 및 사용자 경험에 대한 깊은 통찰력을 제공합니다. 에이전트에는 New Relic의 기본 에이전트가 자동으로 포함되어 모바일 모니터링 및 성능 가시성을 제공합니다. 에이전트를 설치하고 구성하면 다음을 수행할 수 있습니다.

  • Capture JavaScript errors:

    문제를 신속하게 식별하고 해결합니다.

  • Track network requests:

    앱이 백앤드와 어떻게 상호작용하는지 알아보세요.

  • Use distributed tracing:

    처리된 예외를 자세히 살펴보고 근본 원인을 찾으세요.

  • Create custom events and metrics:

    사용자가 앱과 상호 작용하는 방식을 이해합니다.

자세한 내용은 Github의 New Relic Ionic Capacitor 에이전트를 참조하세요.

호환성 요구 사항

에이전트를 설치하기 전에 앱이 다음 요구 사항을 충족하는지 확인하세요.

(권장) 설치 안내

에이전트를 설치하려면 UI에 직접 있는 설치 안내를 따르세요.

수동 설치

에이전트를 수동으로 설치해야 하는 경우 다음 단계를 따르세요.

애플리케이션 토큰 만들기

  1. one.newrelic.com > Browser & Mobile > (choose Android or iOS)

    으로 이동한 후 UI에서 측정, 로그 단계를 완료하세요.

  2. UI의

    Step 4

    에서 애플리케이션 토큰(해당하는 경우 iOS 및 Android용 토큰)을 복사합니다.

커패시터 에이전트 추가

프로젝트 디렉터리에서 명령줄 도구를 사용하여 프로젝트에 Capacitor 에이전트를 추가합니다.

bash
$
npm install @newrelic/newrelic-capacitor-plugin
$
npx cap sync

커패시터 구성

  1. main.ts (Angular 또는 Vue) 또는 index.tsx (React)에서 앱 초기화 시 Capacitor 에이전트를 시작합니다.

  2. 다음 코드를 추가하세요.

    import { NewRelicCapacitorPlugin, NREnums, AgentConfiguration } from '@newrelic/newrelic-capacitor-plugin';
    import { Capacitor } from '@capacitor/core';
    var appToken;
    if(Capacitor.getPlatform() === 'ios') {
    appToken = '<IOS-APP-TOKEN>';
    } else {
    appToken = '<ANDROID-APP-TOKEN>';
    }
    if(Capacitor.getPlatform() === 'ios') {
    appToken = '<IOS-APP-TOKEN>';
    } else {
    appToken = '<ANDROID-APP-TOKEN>';
    }
    let agentConfig : AgentConfiguration = {
    //Android Specific
    // Optional:Enable or disable collection of event data.
    analyticsEventEnabled: true,
    // Optional:Enable or disable crash reporting.
    crashReportingEnabled: true,
    // Optional:Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.
    interactionTracingEnabled: true,
    // Optional:Enable or disable reporting successful HTTP requests to the MobileRequest event type.
    networkRequestEnabled: true,
    // Optional:Enable or disable reporting network and HTTP request errors to the MobileRequestError event type.
    networkErrorRequestEnabled: true,
    // Optional:Enable or disable capture of HTTP response bodies for HTTP error traces, and MobileRequestError events.
    httpResponseBodyCaptureEnabled: true,
    // Optional:Enable or disable agent logging.
    loggingEnabled: true,
    // Optional:Specifies the log level. Omit this field for the default log level.
    // Options include: ERROR (least verbose), WARNING, INFO, VERBOSE, AUDIT (most verbose).
    logLevel: NREnums.LogLevel.INFO,
    // iOS Specific
    // Optional:Enable/Disable automatic instrumentation of WebViews
    webViewInstrumentation: true,
    // Optional:Set a specific collector address for sending data. Omit this field for default address.
    // collectorAddress: "",
    // Optional:Set a specific crash collector address for sending crashes. Omit this field for default address.
    // crashCollectorAddress: "",
    // Optional:Enable or disable sending JS console logs to New Relic.
    sendConsoleEvents: true,
    // Optional:Enable or disable reporting data using different endpoints for US government clients
    //fedRampEnabled: false
    // Optional: Enable or disable offline data storage when no internet connection is available.
    offlineStorageEnabled: true
    }
    NewRelicCapacitorPlugin.start({appKey:appToken, agentConfiguration:agentConfig})

    위 코드의 appToken = "" 에 애플리케이션 토큰을 붙여넣었는지 확인하세요. iOS 및 Android 플랫폼 모두에 하이브리드 앱을 배포한 경우 iOS용 토큰과 Android용 토큰 두 개를 추가해야 합니다.

(Android만 해당) Android 기반 앱을 모니터링하는 경우 다음 단계를 따르세요.

  1. New Relic 기본 Android 에이전트를 설치합니다.

  2. 업데이트 build.gradle :

    buildscript {
    ...
    repositories {
    ...
    mavenCentral()
    }
    dependencies {
    ...
    classpath "com.newrelic.agent.android:agent-gradle-plugin:6.11.1"
    }
    }
  3. 업데이트 app/build.gradle :

    apply plugin: "com.android.application"
    apply plugin: 'newrelic' // <-- add this
  4. 다음 행을 AndroidManifest.xml 에 추가하여 앱이 INTERNETACCESS_NETWORK_STATE 권한을 요청하는지 확인하십시오.

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  5. 패키지를 자동으로 연결하려면 프로젝트를 다시 빌드하십시오.

    bash
    $
    # Android apps
    $
    ionic capacitor run android
    $
    # iOS apps
    $
    ionic capacitor run ios

앱 배포

그런 다음 앱을 배포합니다. 앱 활동이 끝나면 New Relic에 데이터가 표시됩니다(앱을 배포한 후 몇 분 정도 걸릴 수 있음).

에이전트 계측 사용자 지정

에이전트 계측을 사용자 정의해야 합니까? 공개 모바일 SDK API 방법을 사용하면 사용자 지정 데이터를 수집하고 기본 설정을 구성하는 등의 작업을 수행할 수 있습니다.

Capacitor 에이전트에 대해 다음 사용자 지정을 사용할 수 있습니다.

원하는 경우...

이 방법을 사용하십시오

충돌 문제 해결에 도움이 될 수 있는 앱 활동을 추적하기 위해 이동 경로를 기록합니다.

이동 경로 기록

메서드를 상호 작용으로 추적합니다.

상호 작용 시작

상호 작용 중지

커스텀 오류 기록

사용자 지정 오류 기록

맞춤 측정항목을 기록합니다.

맞춤 측정항목 기록

사용자 지정 속성 및 이벤트를 기록합니다.

사용자 정의 속성 및 이벤트를 보고하는 방법에는 여러 가지가 있습니다.

사용자 지정 네트워크 요청 및 실패를 추적합니다.

HTTP 요청 추적

실패한 HTTP 요청 추적

에이전트를 종료합니다.

에이전트 종료

기본 모바일 모니터링 설정을 활성화/비활성화합니다.

모니터링 기능 활성화/비활성화

테스트 충돌 보고서를 실행합니다.

충돌 보고 테스트

JavaScript 오류 문제 해결

Copyright © 2024 New Relic Inc.

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