Package zipkin2.reporter
Class HttpEndpointSuppliers
- java.lang.Object
-
- zipkin2.reporter.HttpEndpointSuppliers
-
public final class HttpEndpointSuppliers extends Object
Built-inHttpEndpointSupplierimplementations.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description HttpEndpointSuppliers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpEndpointSupplier.FactoryconstantFactory()Returns a HttpEndpointSupplier.Factory which callsnewConstant(String)for each input.static HttpEndpointSupplier.ConstantnewConstant(String endpoint)senderimplementations look for a HttpEndpointSuppliers.Constant to avoid the overhead of dynamic lookups on each call toBaseHttpSender.postSpans(Object, Object).static HttpEndpointSuppliernewRateLimited(HttpEndpointSupplier input, int intervalSeconds)Dynamic HttpEndpointSuppliers can guard against abuse by rate-limiting them.static HttpEndpointSupplier.FactorynewRateLimitedFactory(HttpEndpointSupplier.Factory input, int intervalSeconds)Returns a HttpEndpointSupplier.Factory which callsnewRateLimited(HttpEndpointSupplier, int)for each input.
-
-
-
Method Detail
-
constantFactory
public static HttpEndpointSupplier.Factory constantFactory()
Returns a HttpEndpointSupplier.Factory which callsnewConstant(String)for each input.- Since:
- 3.3
-
newConstant
public static HttpEndpointSupplier.Constant newConstant(String endpoint)
senderimplementations look for a HttpEndpointSuppliers.Constant to avoid the overhead of dynamic lookups on each call toBaseHttpSender.postSpans(Object, Object).- Since:
- 3.3
-
newRateLimitedFactory
public static HttpEndpointSupplier.Factory newRateLimitedFactory(HttpEndpointSupplier.Factory input, int intervalSeconds)
Returns a HttpEndpointSupplier.Factory which callsnewRateLimited(HttpEndpointSupplier, int)for each input.- Parameters:
intervalSeconds- amount of time to wait *after* calls to get before trying again.- Returns:
- a factory that returns rate-limited suppliers unless the input was a HttpEndpointSupplier.Constant.
- Throws:
IllegalArgumentException- if intervalSeconds is less than one.- Since:
- 3.3
-
newRateLimited
public static HttpEndpointSupplier newRateLimited(HttpEndpointSupplier input, int intervalSeconds)
Dynamic HttpEndpointSuppliers can guard against abuse by rate-limiting them.Calling this will invoke
HttpEndpointSupplier.get()on the input. This ensures at least one successful call or an error.Note: errors that occur during get will be logged and ignored. This allows the sender to attempt a prior endpoint vs erring on repeat.
- Parameters:
input- what to rate-limit.intervalSeconds- amount of time to wait *after* calls to get before trying again.- Returns:
- a rate-limited supplier unless the input was a HttpEndpointSupplier.Constant.
- Throws:
IllegalArgumentException- if intervalSeconds is less than one.- Since:
- 3.3
-
-