Package com.amazonaws.xray.metrics
Class MetricsSegmentListener
- java.lang.Object
-
- com.amazonaws.xray.metrics.MetricsSegmentListener
-
- All Implemented Interfaces:
SegmentListener
public class MetricsSegmentListener extends java.lang.Object implements SegmentListener
Listener that extracts metrics from Segments and emits them to CloudWatch using a structured log mechanism. Structured logs are sent via UDP to the CloudWatch agent. Configuration of UDP metric emissions is described inMetricsDaemonConfiguration
. For a list of supported metrics seeEMFMetricFormatter
.
-
-
Constructor Summary
Constructors Constructor Description MetricsSegmentListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterEndSegment(Segment segment)
afterEndSegment is invoked after a segment is ended by the recorder and emitted to the daemon.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.amazonaws.xray.listeners.SegmentListener
afterEndSubsegment, beforeEndSegment, beforeEndSubsegment, onBeginSegment, onBeginSubsegment, onClearEntity, onSetEntity
-
-
-
-
Method Detail
-
afterEndSegment
public void afterEndSegment(Segment segment)
Description copied from interface:SegmentListener
afterEndSegment is invoked after a segment is ended by the recorder and emitted to the daemon. The segment must not be modified since it has already been sent to X-Ray's backend. Attempts to do so will raise anAlreadyEmittedException
.- Specified by:
afterEndSegment
in interfaceSegmentListener
- Parameters:
segment
- The segment that has just ended
-
-