promethus가 추가 작성한 spring-actuator를 인식 못해요
711
작성한 질문수 7
몇 일 전에 인식 안된다고 했었던 수강생입니다.
다름이 아니라 당시, 회사일로 확인 못하다가 방금 확인했는데도 spring-actuator라는 job-name을 인식을 못하네요.
다시 한번 코드 첨부 드립니다.
application.yml
management:
server:
port: 8081
info:
java:
enabled: true
os:
enabled: true
env:
enabled: true
endpoint:
shutdown:
enabled: true
health:
show-details: always
endpoints:
web:
exposure:
include: prometheus
info:
app:
name: hello-actuator
company: house
server:
tomcat:
mbeanregistry:
enabled: true
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
port: 8081
logging:
level:
web: debug
prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
rule_files:
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: [ "localhost:9090" ]
- job_name: "spring-actuator"
metrics_path: '/actuator/prometheus'
scrape_interval: 1s
static_configs:
- targets: [ 'localhost:8081' ]

build.gradle
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
현재는 window 환경에서 실행 중인데도 안되네요..ㅠㅠㅠ
prometheus 버전 2.48.1 버전과 혹시 싶어 2.45 버전 둘 다 써봤는데도 안돼요..
이런거에 경험해보신 분 있을까요? 더 이상 진도를 못나가고 있어요.. 😭😭
답변 3
1
./prometheus --config.file=/Users/names/Desktop/actuator/prometheus.yml
로 지정해서 실행하니까 실행됐습니다.
프로메테우스 실행시 config로 지정해줘야하나요?
이전까지는 ./prometheus로만 실행했었어요.
0
안녕하세요. 강민승님
보내주신 파일에 적어주신 설정을 다 적용해보았는데요.
이슈 없이 잘 수행이 됩니다.

다음 옵션을 적어주었을 때는 잘 되었다고 말씀해주셨는데요.
--config.file=/Users/names/Desktop/actuator/prometheus.yml
이 부분은 저도 정확히 잘 모르겠습니다. 저의 경우는 해당 옵션을 사용하지 않아도 잘 작동했습니다.
관련해서 비슷한 이슈가 있으셨던 분이 있으면 답변 부탁드려요.
감사합니다.
1
혹시 경로를 지정하신 prometheus.yml 파일과 prometheus 기본 경로에 있는 yml 파일의 내용이 서로 다를 수도 있습니다. 이 부분도 추가로 확인해주세요 🙂
0
안녕하세요. 강민승님
스프링 프로젝트 전체와 프로메테우스도 전체 압축해서 전달해주세요.
구글 드라이브 업로드 방법은 다음을 참고해주세요.
주의: 업로드시 링크에 있는 권한 문제 꼭 확인해주세요
추가로 다음 내용도 코멘트 부탁드립니다.
1. 문제 영역을 실행할 수 있는 방법
2. 문제가 어떻게 나타나는지에 대한 상세한 설명
링크: 공식 서포터즈
링크: 자주하는 질문
감사합니다.
0
https://drive.google.com/file/d/1P9MQakU2pF81FITsfJm0QEbehNq82ago/view?usp=sharing
0. 시크릿 모드로 권한 문제 확인했습니다!
1. ./prometheus 실행, application 실행 후 localhost:9090/config
2. iterm 으로 ./prometheus 로 실행하면 config, targets ... 탭에서 job-name 으로 설정한 'b-tutorial'이 안나오는 문제가 있습니다.
보안이 엄격한 데이터
0
73
1
MyProperties 자체를 클라이언트 코드에서 사용
1
43
1
http://localhost:8080/actuator/prometheus
0
85
3
jar 추가에대한 질문드려도될까요?
0
64
1
build.gradle bom link 변경
0
65
2
@Counted 초기화
0
47
1
@Validated를 적용해도 빈 검증이 안되는 경우에 대한 조치 공유..
0
101
2
springboot에서 actuator없이 micrometer를 사용할수 있나요?
0
67
1
@Configuration 질문드립니다.
0
84
2
[공유] 터미널 말고 IDE 에서 jar 실행하기
0
101
1
localhost:8080/hello-servlet 404오류
0
123
2
내장톰캣2 서블릿 톰켓 실행이 안됩니다
1
154
2
최대 Tomcat 스레드 수를 확인하는 지표
0
160
1
mac m2에서 startup.sh 실행후 아무 반응이 없습니다.
0
94
2
내장 톰캣 실행 오류 관련 질문드립니다.
0
158
1
스프링 발전 과정들도 자세히 알아둬야하나요??
1
127
1
스프링부트 ioc 컨테이너 갯수
0
89
1
404 페이지
0
133
3
actuator 호출시 타임스탬프 질문
0
90
1
순수 라이브러리 사용하기 2 - memory-v1
0
125
1
외부설정 @ConfigurationProperties의 내부 클래스에서 static을 사용하는 이유를 알고 싶습니다.
0
105
1
서블릿 컨테이너 초기화1 강의 관련 질문입니다~
0
93
1
Thread Config Max 패널 설정 변경 질문
0
128
1
스프링 액츄에이터 shutdown 엔드포인트 활성화가 안됩니다.
0
107
1





