Skip to content

Commit 7dd1334

Browse files
committed
remove enabling of http client metrics histogram because it should be a decision by the microservice and could be enabled via spring application properties, make custom client request metrics tag contributor optional with an application property
Co-authored-by: Matthias Geißendörfer <[email protected]>
1 parent 083ff0b commit 7dd1334

File tree

7 files changed

+61
-58
lines changed

7 files changed

+61
-58
lines changed

CHANGELOG.md

+34-14
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,59 @@
11
# Changelog
22

3-
## 0.4.0
3+
## 0.5.0-SNAPSHOT
4+
45
* _core_:
5-
* add metrics configuration so that histogram (bucket) is enabled for http.client metrics from webclient (http_client_requests_seconds_bucket).
6+
* remove metrics configuration for http client metrics which was introduced in 0.4.0 because it could be configured
7+
via spring application properties (`management.metrics.distribution`) and should not be part of this library.
8+
* Introduce property `babbage.metrics.custom-html-client-metric.enabled` to not enable aggregated http client
9+
metrics by default.
610

11+
## 0.4.0
12+
13+
* _core_:
14+
* add metrics configuration so that histogram (bucket) is enabled for http.client metrics from webclient (
15+
http_client_requests_seconds_bucket).
16+
* add `ClientRequestMetricsTagContributor` to limit the number of metrics for http.client metrics from webclient (it
17+
only takes the first path of the url and removes all query parameters).
718

819
## 0.3.1
20+
921
* _core_:
10-
* Fix: Just pass commit time from `git.properties` to status page, because the formats in the generated files are different.
22+
* Fix: Just pass commit time from `git.properties` to status page, because the formats in the generated files are
23+
different.
1124

1225
## 0.3.0
26+
1327
* _core_:
14-
* Upgrade to bootstrap 5.3.3
15-
* Add status detail indicator infos to status page
16-
* Enhance git infos on status page
28+
* Upgrade to bootstrap 5.3.3
29+
* Add status detail indicator infos to status page
30+
* Enhance git infos on status page
1731

1832
## 0.2.0
33+
1934
* Upgrade all modules to spring boot 3.2.2
2035

2136
## 0.1.0
37+
2238
* _core_:
23-
* Fix: Load bootstrap js in footer of logger console
39+
* Fix: Load bootstrap js in footer of logger console
2440
* _validation_:
25-
* Feature: Expose validation message in http response body
41+
* Feature: Expose validation message in http response body
2642

2743
## 0.0.3
28-
* _core_:
29-
* Fix: Logger overview now uses the correct links for changing log levels.
30-
* Fix: Long loggers are now scrollable and are not hidden behind the log-level buttons.
31-
* Feature: Add option to add custom management pages by extending your Controller with `ManagementController`. Documentation about is added [here](core/README.md)
32-
* _validation_:
33-
* add `SafeId` annotation to validation String input parameters
44+
45+
* _core_:
46+
* Fix: Logger overview now uses the correct links for changing log levels.
47+
* Fix: Long loggers are now scrollable and are not hidden behind the log-level buttons.
48+
* Feature: Add option to add custom management pages by extending your Controller with `ManagementController`.
49+
Documentation about is added [here](core/README.md)
50+
* _validation_:
51+
* add `SafeId` annotation to validation String input parameters
3452

3553
## 0.0.2
54+
3655
* _aws-paramstore:_ Fix: Add missing `@ConfigurationProperties` for AWS ParamStore Properties.
3756

3857
## 0.0.1
58+
3959
* Initial version

buildSrc/src/main/kotlin/babbage.conventions.gradle.kts

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
}
1313

1414
group = "de.otto.babbage"
15-
version = "0.4.1-SNAPSHOT"
15+
version = "0.5.0-SNAPSHOT"
1616
java.sourceCompatibility = JavaVersion.VERSION_17
1717

1818
repositories {
@@ -67,8 +67,7 @@ tasks.withType<KotlinCompile> {
6767

6868
detekt {
6969
baseline = file("../detekt-baseline.xml")
70-
config.from(files("../detekt-config.yml"))
71-
config.from(files("../detekt-config.yml"))
70+
config.setFrom(files("../detekt-config.yml"))
7271
buildUponDefaultConfig = true
7372
}
7473

core/README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ information, if enabled the git information, and all infos from the registered `
2424

2525
_Git section_:<br/>
2626
To be able to see the git information on the status page, you have to provide a `git.properties` in the resource
27-
section of your build folder and have to set `babbage.status.git.enabled=true` in your `application.properties/.yaml`. As shown in the example application you could just use
27+
section of your build folder and have to set `babbage.status.git.enabled=true` in your `application.properties/.yaml`.
28+
As shown in the example application you could just use
2829
the [gradle git properties plugin](https://github.com/n0mer/gradle-git-properties) to generate the file.
2930

3031
![Status Page of Example Application](docs/status-page.png)
@@ -103,7 +104,8 @@ _will be added soon_
103104

104105
### Custom properties
105106

106-
| property | default | description |
107-
|----------------------------------------|---------|----------------------------------------------------|
108-
| babbage.metrics.startup-metric.enabled | false | If enabled, a metric for startup duration is added |
109-
| babbage.status.useCommitAsVersion | false | _tbd_ |
107+
| property | default | description |
108+
|---------------------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
109+
| babbage.metrics.startup-metric.enabled | false | If enabled, a metric for startup duration is added |
110+
| babbage.metrics.custom-html-client-metric.enabled | false | If enabled, the default http client metrics will be aggregated by the first request path to limit the amount of metrics with a lot of different request parameters |
111+
| babbage.status.useCommitAsVersion | false | _tbd_ |

core/src/main/kotlin/de/otto/babbage/core/config/MetricConfiguration.kt

-34
This file was deleted.

core/src/main/kotlin/de/otto/babbage/core/config/ClientRequestMetricsTagContributor.kt core/src/main/kotlin/de/otto/babbage/core/metrics/ClientRequestMetricsTagContributor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.otto.babbage.core.config
1+
package de.otto.babbage.core.metrics
22

33
import io.micrometer.common.KeyValue
44
import io.micrometer.common.KeyValues
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package de.otto.babbage.core.metrics
2+
3+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
4+
import org.springframework.context.annotation.Bean
5+
import org.springframework.context.annotation.Configuration
6+
7+
@Configuration
8+
class MetricConfiguration {
9+
10+
@Bean
11+
@ConditionalOnProperty("babbage.metrics.custom-html-client-metric.enabled", havingValue = "true")
12+
fun clientRequestMetricsTagContributor(): ClientRequestMetricsTagContributor {
13+
return ClientRequestMetricsTagContributor()
14+
}
15+
16+
}

core/src/test/kotlin/de/otto/babbage/core/config/ClientRequestMetricsTagContributorTest.kt core/src/test/kotlin/de/otto/babbage/core/metrics/ClientRequestMetricsTagContributorTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.otto.babbage.core.config
1+
package de.otto.babbage.core.metrics
22

33
import io.kotest.matchers.collections.shouldContain
44
import io.micrometer.common.KeyValue

0 commit comments

Comments
 (0)