Package com.amazonaws.xray.config
Class MetricsDaemonConfiguration
- java.lang.Object
-
- com.amazonaws.xray.config.MetricsDaemonConfiguration
-
public class MetricsDaemonConfiguration extends java.lang.Object
Configuration specifying where to publish EMF metrics over UDP
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY
Environment variable key used to override the address to which UDP packets will be emitted.static java.lang.String
DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY
System property key used to override the address to which UDP packets will be emitted.
-
Constructor Summary
Constructors Constructor Description MetricsDaemonConfiguration()
-
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.
-
-
-
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
-
-
Method Detail
-
setDaemonAddress
public void setDaemonAddress(java.lang.String socketAddress)
Sets the metrics daemon address. If either theAWS_XRAY_METRICS_DAEMON_ADDRESS
environment variable orcom.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
-
-