diff --git a/multi/multi_netflix-metrics.html b/multi/multi_netflix-metrics.html index a7fa9ec25..8f1978ad0 100644 --- a/multi/multi_netflix-metrics.html +++ b/multi/multi_netflix-metrics.html @@ -24,7 +24,7 @@ restTemplate.getForObject(</dependency>
In Spectator parlance, a meter is a named, typed, and tagged configuration and a metric represents the value of a given meter at a point in time. Spectator meters are created and controlled by a registry, which currently has several different implementations. Spectator provides 4 meter types: counter, timer, gauge, and distribution summary.
Spring Cloud Spectator integration configures an injectable com.netflix.spectator.api.Registry instance for you. Specifically, it configures a ServoRegistry instance in order to unify the collection of REST metrics and the exporting of metrics to the Atlas backend under a single Servo API. Practically, this means that your code may use a mixture of Servo monitors and Spectator meters and both will be scooped up by Spring Boot Actuator MetricReader instances and both will be shipped to the Atlas backend.
A counter is used to measure the rate at which some event is occurring.
// create a counter with a name and a set of tags Counter counter = registry.counter("counterName", "tagKey1", "tagValue1", ...); counter.increment(); // increment when an event occurs -counter.increment(10); // increment by a discrete amount
The counter records a single time-normalized statistic.
A timer is used to measure how long some event is taking. Spring Cloud automatically records timers for Spring MVC requests and conditionally RestTemplate requests, which can later be used to create dashboards for request related metrics like latency:
// create a timer with a name and a set of tags +counter.increment(10); // increment by a discrete amount
The counter records a single time-normalized statistic.
A timer is used to measure how long some event is taking. Spring Cloud automatically records timers for Spring MVC requests and conditionally RestTemplate requests, which can later be used to create dashboards for request related metrics like latency:
// create a timer with a name and a set of tags Timer timer = registry.timer("timerName", "tagKey1", "tagValue1", ...); // execute an operation and time it at the same time diff --git a/multi/multi_spring-cloud-feign.html b/multi/multi_spring-cloud-feign.html index 405ba8937..ccdf5bbeb 100644 --- a/multi/multi_spring-cloud-feign.html +++ b/multi/multi_spring-cloud-feign.html @@ -95,24 +95,20 @@ a separate request interceptor.@Autowired public FooController( - Decoder decoder, Encoder encoder, Client client, Contract contract) { + Decoder decoder, Encoder encoder, Client client) { this.fooClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("user", "user")) .target(FooClient.class, "http://PROD-SVC"); this.adminClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin")) .target(FooClient.class, "http://PROD-SVC"); } }
Note In the above example
FeignClientsConfiguration.classis the default configuration -provided by Spring Cloud Netflix.
Note
PROD-SVCis the name of the service the Clients will be making requests to.
Note The Feign
Contractobject defines what annotations and values are valid on interfaces. The -autowiredContractbean provides supports for SpringMVC annotations, instead of -the default Feign native annotations.
If Hystrix is on the classpath and feign.hystrix.enabled=true, Feign will wrap all methods with a circuit breaker. Returning a com.netflix.hystrix.HystrixCommand is also available. This lets you use reactive patterns (with a call to .toObservable() or .observe() or asynchronous use (with a call to .queue()).
To disable Hystrix support on a per-client basis create a vanilla Feign.Builder with the "prototype" scope, e.g.:
@Configuration
+provided by Spring Cloud Netflix.![]() | Note |
|---|---|
|
If Hystrix is on the classpath and feign.hystrix.enabled=true, Feign will wrap all methods with a circuit breaker. Returning a com.netflix.hystrix.HystrixCommand is also available. This lets you use reactive patterns (with a call to .toObservable() or .observe() or asynchronous use (with a call to .queue()).
To disable Hystrix support on a per-client basis create a vanilla Feign.Builder with the "prototype" scope, e.g.:
@Configuration public class FooConfiguration { @Bean @Scope("prototype") diff --git a/single/spring-cloud-netflix.html b/single/spring-cloud-netflix.html index f7faf0ea3..cdfc17cfa 100644 --- a/single/spring-cloud-netflix.html +++ b/single/spring-cloud-netflix.html @@ -562,24 +562,20 @@ a separate request interceptor.@Autowired public FooController( - Decoder decoder, Encoder encoder, Client client, Contract contract) { + Decoder decoder, Encoder encoder, Client client) { this.fooClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("user", "user")) .target(FooClient.class, "http://PROD-SVC"); this.adminClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin")) .target(FooClient.class, "http://PROD-SVC"); } }
Note In the above example
FeignClientsConfiguration.classis the default configuration -provided by Spring Cloud Netflix.
Note
PROD-SVCis the name of the service the Clients will be making requests to.
Note The Feign
Contractobject defines what annotations and values are valid on interfaces. The -autowiredContractbean provides supports for SpringMVC annotations, instead of -the default Feign native annotations.
If Hystrix is on the classpath and feign.hystrix.enabled=true, Feign will wrap all methods with a circuit breaker. Returning a com.netflix.hystrix.HystrixCommand is also available. This lets you use reactive patterns (with a call to .toObservable() or .observe() or asynchronous use (with a call to .queue()).
To disable Hystrix support on a per-client basis create a vanilla Feign.Builder with the "prototype" scope, e.g.:
@Configuration
+provided by Spring Cloud Netflix.![]() | Note |
|---|---|
|
If Hystrix is on the classpath and feign.hystrix.enabled=true, Feign will wrap all methods with a circuit breaker. Returning a com.netflix.hystrix.HystrixCommand is also available. This lets you use reactive patterns (with a call to .toObservable() or .observe() or asynchronous use (with a call to .queue()).
To disable Hystrix support on a per-client basis create a vanilla Feign.Builder with the "prototype" scope, e.g.:
@Configuration public class FooConfiguration { @Bean @Scope("prototype") @@ -1332,7 +1328,7 @@ restTemplate.getForObject(</dependency>
In Spectator parlance, a meter is a named, typed, and tagged configuration and a metric represents the value of a given meter at a point in time. Spectator meters are created and controlled by a registry, which currently has several different implementations. Spectator provides 4 meter types: counter, timer, gauge, and distribution summary.
Spring Cloud Spectator integration configures an injectable com.netflix.spectator.api.Registry instance for you. Specifically, it configures a ServoRegistry instance in order to unify the collection of REST metrics and the exporting of metrics to the Atlas backend under a single Servo API. Practically, this means that your code may use a mixture of Servo monitors and Spectator meters and both will be scooped up by Spring Boot Actuator MetricReader instances and both will be shipped to the Atlas backend.
A counter is used to measure the rate at which some event is occurring.
// create a counter with a name and a set of tags Counter counter = registry.counter("counterName", "tagKey1", "tagValue1", ...); counter.increment(); // increment when an event occurs -counter.increment(10); // increment by a discrete amount
The counter records a single time-normalized statistic.
A timer is used to measure how long some event is taking. Spring Cloud automatically records timers for Spring MVC requests and conditionally RestTemplate requests, which can later be used to create dashboards for request related metrics like latency:
// create a timer with a name and a set of tags +counter.increment(10); // increment by a discrete amount
The counter records a single time-normalized statistic.
A timer is used to measure how long some event is taking. Spring Cloud automatically records timers for Spring MVC requests and conditionally RestTemplate requests, which can later be used to create dashboards for request related metrics like latency:
// create a timer with a name and a set of tags Timer timer = registry.timer("timerName", "tagKey1", "tagValue1", ...); // execute an operation and time it at the same time diff --git a/spring-cloud-netflix.xml b/spring-cloud-netflix.xml index 02d03d095..e74ca2c39 100644 --- a/spring-cloud-netflix.xml +++ b/spring-cloud-netflix.xml @@ -4,7 +4,7 @@Spring Cloud Netflix -2018-01-12 +2018-01-10 @@ -1094,17 +1094,15 @@ class FooController { @Autowired public FooController( - Decoder decoder, Encoder encoder, Client client, Contract contract) { + Decoder decoder, Encoder encoder, Client client) { this.fooClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("user", "user")) .target(FooClient.class, "http://PROD-SVC"); this.adminClient = Feign.builder().client(client) .encoder(encoder) .decoder(decoder) - .contract(contract) .requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin")) .target(FooClient.class, "http://PROD-SVC"); } @@ -1116,11 +1114,6 @@ provided by Spring Cloud Netflix. - PROD-SVC is the name of the service the Clients will be making requests to.- The Feign -Contract object defines what annotations and values are valid on interfaces. The -autowiredContract bean provides supports for SpringMVC annotations, instead of -the default Feign native annotations.Feign Hystrix Support