Class MetricsDaemonConfiguration


  • public class MetricsDaemonConfiguration
    extends java.lang.Object
    Configuration specifying where to publish EMF metrics over UDP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.InetSocketAddress getAddressForEmitter()
      Get the socket address to publish metrics to.
      java.lang.String getUDPAddress()
      Get the UDP address to publish metrics to.
      void setDaemonAddress​(java.lang.String socketAddress)
      Sets the metrics daemon address.
      boolean setUDPAddress​(java.lang.String addr)
      Set metrics daemon address, ignoring the value of of environment variable or system property.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY

        public static final java.lang.String DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY
        Environment variable key used to override the address to which UDP packets will be emitted. Valid values are of the form `ip_address:port`. Takes precedence over the system property when used.
        See Also:
        Constant Field Values
      • DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY

        public static final java.lang.String DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY
        System property key used to override the address to which UDP packets will be emitted. Valid values are of the form `ip_address:port`. used.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetricsDaemonConfiguration

        public MetricsDaemonConfiguration()
    • Method Detail

      • setDaemonAddress

        public void setDaemonAddress​(java.lang.String socketAddress)
        Sets the metrics daemon address. If either the AWS_XRAY_METRICS_DAEMON_ADDRESS environment variable or com.amazonaws.xray.metrics.daemonAddress system property are set to a non-empty value, calling this method does nothing. Logs an error if the address format is invalid to allow tracing if metrics are inoperative.
        Parameters:
        socketAddress - Formatted as '127.0.0.1:25888'
      • setUDPAddress

        public boolean setUDPAddress​(java.lang.String addr)
        Set metrics daemon address, ignoring the value of of environment variable or system property. Logs an error if the address format is invalid to allow tracing if metrics are inoperative.
        Parameters:
        addr - Formatted as '127.0.0.1:25888'
        Returns:
        true if the address updates without error
      • getUDPAddress

        public java.lang.String getUDPAddress()
        Get the UDP address to publish metrics to.
        Returns:
        the address in string form
      • getAddressForEmitter

        public java.net.InetSocketAddress getAddressForEmitter()
        Get the socket address to publish metrics to.
        Returns:
        the address as InetSocketAddress