Skip to content

MetricDefinition

Source code in docs_src/capo_rum/types/metric_definition.py
class MetricDefinition(TypedDict, closed=True):
    metric_definition_id: "capo_rum.types.metric_definition_id.MetricDefinitionId"
    """<p>The ID of this metric definition.</p>"""
    name: "capo_rum.types.metric_name.MetricName"
    """<p>The name of the metric that is defined in this structure.</p>"""
    value_key: NotRequired["capo_rum.types.value_key.ValueKey"]
    """<p>The field within the event object that the metric value is sourced from.</p>"""
    unit_label: NotRequired["capo_rum.types.unit_label.UnitLabel"]
    """<p>Use this field only if you are sending this metric to CloudWatch. It defines the CloudWatch metric unit that this metric is measured in. </p>"""
    dimension_keys: NotRequired["capo_rum.types.dimension_keys_map.DimensionKeysMap"]
    """<p>This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch The value of this field is used only if the metric destination is <code>CloudWatch</code>. If the metric destination is <code>Evidently</code>, the value of <code>DimensionKeys</code> is ignored.</p>"""
    event_pattern: NotRequired["capo_rum.types.event_pattern.EventPattern"]
    """<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>"""
    namespace: NotRequired["capo_rum.types.namespace.Namespace"]
    """<p>If this metric definition is for a custom metric instead of an extended metric, this field displays the metric namespace that the custom metric is published to.</p>"""

dimension_keys instance-attribute

dimension_keys: NotRequired[DimensionKeysMap]

This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch The value of this field is used only if the metric destination is CloudWatch. If the metric destination is Evidently, the value of DimensionKeys is ignored.

event_pattern instance-attribute

event_pattern: NotRequired[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.

If the metrics destination is CloudWatch and the event also matches a value in DimensionKeys, then the metric is published with the specified dimensions.

metric_definition_id instance-attribute

metric_definition_id: MetricDefinitionId

The ID of this metric definition.

name instance-attribute

name: MetricName

The name of the metric that is defined in this structure.

namespace instance-attribute

namespace: NotRequired[Namespace]

If this metric definition is for a custom metric instead of an extended metric, this field displays the metric namespace that the custom metric is published to.

unit_label instance-attribute

unit_label: NotRequired[UnitLabel]

Use this field only if you are sending this metric to CloudWatch. It defines the CloudWatch metric unit that this metric is measured in.

value_key instance-attribute

value_key: NotRequired[ValueKey]

The field within the event object that the metric value is sourced from.