public MetricDefinition withEventPattern(String eventPattern) {
        setEventPattern(eventPattern);
        return this;
    }
<p>
The pattern that defines the metric. RUM checks events that happen in a user's session against the pattern, and
events that match the pattern are sent to the metric destination.
</p>
<p>
If the metrics destination is <code>CloudWatch</code> and the event also matches a value in
<code>DimensionKeys</code>, then the metric is published with the specified dimensions.
</p>

@param eventPattern
       The pattern that defines the metric. RUM checks events that happen in a user's session against the
       pattern, and events that match the pattern are sent to the metric destination.</p>
       <p>
       If the metrics destination is <code>CloudWatch</code> and the event also matches a value in
       <code>DimensionKeys</code>, then the metric is published with the specified dimensions.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-cloudwatchrum/src/main/java/com/amazonaws/services/cloudwatchrum/model/MetricDefinition.java