Class SenderConfiguration.SenderConfigurationBuilder

  • Enclosing class:
    SenderConfiguration

    public static class SenderConfiguration.SenderConfigurationBuilder
    extends java.lang.Object
    • Constructor Detail

      • SenderConfigurationBuilder

        public SenderConfigurationBuilder​(java.lang.String defaultUrl,
                                          java.lang.String basePath)
    • Method Detail

      • 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 full URL, including the path.
        Returns:
        this builder.
      • useLicenseKey

        public SenderConfiguration.SenderConfigurationBuilder useLicenseKey​(boolean useLicenseKey)
        Parameters:
        useLicenseKey - flag to indicate the configured apiKey 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.
      • constructUrlWithHost

        public java.net.URL constructUrlWithHost​(java.net.URI hostUri)
                                          throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException