public class HawkularReporterBuilder extends Object
| Constructor and Description |
|---|
HawkularReporterBuilder(com.codahale.metrics.MetricRegistry registry,
String tenant)
Create a new builder for an
HawkularReporter |
| Modifier and Type | Method and Description |
|---|---|
HawkularReporterBuilder |
addGlobalTag(String key,
String value)
Set a global tag.
|
HawkularReporterBuilder |
addHeader(String key,
String value)
Add a custom header to Hawkular HTTP connections
|
HawkularReporterBuilder |
addMetricTag(String metric,
String key,
String value)
Set a tag on a given metric name
|
HawkularReporterBuilder |
addRegexTag(Pattern pattern,
String key,
String value)
Set a tag on metrics matching this regex
|
HawkularReporterBuilder |
basicAuth(String username,
String password)
Set username and password for basic HTTP authentication
|
HawkularReporterBuilder |
bearerToken(String token)
Set the bearer token for the Authorization header in Hawkular HTTP connections.
|
HawkularReporter |
build()
Build the
HawkularReporter |
HawkularReporterBuilder |
convertDurationsTo(TimeUnit durationUnit)
Set dropwizard duration conversion
|
HawkularReporterBuilder |
convertRatesTo(TimeUnit rateUnit)
Set dropwizard rates conversion
|
HawkularReporterBuilder |
disableTagComposition()
Disable auto-tagging composed metrics.
|
HawkularReporterBuilder |
failoverCacheDuration(long milliseconds)
Set the failover cache duration (in milliseconds)
This cache is used to store post attempts in memory when the hawkular server cannot be reached Default duration is 10 minutes |
HawkularReporterBuilder |
failoverCacheDurationInHours(long hours)
Set the failover cache duration, in hours
This cache is used to store post attempts in memory when the hawkular server cannot be reached Default duration is 10 minutes |
HawkularReporterBuilder |
failoverCacheDurationInMinutes(long minutes)
Set the failover cache duration, in minutes
This cache is used to store post attempts in memory when the hawkular server cannot be reached Default duration is 10 minutes |
HawkularReporterBuilder |
failoverCacheMaxSize(int reqs)
Set the failover cache maximum size, in number of requests
This cache is used to store post attempts in memory when the hawkular server cannot be reached By default this parameter is unset, which means there's no maximum |
HawkularReporterBuilder |
filter(com.codahale.metrics.MetricFilter filter)
Configure a special MetricFilter, which defines what metrics are reported
|
HawkularReporterBuilder |
globalTags(Map<String,String> tags)
Set all global tags at once.
|
HawkularReporterBuilder |
metricComposition(Map<String,Collection<String>> conversions)
Set all metrics composition at once.
|
HawkularReporterBuilder |
perMetricTags(Map<String,Map<String,String>> tags)
Set all per-metric tags at once.
|
HawkularReporterBuilder |
prefixedWith(String prefix)
Configure a prefix for each metric name.
|
HawkularReporterBuilder |
setMetricComposition(String metric,
Collection<String> parts)
Set composing parts for a given metric name
|
HawkularReporterBuilder |
setRegexMetricComposition(Pattern pattern,
Collection<String> parts)
Set composing parts for metrics matching this regex
|
HawkularReporterBuilder |
uri(String uri)
Set the URI for the Hawkular connection.
|
HawkularReporterBuilder |
useHttpClient(Function<String,HawkularHttpClient> httpClientProvider)
Use a custom
HawkularHttpClient |
HawkularReporterBuilder |
withNullableConfig(HawkularReporterConfig config)
This is a shortcut function to use with automatically populated pojos such as coming from yaml config
|
public HawkularReporterBuilder(com.codahale.metrics.MetricRegistry registry,
String tenant)
HawkularReporterregistry - the Dropwizard Metrics registrytenant - the Hawkular tenant IDpublic HawkularReporterBuilder withNullableConfig(HawkularReporterConfig config)
public HawkularReporterBuilder uri(String uri)
uri - base uri - do not include Hawkular Metrics path (/hawkular/metrics)public HawkularReporterBuilder basicAuth(String username, String password)
username - basic auth. usernamepassword - basic auth. passwordpublic HawkularReporterBuilder bearerToken(String token)
token - the bearer tokenpublic HawkularReporterBuilder addHeader(String key, String value)
key - header namevalue - header valuepublic HawkularReporterBuilder prefixedWith(String prefix)
public HawkularReporterBuilder filter(com.codahale.metrics.MetricFilter filter)
public HawkularReporterBuilder convertRatesTo(TimeUnit rateUnit)
public HawkularReporterBuilder convertDurationsTo(TimeUnit durationUnit)
public HawkularReporterBuilder globalTags(Map<String,String> tags)
tags - global tagspublic HawkularReporterBuilder addGlobalTag(String key, String value)
key - tag keyvalue - tag valuepublic HawkularReporterBuilder perMetricTags(Map<String,Map<String,String>> tags)
tags - per-metric tagspublic HawkularReporterBuilder addMetricTag(String metric, String key, String value)
metric - the metric namekey - tag keyvalue - tag valuepublic HawkularReporterBuilder addRegexTag(Pattern pattern, String key, String value)
pattern - the regex patternkey - tag keyvalue - tag valuepublic HawkularReporterBuilder disableTagComposition()
public HawkularReporterBuilder metricComposition(Map<String,Collection<String>> conversions)
conversions - per-metric compositionpublic HawkularReporterBuilder setMetricComposition(String metric, Collection<String> parts)
metric - the metric nameparts - metric composed parts (such as "1minrt", "mean", "99perc", etc. - see project documentation)public HawkularReporterBuilder setRegexMetricComposition(Pattern pattern, Collection<String> parts)
pattern - the regex patternparts - metric composed parts (such as "1minrt", "mean", "99perc", etc. - see project documentation)public HawkularReporterBuilder failoverCacheDuration(long milliseconds)
milliseconds - number of milliseconds before evictionpublic HawkularReporterBuilder failoverCacheDurationInMinutes(long minutes)
minutes - number of minutes before evictionpublic HawkularReporterBuilder failoverCacheDurationInHours(long hours)
hours - number of hours before evictionpublic HawkularReporterBuilder failoverCacheMaxSize(int reqs)
reqs - max number of requests to storepublic HawkularReporterBuilder useHttpClient(Function<String,HawkularHttpClient> httpClientProvider)
HawkularHttpClienthttpClientProvider - function that provides a custom HawkularHttpClient from input URI as Stringpublic HawkularReporter build()
HawkularReporterCopyright © 2014–2017 Red Hat, Inc.. All rights reserved.