You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-5Lines changed: 58 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,11 @@ All in all, you should do the following:
29
29
And
30
30
4. Adjust your logging configuration accordingly.
31
31
32
-
Let's say you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM with property `cf-logging-version` referring to the latest nexus version (currently `3.0.1`):
32
+
Let's say you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM with property `cf-logging-version` referring to the latest nexus version (currently `3.0.2`):
33
33
34
34
```xml
35
35
<properties>
36
-
<cf-logging-version>3.0.1</cf-logging-version>
36
+
<cf-logging-version>3.0.2</cf-logging-version>
37
37
</properties>
38
38
```
39
39
@@ -48,7 +48,9 @@ Let's say you want to make use of the *servlet filter* feature, then you need to
48
48
49
49
This feature only depends on the servlet API which you have included in your POM anyhow. You can find more information about the *servlet filter* feature (like e.g. how to adjust the web.xml) in the [Wiki](https://github.com/SAP/cf-java-logging-support/wiki/Instrumenting-Servlets).
50
50
51
-
If you want to use the `custom metrics``spring-boot client`, just define the following dependency:
51
+
If you want to use the `custom metrics`, just define the following dependency:
52
+
53
+
*`spring-boot client`:
52
54
53
55
```xml
54
56
@@ -59,6 +61,18 @@ If you want to use the `custom metrics` `spring-boot client`, just define the fo
## Implementation variants and logging configurations
63
77
64
78
The *core* feature (on which all other features rely) is just using the `org.slf4j` API, but to actually get logs written, you need to pick an implementation feature. As stated above, we have two implementations:
@@ -160,7 +174,7 @@ Here are the minimal configurations you'd need:
160
174
With the custom metrics clients you can send metrics defined inside your code. If you choose not to use one of these clients, you can still directly push the metrics using the REST API. Once send the metrics can be consumed in Kibana.
161
175
To use the clients you'd need:
162
176
163
-
*Using spring-boot client in Spring Boot 2 application:*
177
+
1.*Using spring-boot client in Spring Boot 2 application:*
164
178
165
179
```xml
166
180
<dependency>
@@ -221,12 +235,50 @@ public class DemoController {
221
235
```
222
236
In the example above, three custom metrics are defined and used. The metrics are `Counter`, `LongTaskTimer` and `Gauge`.
The java client uses [Dropwizard](https://metrics.dropwizard.io) which allows to define all kind of metrics supports by Dropwizard. The following metrics are available: com.codahale.metrics.Gauge, com.codahale.metrics.Counter, com.codahale.metrics.Histogram, com.codahale.metrics.Meter and com.codahale.metrics.Timer. More information about the [metric types and their usage](https://metrics.dropwizard.io/4.0.0/getting-started.html). Define your custom metrics and iterate with them:
response.getWriter().println("<p>Greetings from Custom Metrics</p>");
271
+
}
272
+
}
273
+
```
274
+
224
275
## Custom metrics client configurations
225
276
226
277
This client library supports the following configurations regarding sending custom metrics:
227
278
*`interval`: the interval for sending metrics, in millis. **Default value: `60000`**
228
279
*`enabled`: enables or disables the sending of metrics. **Default value: `true`**
229
280
*`metrics`: array of whitelisted metric names. Only mentioned metrics would be processed and sent. If it is an empty array all metrics are being sent. **Default value: `[]`**
281
+
*`metricQuantiles`: enables or disables the sending of metric's [quantiles](https://en.wikipedia.org/wiki/Quantile) like median, 95th percentile, 99th percentile. Spring-boot client does not support this configuration. **Default value: `false`**
230
282
231
283
Configurations are read from environment variable named `CUSTOM_METRICS`. To change the default values, you should override the environment variable with your custom values. Example:
232
284
@@ -237,7 +289,8 @@ This client library supports the following configurations regarding sending cust
0 commit comments