-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to the HttpMeterFilterFactory (#766)
* Improvements to the HttpMeterFilterFactory - Added support for specifying service level objectives (allows the creation of apdex widgets). - Added support for specifying the expected max duration. - Added support for specifying the expected min duration. - Added support for histogram directly on the HttpMeterFilterFactory. - Removed the redundant HttpHistogramMeterFilterFactory. - Added tests for validating that the values are set correctly.
- Loading branch information
Showing
7 changed files
with
238 additions
and
107 deletions.
There are no files selected for viewing
79 changes: 0 additions & 79 deletions
79
...n/java/io/micronaut/configuration/metrics/binder/web/HttpHistogramMeterFilterFactory.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...main/java/io/micronaut/configuration/metrics/binder/web/config/HttpClientMeterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.configuration.metrics.binder.web.config; | ||
|
||
import io.micronaut.context.annotation.ConfigurationProperties; | ||
|
||
import static io.micronaut.configuration.metrics.micrometer.MeterRegistryFactory.MICRONAUT_METRICS_BINDERS; | ||
|
||
/** | ||
* Http client meter configuration. | ||
* @since 5.6.0 | ||
*/ | ||
@ConfigurationProperties(MICRONAUT_METRICS_BINDERS + ".web.client") | ||
public class HttpClientMeterConfig extends HttpMeterConfig { } |
109 changes: 109 additions & 0 deletions
109
...e/src/main/java/io/micronaut/configuration/metrics/binder/web/config/HttpMeterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.configuration.metrics.binder.web.config; | ||
|
||
/** | ||
* Http meter configuration. | ||
* @since 5.6.0 | ||
*/ | ||
public abstract class HttpMeterConfig { | ||
|
||
private Double[] percentiles = new Double[]{}; | ||
private Boolean histogram = false; | ||
private Double min = null; | ||
private Double max = null; | ||
private Double[] slos = new Double[]{}; | ||
|
||
/** | ||
* Default is empty. | ||
* @return The percentiles. Specify in CSV format, ex: "0.95,0.99". | ||
*/ | ||
public Double[] getPercentiles() { | ||
return percentiles; | ||
} | ||
|
||
/** | ||
* Default is empty. | ||
* @param percentiles The percentiles. Specify in CSV format, ex: "0.95,0.99". | ||
*/ | ||
public void setPercentiles(Double[] percentiles) { | ||
this.percentiles = percentiles; | ||
} | ||
|
||
/** | ||
* Default: false. | ||
* @return If a histogram should be published. | ||
*/ | ||
public Boolean getHistogram() { | ||
return histogram; | ||
} | ||
|
||
/** | ||
* Default: false. | ||
* @param histogram If a histogram should be published. | ||
*/ | ||
public void setHistogram(Boolean histogram) { | ||
this.histogram = histogram; | ||
} | ||
|
||
/** | ||
* Default: Micrometer default value (0.001). | ||
* @return The minimum time (in s) value expected. | ||
*/ | ||
public Double getMin() { | ||
return min; | ||
} | ||
|
||
/** | ||
* Default: Micrometer default value (0.001). | ||
* @param min The minimum time (in s) value expected. | ||
*/ | ||
public void setMin(Double min) { | ||
this.min = min; | ||
} | ||
|
||
/** | ||
* Default: Micrometer default value (30). | ||
* @return The maximum time (in s) value expected. | ||
*/ | ||
public Double getMax() { | ||
return max; | ||
} | ||
|
||
/** | ||
* Default: Micrometer default value (30). | ||
* @param max The maximum time (in s) value expected. | ||
*/ | ||
public void setMax(Double max) { | ||
this.max = max; | ||
} | ||
|
||
/** | ||
* Default is empty. | ||
* @return The user-defined service levels objectives (in s) to create. Specify in CSV format, ex: "0.1,0.4". | ||
*/ | ||
public Double[] getSlos() { | ||
return slos; | ||
} | ||
|
||
/** | ||
* Default is empty. | ||
* @param slos The user-defined service levels objectives (in s) to create. Specify in CSV format, ex: "0.1,0.4". | ||
*/ | ||
public void setSlos(Double[] slos) { | ||
this.slos = slos; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...main/java/io/micronaut/configuration/metrics/binder/web/config/HttpServerMeterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.configuration.metrics.binder.web.config; | ||
|
||
import io.micronaut.context.annotation.ConfigurationProperties; | ||
|
||
import static io.micronaut.configuration.metrics.micrometer.MeterRegistryFactory.MICRONAUT_METRICS_BINDERS; | ||
|
||
/** | ||
* Http server meter configuration. | ||
* @since 5.6.0 | ||
*/ | ||
@ConfigurationProperties(MICRONAUT_METRICS_BINDERS + ".web.server") | ||
public class HttpServerMeterConfig extends HttpMeterConfig { } |
Oops, something went wrong.