Package com.codingchili.core.metrics
Class MetricFilter
java.lang.Object
com.codingchili.core.metrics.MetricFilter
Configuration used to filter metrics.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.json.JsonObject
Applies the filtering logic to a metrics object.static io.vertx.core.json.JsonObject
getAlias()
getPath()
void
setExclude(Set<String> exclude)
void
setInclude(Set<String> include)
-
Constructor Details
-
MetricFilter
public MetricFilter()
-
-
Method Details
-
getPath
- Returns:
- the path to the metric, for example 'vertx.eventbus.handlers'.
-
setPath
-
getAlias
- Returns:
- the alias to write the metrics as, for example if the path is "vertx.eventbus.handlers"
an alias could be used in events, such as {myAlias: ... metrics} especially useful for longer paths
such as vertx.http.servers.0.0.0.0:8080.requests which could be aliased as "myService1.requests".
Note: the alias can only be applied if the filter matches exactly one metric.
-
aliasOrPath
-
setAlias
-
getInclude
- Returns:
- a list of metrics to include from the event, some metric types contain a large number of fields, all of them might not be relevant. Specifying include lists greatly reduces the size of the events.
-
setInclude
-
getExclude
-
setExclude
- Parameters:
exclude
- a list of keys to ignore from metric events matching the filter.
-
include
- Parameters:
key
- the key to include from entries matching the filter.- Returns:
- fluent.
-
exclude
- Parameters:
key
- the key to exclude from entries matching the filter.- Returns:
- fluent.
-
apply
Applies the filtering logic to a metrics object.- Parameters:
metric
- converted to json and filtered.path
- the full path of the metrics object.- Returns:
- a converted metrics object with filtered properties.
-
convert
public static io.vertx.core.json.JsonObject convert(com.codahale.metrics.Metric metric, String path)- Parameters:
metric
- a metric to convert to a json object.path
- the path to the metric, used as the key for the data.- Returns:
- a json object where the path is mapped to an object containing the metric data.
-
defaultIncludes
- Returns:
- a list of default includes for dropwizard. Use includes and excludes to modify this with filters.
-