Skip to content

Commit

Permalink
remove enabling of http client metrics histogram because it should be…
Browse files Browse the repository at this point in the history
… 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]>
  • Loading branch information
mgeissen committed Jul 12, 2024
1 parent 083ff0b commit 7dd1334
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 58 deletions.
48 changes: 34 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,59 @@
# Changelog

## 0.4.0
## 0.5.0-SNAPSHOT

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

## 0.4.0

* _core_:
* add metrics configuration so that histogram (bucket) is enabled for http.client metrics from webclient (
http_client_requests_seconds_bucket).
* add `ClientRequestMetricsTagContributor` to limit the number of metrics for http.client metrics from webclient (it
only takes the first path of the url and removes all query parameters).

## 0.3.1

* _core_:
* Fix: Just pass commit time from `git.properties` to status page, because the formats in the generated files are different.
* Fix: Just pass commit time from `git.properties` to status page, because the formats in the generated files are
different.

## 0.3.0

* _core_:
* Upgrade to bootstrap 5.3.3
* Add status detail indicator infos to status page
* Enhance git infos on status page
* Upgrade to bootstrap 5.3.3
* Add status detail indicator infos to status page
* Enhance git infos on status page

## 0.2.0

* Upgrade all modules to spring boot 3.2.2

## 0.1.0

* _core_:
* Fix: Load bootstrap js in footer of logger console
* Fix: Load bootstrap js in footer of logger console
* _validation_:
* Feature: Expose validation message in http response body
* Feature: Expose validation message in http response body

## 0.0.3
* _core_:
* Fix: Logger overview now uses the correct links for changing log levels.
* Fix: Long loggers are now scrollable and are not hidden behind the log-level buttons.
* Feature: Add option to add custom management pages by extending your Controller with `ManagementController`. Documentation about is added [here](core/README.md)
* _validation_:
* add `SafeId` annotation to validation String input parameters

* _core_:
* Fix: Logger overview now uses the correct links for changing log levels.
* Fix: Long loggers are now scrollable and are not hidden behind the log-level buttons.
* Feature: Add option to add custom management pages by extending your Controller with `ManagementController`.
Documentation about is added [here](core/README.md)
* _validation_:
* add `SafeId` annotation to validation String input parameters

## 0.0.2

* _aws-paramstore:_ Fix: Add missing `@ConfigurationProperties` for AWS ParamStore Properties.

## 0.0.1

* Initial version
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/babbage.conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "de.otto.babbage"
version = "0.4.1-SNAPSHOT"
version = "0.5.0-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17

repositories {
Expand Down Expand Up @@ -67,8 +67,7 @@ tasks.withType<KotlinCompile> {

detekt {
baseline = file("../detekt-baseline.xml")
config.from(files("../detekt-config.yml"))
config.from(files("../detekt-config.yml"))
config.setFrom(files("../detekt-config.yml"))
buildUponDefaultConfig = true
}

Expand Down
12 changes: 7 additions & 5 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ information, if enabled the git information, and all infos from the registered `

_Git section_:<br/>
To be able to see the git information on the status page, you have to provide a `git.properties` in the resource
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
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
the [gradle git properties plugin](https://github.com/n0mer/gradle-git-properties) to generate the file.

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

### Custom properties

| property | default | description |
|----------------------------------------|---------|----------------------------------------------------|
| babbage.metrics.startup-metric.enabled | false | If enabled, a metric for startup duration is added |
| babbage.status.useCommitAsVersion | false | _tbd_ |
| property | default | description |
|---------------------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| babbage.metrics.startup-metric.enabled | false | If enabled, a metric for startup duration is added |
| 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 |
| babbage.status.useCommitAsVersion | false | _tbd_ |

This file was deleted.

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

import io.micrometer.common.KeyValue
import io.micrometer.common.KeyValues
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package de.otto.babbage.core.metrics

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class MetricConfiguration {

@Bean
@ConditionalOnProperty("babbage.metrics.custom-html-client-metric.enabled", havingValue = "true")
fun clientRequestMetricsTagContributor(): ClientRequestMetricsTagContributor {
return ClientRequestMetricsTagContributor()
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.otto.babbage.core.config
package de.otto.babbage.core.metrics

import io.kotest.matchers.collections.shouldContain
import io.micrometer.common.KeyValue
Expand Down

0 comments on commit 7dd1334

Please sign in to comment.