Replies: 1 comment
-
可以尝试下社区近期的 PR: #3173 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
配置如下
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
shutdown:
enabled: true
metrics:
enabled: true
prometheus:
enabled: true
metrics:
tags:
application: it-${spring.application.name}
export:
prometheus:
enabled: true
pushgateway:
base-url: 192.168.1.121:9091
push-rate: 5s
job: it-${spring.application.name}
enabled: true
将这个类https://app.codecov.io/gh/alibaba/Sentinel/pull/735/blob/sentinel-extension/sentinel-metric-prometheus/src/main/java/com/alibaba/csp/sentinel/metric/extension/prometheus/PrometheusMetricExtension.java
复制到我的项目,并通过SPI方式引入,可以成功将指标数据推送到pushgateway,但是没有sentinel的相应指标(pushgateway的指标地址http://192.168.1.121:9091/metrics),而且看了项目暴露的prometheus指标(http://localhost:8081/actuator/prometheus),有sentinel响应的注释,但是没有数据(接口有访问,debug也有执行到onPass),如下
#HELP sentinel_pass_requests_total total pass requests.
#TYPE sentinel_pass_requests_total counter
#HELP sentinel_success_requests_total total success requests.
#TYPE sentinel_success_requests_total counter
#HELP sentinel_block_requests_total total block requests.
#TYPE sentinel_block_requests_total counter
只有注释行没有数据,
Beta Was this translation helpful? Give feedback.
All reactions