0Pricing
API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) · 강의

Actuator 및 Prometheus로 메트릭 노출하기

Spring Boot Actuator를 통해 게이트웨이 상태와 경로 메트릭을 제공하고 Prometheus로 수집해 전체 시스템을 관찰합니다.

Actuator 및 Prometheus로 메트릭 노출하기은(는) CoddyKit의 무료 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Seeing Inside the Gateway

Tracing shows individual request journeys, but you also need aggregate metrics: request rates, error counts, latency. Spring Boot Actuator plus Micrometer expose these for the gateway.

Adding Actuator

The Actuator starter adds production-ready endpoints for health, info, and metrics.

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Exposing Endpoints

By default most endpoints are hidden over HTTP. Expose the ones you need explicitly.

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,gateway

The Gateway Endpoint

The gateway actuator endpoint lists all active routes and their configuration, invaluable for debugging routing in a running system.

curl http://localhost:8080/actuator/gateway/routes

Micrometer Metrics

Micrometer is the metrics facade. The gateway records timers like spring.cloud.gateway.requests tagged by route id, status, and method.

Enabling Gateway Metrics

Make sure metric collection for the gateway is turned on so per-route timers are recorded.

spring:
  cloud:
    gateway:
      metrics:
        enabled: true

The Prometheus Registry

Add the Prometheus registry so metrics are published in Prometheus' text format at /actuator/prometheus.

<dependency>
  <groupId>io.micrometer</groupId>
  <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

Inspecting the Scrape Endpoint

Hit the endpoint to see raw metrics. Prometheus will scrape this same URL on a schedule.

curl http://localhost:8080/actuator/prometheus

Configuring a Scrape Job

Point Prometheus at the gateway with a scrape job describing the path and target.

scrape_configs:
  - job_name: gateway
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: ['gateway:8080']

Useful Metrics to Watch

Key signals include request count, error rate (5xx), and p95 latency per route. Alert when error rate or latency crosses a threshold.

  • spring_cloud_gateway_requests_seconds_count
  • spring_cloud_gateway_requests_seconds_max

Securing the Endpoints

Actuator endpoints can leak internals. In production restrict them to an internal network or protect them with authentication.

management:
  endpoints:
    web:
      base-path: /internal/actuator

Quick Check

Which actuator endpoint exposes metrics in a format Prometheus can scrape?

Recap

You made the gateway observable:

  • Actuator exposes health, metrics, and the gateway route view
  • Micrometer records per-route timers
  • The Prometheus registry serves /actuator/prometheus
  • Prometheus scrapes and you alert on errors and latency

With tracing plus metrics you have end-to-end visibility into gateway traffic.

자주 묻는 질문

“Actuator 및 Prometheus로 메트릭 노출하기” 강의는 무료인가요?

네 — “Actuator 및 Prometheus로 메트릭 노출하기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의 전체를 잠금 해제할 수 있습니다. API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의에는 총 4개의 강의가 포함되어 있습니다.

“Actuator 및 Prometheus로 메트릭 노출하기”에서 뭘 배우나요?

Spring Boot Actuator를 통해 게이트웨이 상태와 경로 메트릭을 제공하고 Prometheus로 수집해 전체 시스템을 관찰합니다. 브라우저에서 직접 실행하는 실습 코드로 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.

“Actuator 및 Prometheus로 메트릭 노출하기” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. JWT 인증 및 권한 부여
  2. Sleuth 및 Zipkin을 사용한 분산 추적
  3. Config Server를 사용한 중앙 집중식 설정
  4. Actuator 및 Prometheus로 메트릭 노출하기
← API Gateway & Reverse Proxy (Nginx + Spring Cloud Gateway)(으)로 돌아가기