Skip to content

Failsafe 3.0 instrumentation introduced #14057

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

onurkybsi
Copy link

As requested in #10856, Failsafe instrumentation introduced. Intrumentation of other Failsafe policies such as RetryPolicy, RateLimiter, Bulkhead will be added with upcoming PRs.

@onurkybsi onurkybsi requested a review from a team as a code owner June 18, 2025 06:39
Comment on lines 629 to 630
include("instrumentation:failsafe-3.0:library")
include("instrumentation:failsafe-3.0:testing")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other instrumentations are listed in alphabetical order

import java.util.Objects;
import org.junit.jupiter.api.Test;

public abstract class AbstractFailsafeTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate testing module is often used to share code between library and javaagent instrumentation. Here you only have the library instrumentation, consider getting rid of the testing module. Also merging the testing code into the library module would probably resolve the latest dep test failure you have.

LongCounter failureCounter =
meter
.counterBuilder("failsafe.circuitbreaker.failure.count")
.setDescription("Count of failed circuit breaker executions")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually metric descriptions end with a .


final class CircuitBreakerEventListenerBuilders {
private CircuitBreakerEventListenerBuilders() {
throw new AssertionError();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't add throw new AssertionError(); to private constructors

}

dependencies {
library("dev.failsafe:failsafe:3.0.1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.0.0 doesn't work?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, .builder(PolicyConfig) is added in 3.0.1. This enables us to extend user configured CircuitBreaker with the instrumentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trask is it ok to name the instrumentation 3.0.1 when the first supported version is really 3.0.1? I think it is fine, we don't have any other instrumentations that would use patch version in the name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think it's better to keep the name of the instrumentation as 3.0 to conform with others and just mention 3.0.1+ in the docs

@@ -626,7 +627,6 @@ include(":instrumentation:xxl-job:xxl-job-2.3.0:javaagent")
include(":instrumentation:xxl-job:xxl-job-common:javaagent")
include(":instrumentation:xxl-job:xxl-job-common:testing")
include(":instrumentation:zio:zio-2.0:javaagent")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this empty line as separator.

@@ -65,6 +65,7 @@ These are the supported libraries and frameworks:
| [Elasticsearch API Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/index.html) | 7.16 - 7.17.19,<br>8.0 - 8.9.+ [4] | N/A | [Elasticsearch Client Spans] |
| [Elasticsearch REST Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html) | 5.0+ | N/A | [Database Client Spans], [Database Client Metrics]&nbsp;[6] |
| [Elasticsearch Transport Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html) | 5.0+ | N/A | [Database Client Spans], [Database Client Metrics]&nbsp;[6] |
| [Failsafe](https://failsafe.dev/) | 3.0.1+ | [opentelemetry-failsafe-3.0](../instrumentation/failsafe-3.0/library) | none |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trask I think this might be the first library only instrumentation we have. Do we need to point this out somehow here? Set the Auto-instrumented versions to N/A? Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N/A in the auto-instrumented versions column sounds good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants