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

문제 신고

Temporal 모니터링 통합

임시 통합은 임시 데이터의 성능을 모니터링하여 쓰기 분산, 내결함성 및 확장 가능한 애플리케이션의 문제를 진단하는 데 도움을 줍니다. Temporal 통합은 가장 중요한 Temporal SDK 앱 지표가 포함된 사전 구축된 대시보드를 제공합니다.

New Relic과의 통합을 설정한 후 즉시 사용 가능한 것과 같은 대시보드에서 데이터를 확인하십시오.

인프라 에이전트 설치

임시 통합을 사용하려면 먼저 동일한 호스트에 인프라 에이전트를 설치 해야 합니다. 클러스터 에이전트 모니터는 호스트 자체를 모니터링하는 반면, 다음 단계에서 설치하게 될 통합은 데이터베이스 및 측정 지표와 같은 임시 데이터로 모니터링을 확장합니다.

Temporal 측정항목 노출

다음 단계에서는 기본 구성 파일 docker-compose.yml 을 사용하여 Temporal Server의 로컬 인스턴스를 실행합니다.

  1. 아직 설치하지 않은 경우 호스트에 dockerdocker-compose 설치합니다.

    bash
    $
    sudo apt install docker
    $
    sudo apt install docker-compose
  2. 저장소를 복제합니다.

    bash
    $
    git clone https://github.com/temporalio/docker-compose.git
  3. 디렉터리를 프로젝트 루트로 변경합니다.

    bash
    $
    sudo nano docker-compose/docker-compose.yml
  4. Prometheus 엔드포인트와 포트를 docker-compose.yml 파일에 추가합니다.

    Environment:
    - PROMETHEUS_ENDPOINT=0.0.0.0:8000
    ports:
    - 8000:8000
  5. docker-compose up 명령어를 실행하여 인스턴스를 빌드합니다.

    bash
    $
    sudo docker-compose up
  6. 다음 URL에서 인스턴스가 올바르게 실행되고 있는지 확인하세요.

    • 임시 서버는 localhost:7233 에서 사용할 수 있습니다.
    • 임시 웹 UI는 다음에서 사용할 수 있습니다. http://YOUR_DOMAIN:8080
    • Temporal 서버 측정항목은 다음에서 사용할 수 있습니다 http://YOUR_DOMAIN:8080/metrics

Java SDK 지표 노출

이제 Prometheus가 스크랩할 SDK 클라이언트 지표를 노출하겠습니다.

  1. 프로젝트 기본 폴더에 MetricsWorker.java 파일을 만듭니다.

    //...
    // You need to import the following packages to set up metrics in Java.
    // See the Developer's guide for packages required for the other SDKs.
    import com.sun.net.httpserver.HttpServer;
    import com.uber.m3.tally.RootScopeBuilder;
    import com.uber.m3.tally.Scope;
    import com.uber.m3.util.Duration;
    import com.uber.m3.util.ImmutableMap;
    // See the Micrometer documentation for configuration details on other supported monitoring systems.
    // This example shows how to set up the Prometheus registry and stats reported.
    PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
    StatsReporter reporter = new MicrometerClientStatsReporter(registry);
    // set up a new scope, report every 10 seconds
    Scope scope = new RootScopeBuilder()
    .tags(ImmutableMap.of(
    "workerCustomTag1",
    "workerCustomTag1Value",
    "workerCustomTag2",
    "workerCustomTag2Value"))
    .reporter(reporter)
    .reportEvery(com.uber.m3.util.Duration.ofSeconds(10));
    // For Prometheus collection, expose the scrape endpoint at port 8077. See Micrometer documentation for details on starting the Prometheus scrape endpoint. For example,
    HttpServer scrapeEndpoint = MetricsUtils.startPrometheusScrapeEndpoint(registry, 8077); //note: MetricsUtils is a utility file with the scrape endpoint configuration. See Micrometer docs for details on this configuration.
    // Stopping the starter stops the HTTP server that exposes the scrape endpoint.
    //Runtime.getRuntime().addShutdownHook(new Thread(() -> scrapeEndpoint.stop(1)));
    //Create Workflow service stubs to connect to the Frontend Service.
    WorkflowServiceStubs service = WorkflowServiceStubs.newServiceStubs(
    WorkflowServiceStubsOptions.newBuilder()
    .setMetricsScope(scope) //set the metrics scope for the WorkflowServiceStubs
    .build());
    //Create a Workflow service client, which can be used to start, signal, and query Workflow Executions.
    WorkflowClient yourClient = WorkflowClient.newInstance(service,
    WorkflowClientOptions.newBuilder().build());
    //...
  2. 프로젝트 디렉터리로 이동하여 프로젝트를 빌드합니다.

    bash
    $
    ./gradlew build
  3. 작업자를 시작합니다.

    bash
    $
    ./gradlew -q execute -PmainClass=<YOUR_METRICS_FILE>
  4. 노출된 Prometheus Scrape 엔드포인트에서 작업자 지표를 확인하세요: http://YOUR_DOMAIN:8077/metrics.

