-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resilience4J bulkhead metrics missing at /actutor/prometheus #121
Comments
Where does this happen? I am not seeing it Also if we removed the group tag wouldn't that result in the CB not being part of the group? Wonder if @Ferioney might care to comment as he originally wrote this code. |
See:
In my opinion tags sent to Resilience4j are only used for metrics. Grouping is implemented in Spring Cloud and is not directly related to any of Resilience4j feature. Will not break anything in my opinion. |
@tjuchniewicz would it be possible to provide a sample that reproduces the problem so I can dig into it further? |
Set a common group tag. Fixes #121
Use MeterFilter instead of MeterRegistryCustomizer
@ryanjbaxter is this really fixed? I'm using: <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
<version>2.1.1</version>
</dependency> and issue still exists? |
It should be yes, I tested it with the sample you provided in the issue |
Can you show what exactly you change in the sample? I double checked using spring-cloud-starter-circuitbreaker-resilience4j 2.1.1 and issue still exists. |
The only change I made was switch the boot version to 2.6.3 and the cloud version to 2021.0.1. I also fixed the property names in application properties
If I go to http://localhost:8080/actuator/prometheus using 2021.0.0 I get the following...
If I go to http://localhost:8080/actuator/prometheus using 2021.0.1 I get the following...
|
@ryanjbaxter See tjuchniewicz/r4j-metrics-issue@69bb56d. I've checked several times.. For me issue still exists... Could you double check on your side again? |
Can you add |
Works with |
How to reproduce
cb1
,cb2
)resilience4j.thread-pool-bulkhead.configs.default.coreThreadPoolSiz: 5
resilience4j.thread-pool-bulkhead.instances.cb2.coreThreadPoolSize: 10
cb1
(e.g.resilience4j.bulkhead.max.thread.pool.size
) at /prometheus but /metrics is fineExplanation
Prometheus requires that all meters with the same name have the same set of tag keys. See: micrometer-metrics/micrometer#877
When we define custom config for circuit breaker, Spring Cloud Circuit Breaker (SCCB) will initialize CB instance at startup and this automatically register metric in Micrometer without any tags.
At runtime, for all CB instances, SCCB executes
Resilience4jBulkheadProvider.run()
and initializes other CB usinggroup
tag. See:spring-cloud-circuitbreaker/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreaker.java
Line 107 in 72868b7
The result is that Prometheus will ignore metrics for
cb1
.Workaround
Remove
group
tag in your code:Proposed fix
Do not pass
group
tag toResilience4jBulkheadProvider
. Do we really need group as tag? Looks like the same value is used as name tag (created fromid
).The text was updated successfully, but these errors were encountered: