Skip to content

Creates a new metric definition for the specified Connect Customer instance

Description

Creates a new metric definition for the specified Connect Customer instance. You can create custom metrics that use formulas referencing existing Amazon Web Services-managed metrics, optionally with filters applied.

Usage

connect_create_metric(InstanceId, Name, MetricCalculation, Unit, Status,
  ClientToken, Description, PositiveTrendIndicator, Tags)

Arguments

  • InstanceId

[required] The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • Name

[required] The name of the metric.

  • MetricCalculation

[required] The calculation definition for the metric, including the formula expression and the component metrics it references.

  • Unit

[required] The display unit for the metric's data.

  • Status

The publish status of the metric. Set to PUBLISHED to make the metric available for use in dashboards and reports, or SAVED to keep it in draft state.

  • ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

  • Description

The description of the metric.

  • PositiveTrendIndicator

How an increase in the metric value should be interpreted. Valid values: POSITIVE, NEUTRAL, NEGATIVE.

  • Tags

The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Value

A list with the following syntax:

list(
  MetricArn = "string",
  MetricId = "string"
)

Request syntax

svc$create_metric(
  InstanceId = "string",
  Name = "string",
  MetricCalculation = list(
    CalculationComponents = list(
      list(
        Alias = "string",
        MetricName = "string",
        MetricId = "string",
        MetricFilters = list(
          list(
            MetricFilterKey = "string",
            Negate = TRUE|FALSE,
            NumberCondition = list(
              Comparison = "LESSER"|"LESSER_OR_EQUAL"|"GREATER"|"GREATER_OR_EQUAL",
              Values = list(
                123.0
              )
            ),
            StringCondition = list(
              Comparison = "MATCHES_ANY"|"MATCHES_NONE",
              Values = list(
                "string"
              )
            ),
            BooleanCondition = list(
              Comparison = "IS_TRUE"|"IS_FALSE"
            )
          )
        )
      )
    ),
    Calculation = "string"
  ),
  Unit = "INTEGER"|"DOUBLE"|"PERCENT"|"SECONDS",
  Status = "PUBLISHED"|"SAVED",
  ClientToken = "string",
  Description = "string",
  PositiveTrendIndicator = "POSITIVE"|"NEGATIVE"|"NEUTRAL",
  Tags = list(
    "string"
  )
)