통합 구성

성공적으로 설치한 후에는 설정을 구성해야 합니다.

  1. 다음 경로에 이름이 nri-prometheus-temporal-config.yml 인 파일을 만듭니다.

    bash
    $
    cd /etc/newrelic-infra/integrations.d/
  2. 다음은 구성 파일의 예입니다. 플레이스홀더 URL을 업데이트하세요.

    integrations:
    - name: nri-prometheus
    config:
    standalone: false
    # Defaults to true. When standalone is set to `false`, `nri-prometheus` requires an infrastructure agent to send data.
    emitters: infra-sdk
    # When running with infrastructure agent emitters will have to include infra-sdk
    cluster_name: Temporal_Server_Metrics
    # Match the name of your cluster with the name seen in New Relic.
    targets:
    - description: Temporal_Server_Metrics
    urls: ["http://<YOUR_DOMAIN>:8000/metrics", "http://<YOUR_DOMAIN>:8077/metrics"]
    # tls_config:
    # ca_file_path: "/etc/etcd/etcd-client-ca.crt"
    # cert_file_path: "/etc/etcd/etcd-client.crt"
    # key_file_path: "/etc/etcd/etcd-client.key"
    verbose: false
    # Defaults to false. This determines whether or not the integration should run in verbose mode.
    audit: false
    # Defaults to false and does not include verbose mode. Audit mode logs the uncompressed data sent to New Relic and can lead to a high log volume.
    # scrape_timeout: "YOUR_TIMEOUT_DURATION"
    # `scrape_timeout` is not a mandatory configuration and defaults to 30s. The HTTP client timeout when fetching data from endpoints.
    scrape_duration: "5s"
    # worker_threads: 4
    # `worker_threads` is not a mandatory configuration and defaults to `4` for clusters with more than 400 endpoints. Slowly increase the worker thread until scrape time falls between the desired `scrape_duration`. Note: Increasing this value too much results in huge memory consumption if too many metrics are scraped at once.
    insecure_skip_verify: false
    # Defaults to false. Determins if the integration should skip TLS verification or not.
    timeout: 10s
  3. 지침에 따라 인프라 에이전트를 다시 시작하세요.

    bash
    $
    sudo systemctl restart newrelic-infra.service
  4. 데이터가 뉴렐릭 계정 으로 전송되기 시작할 때까지 몇 분 정도 기다리세요.

데이터 찾기

Temporal 이라는 사전 구축된 대시보드 템플릿을 선택하여 Temporal 지표를 모니터링할 수 있습니다. 사전 구축된 대시보드 템플릿을 사용하려면 다음 단계를 따르세요.

  1. one.newrelic.com 에서, + Add data [+ 데이터 추가] 페이지로 이동합니다.

  2. 대시보드 를클릭합니다.

  3. 검색창에 Temporal 를 입력합니다.

  4. Temporal 대시보드가 나타나야 합니다. 그것을 클릭하여 설치하십시오.

    Temporal 대시보드는 사용자 정의 대시보드로 간주되며 대시보드 UI에서 찾을 수 있습니다.대시보드 사용 및 편집에 대한 문서는 대시보드 문서 를 참조하세요.

    다음은 Temporal 요청 대기 시간 합계를 확인하는 NRQL 쿼리입니다:

    SELECT sum(temporal_request_latency_sum) FROM Metric WHERE scrapedTargetURL = 'http://<YOUR_DOMAIN>:8000/metrics'
Copyright © 2024 New Relic Inc.

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