Package com.newrelic.telemetry
Class SenderConfiguration.SenderConfigurationBuilder
- java.lang.Object
-
- com.newrelic.telemetry.SenderConfiguration.SenderConfigurationBuilder
-
- Enclosing class:
- SenderConfiguration
public static class SenderConfiguration.SenderConfigurationBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SenderConfigurationBuilder(java.lang.String defaultUrl, java.lang.String basePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SenderConfiguration.SenderConfigurationBuilder
apiKey(java.lang.String apiKey)
Configure the New Relic Insert API key to use.SenderConfiguration.SenderConfigurationBuilder
auditLoggingEnabled(boolean auditLoggingEnabled)
Configure whether audit logging is enabled.SenderConfiguration
build()
java.net.URL
constructUrlWithHost(java.net.URI hostUri)
SenderConfiguration.SenderConfigurationBuilder
endpoint(java.net.URL endpoint)
Configure the *full* endpoint URL for data to be sent to, including the path.SenderConfiguration.SenderConfigurationBuilder
httpPoster(HttpPoster httpPoster)
SenderConfiguration.SenderConfigurationBuilder
secondaryUserAgent(java.lang.String secondaryUserAgent)
Configure a secondary User-Agent value to use when sending data.SenderConfiguration.SenderConfigurationBuilder
setRegion(java.lang.String region)
Sets the region so that it is used in the individual batch senders (e.x.SenderConfiguration.SenderConfigurationBuilder
useLicenseKey(boolean useLicenseKey)
-
-
-
Method Detail
-
apiKey
public SenderConfiguration.SenderConfigurationBuilder apiKey(java.lang.String apiKey)
Configure the New Relic Insert API key to use.- Parameters:
apiKey
- new relic api key- Returns:
- this builder;
-
httpPoster
public SenderConfiguration.SenderConfigurationBuilder httpPoster(HttpPoster httpPoster)
- Parameters:
httpPoster
- client responsible to execute the http request- Returns:
- this builder
-
endpoint
public SenderConfiguration.SenderConfigurationBuilder endpoint(java.net.URL endpoint)
Configure the *full* endpoint URL for data to be sent to, including the path. You should only use this method if you wish to send data to endpoints other than the US and EU production endpoints.- Parameters:
endpoint
- A fullURL
, including the path.- Returns:
- this builder.
-
useLicenseKey
public SenderConfiguration.SenderConfigurationBuilder useLicenseKey(boolean useLicenseKey)
- Parameters:
useLicenseKey
- flag to indicate the configuredapiKey
is a license key, not an insights api key- Returns:
- this builder
-
setRegion
public SenderConfiguration.SenderConfigurationBuilder setRegion(java.lang.String region) throws java.lang.IllegalArgumentException
Sets the region so that it is used in the individual batch senders (e.x. MetricBatchSender, LogBatchSender, SpanBatchSenders) to configure regional endpoints and send data to New Relic- Parameters:
region
- String to indicate whether the account is in an American or European region. US (for American Region), EU (for European Region)- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
-
auditLoggingEnabled
public SenderConfiguration.SenderConfigurationBuilder auditLoggingEnabled(boolean auditLoggingEnabled)
Configure whether audit logging is enabled. Note: audit logging will log all data payloads sent to New Relic at DEBUG level, in plain text.- Parameters:
auditLoggingEnabled
- if true, audit log will be enabled- Returns:
- this builder.
-
secondaryUserAgent
public SenderConfiguration.SenderConfigurationBuilder secondaryUserAgent(java.lang.String secondaryUserAgent)
Configure a secondary User-Agent value to use when sending data. This will be appended to the default User-Agent that the SDK sends, and is useful for monitoring various sources of data coming into the New Relic systems.- Parameters:
secondaryUserAgent
- configure a secondary User-Agent- Returns:
- this builder.
-
build
public SenderConfiguration build()
-
constructUrlWithHost
public java.net.URL constructUrlWithHost(java.net.URI hostUri) throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
-
-