{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchLogs.Types.MetricTransformation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudWatchLogs.Types.MetricTransformation where

import Amazonka.CloudWatchLogs.Types.StandardUnit
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Indicates how to transform ingested log events to metric data in a
-- CloudWatch metric.
--
-- /See:/ 'newMetricTransformation' smart constructor.
data MetricTransformation = MetricTransformation'
  { -- | (Optional) The value to emit when a filter pattern does not match a log
    -- event. This value can be null.
    MetricTransformation -> Maybe Double
defaultValue :: Prelude.Maybe Prelude.Double,
    -- | The fields to use as dimensions for the metric. One metric filter can
    -- include as many as three dimensions.
    --
    -- Metrics extracted from log events are charged as custom metrics. To
    -- prevent unexpected high charges, do not specify high-cardinality fields
    -- such as @IPAddress@ or @requestID@ as dimensions. Each different value
    -- found for a dimension is treated as a separate metric and accrues
    -- charges as a separate custom metric.
    --
    -- To help prevent accidental high charges, Amazon disables a metric filter
    -- if it generates 1000 different name\/value pairs for the dimensions that
    -- you have specified within a certain amount of time.
    --
    -- You can also set up a billing alarm to alert you if your charges are
    -- higher than expected. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges>.
    MetricTransformation -> Maybe (HashMap Text Text)
dimensions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unit to assign to the metric. If you omit this, the unit is set as
    -- @None@.
    MetricTransformation -> Maybe StandardUnit
unit :: Prelude.Maybe StandardUnit,
    -- | The name of the CloudWatch metric.
    MetricTransformation -> Text
metricName :: Prelude.Text,
    -- | A custom namespace to contain your metric in CloudWatch. Use namespaces
    -- to group together metrics that are similar. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace Namespaces>.
    MetricTransformation -> Text
metricNamespace :: Prelude.Text,
    -- | The value to publish to the CloudWatch metric when a filter pattern
    -- matches a log event.
    MetricTransformation -> Text
metricValue :: Prelude.Text
  }
  deriving (MetricTransformation -> MetricTransformation -> Bool
(MetricTransformation -> MetricTransformation -> Bool)
-> (MetricTransformation -> MetricTransformation -> Bool)
-> Eq MetricTransformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricTransformation -> MetricTransformation -> Bool
$c/= :: MetricTransformation -> MetricTransformation -> Bool
== :: MetricTransformation -> MetricTransformation -> Bool
$c== :: MetricTransformation -> MetricTransformation -> Bool
Prelude.Eq, ReadPrec [MetricTransformation]
ReadPrec MetricTransformation
Int -> ReadS MetricTransformation
ReadS [MetricTransformation]
(Int -> ReadS MetricTransformation)
-> ReadS [MetricTransformation]
-> ReadPrec MetricTransformation
-> ReadPrec [MetricTransformation]
-> Read MetricTransformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricTransformation]
$creadListPrec :: ReadPrec [MetricTransformation]
readPrec :: ReadPrec MetricTransformation
$creadPrec :: ReadPrec MetricTransformation
readList :: ReadS [MetricTransformation]
$creadList :: ReadS [MetricTransformation]
readsPrec :: Int -> ReadS MetricTransformation
$creadsPrec :: Int -> ReadS MetricTransformation
Prelude.Read, Int -> MetricTransformation -> ShowS
[MetricTransformation] -> ShowS
MetricTransformation -> String
(Int -> MetricTransformation -> ShowS)
-> (MetricTransformation -> String)
-> ([MetricTransformation] -> ShowS)
-> Show MetricTransformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricTransformation] -> ShowS
$cshowList :: [MetricTransformation] -> ShowS
show :: MetricTransformation -> String
$cshow :: MetricTransformation -> String
showsPrec :: Int -> MetricTransformation -> ShowS
$cshowsPrec :: Int -> MetricTransformation -> ShowS
Prelude.Show, (forall x. MetricTransformation -> Rep MetricTransformation x)
-> (forall x. Rep MetricTransformation x -> MetricTransformation)
-> Generic MetricTransformation
forall x. Rep MetricTransformation x -> MetricTransformation
forall x. MetricTransformation -> Rep MetricTransformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricTransformation x -> MetricTransformation
$cfrom :: forall x. MetricTransformation -> Rep MetricTransformation x
Prelude.Generic)

-- |
-- Create a value of 'MetricTransformation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'defaultValue', 'metricTransformation_defaultValue' - (Optional) The value to emit when a filter pattern does not match a log
-- event. This value can be null.
--
-- 'dimensions', 'metricTransformation_dimensions' - The fields to use as dimensions for the metric. One metric filter can
-- include as many as three dimensions.
--
-- Metrics extracted from log events are charged as custom metrics. To
-- prevent unexpected high charges, do not specify high-cardinality fields
-- such as @IPAddress@ or @requestID@ as dimensions. Each different value
-- found for a dimension is treated as a separate metric and accrues
-- charges as a separate custom metric.
--
-- To help prevent accidental high charges, Amazon disables a metric filter
-- if it generates 1000 different name\/value pairs for the dimensions that
-- you have specified within a certain amount of time.
--
-- You can also set up a billing alarm to alert you if your charges are
-- higher than expected. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges>.
--
-- 'unit', 'metricTransformation_unit' - The unit to assign to the metric. If you omit this, the unit is set as
-- @None@.
--
-- 'metricName', 'metricTransformation_metricName' - The name of the CloudWatch metric.
--
-- 'metricNamespace', 'metricTransformation_metricNamespace' - A custom namespace to contain your metric in CloudWatch. Use namespaces
-- to group together metrics that are similar. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace Namespaces>.
--
-- 'metricValue', 'metricTransformation_metricValue' - The value to publish to the CloudWatch metric when a filter pattern
-- matches a log event.
newMetricTransformation ::
  -- | 'metricName'
  Prelude.Text ->
  -- | 'metricNamespace'
  Prelude.Text ->
  -- | 'metricValue'
  Prelude.Text ->
  MetricTransformation
newMetricTransformation :: Text -> Text -> Text -> MetricTransformation
newMetricTransformation
  Text
pMetricName_
  Text
pMetricNamespace_
  Text
pMetricValue_ =
    MetricTransformation' :: Maybe Double
-> Maybe (HashMap Text Text)
-> Maybe StandardUnit
-> Text
-> Text
-> Text
-> MetricTransformation
MetricTransformation'
      { $sel:defaultValue:MetricTransformation' :: Maybe Double
defaultValue =
          Maybe Double
forall a. Maybe a
Prelude.Nothing,
        $sel:dimensions:MetricTransformation' :: Maybe (HashMap Text Text)
dimensions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:unit:MetricTransformation' :: Maybe StandardUnit
unit = Maybe StandardUnit
forall a. Maybe a
Prelude.Nothing,
        $sel:metricName:MetricTransformation' :: Text
metricName = Text
pMetricName_,
        $sel:metricNamespace:MetricTransformation' :: Text
metricNamespace = Text
pMetricNamespace_,
        $sel:metricValue:MetricTransformation' :: Text
metricValue = Text
pMetricValue_
      }

-- | (Optional) The value to emit when a filter pattern does not match a log
-- event. This value can be null.
metricTransformation_defaultValue :: Lens.Lens' MetricTransformation (Prelude.Maybe Prelude.Double)
metricTransformation_defaultValue :: (Maybe Double -> f (Maybe Double))
-> MetricTransformation -> f MetricTransformation
metricTransformation_defaultValue = (MetricTransformation -> Maybe Double)
-> (MetricTransformation -> Maybe Double -> MetricTransformation)
-> Lens
     MetricTransformation
     MetricTransformation
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Maybe Double
defaultValue :: Maybe Double
$sel:defaultValue:MetricTransformation' :: MetricTransformation -> Maybe Double
defaultValue} -> Maybe Double
defaultValue) (\s :: MetricTransformation
s@MetricTransformation' {} Maybe Double
a -> MetricTransformation
s {$sel:defaultValue:MetricTransformation' :: Maybe Double
defaultValue = Maybe Double
a} :: MetricTransformation)

-- | The fields to use as dimensions for the metric. One metric filter can
-- include as many as three dimensions.
--
-- Metrics extracted from log events are charged as custom metrics. To
-- prevent unexpected high charges, do not specify high-cardinality fields
-- such as @IPAddress@ or @requestID@ as dimensions. Each different value
-- found for a dimension is treated as a separate metric and accrues
-- charges as a separate custom metric.
--
-- To help prevent accidental high charges, Amazon disables a metric filter
-- if it generates 1000 different name\/value pairs for the dimensions that
-- you have specified within a certain amount of time.
--
-- You can also set up a billing alarm to alert you if your charges are
-- higher than expected. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges>.
metricTransformation_dimensions :: Lens.Lens' MetricTransformation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
metricTransformation_dimensions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MetricTransformation -> f MetricTransformation
metricTransformation_dimensions = (MetricTransformation -> Maybe (HashMap Text Text))
-> (MetricTransformation
    -> Maybe (HashMap Text Text) -> MetricTransformation)
-> Lens
     MetricTransformation
     MetricTransformation
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Maybe (HashMap Text Text)
dimensions :: Maybe (HashMap Text Text)
$sel:dimensions:MetricTransformation' :: MetricTransformation -> Maybe (HashMap Text Text)
dimensions} -> Maybe (HashMap Text Text)
dimensions) (\s :: MetricTransformation
s@MetricTransformation' {} Maybe (HashMap Text Text)
a -> MetricTransformation
s {$sel:dimensions:MetricTransformation' :: Maybe (HashMap Text Text)
dimensions = Maybe (HashMap Text Text)
a} :: MetricTransformation) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> MetricTransformation -> f MetricTransformation)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MetricTransformation
-> f MetricTransformation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unit to assign to the metric. If you omit this, the unit is set as
-- @None@.
metricTransformation_unit :: Lens.Lens' MetricTransformation (Prelude.Maybe StandardUnit)
metricTransformation_unit :: (Maybe StandardUnit -> f (Maybe StandardUnit))
-> MetricTransformation -> f MetricTransformation
metricTransformation_unit = (MetricTransformation -> Maybe StandardUnit)
-> (MetricTransformation
    -> Maybe StandardUnit -> MetricTransformation)
-> Lens
     MetricTransformation
     MetricTransformation
     (Maybe StandardUnit)
     (Maybe StandardUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Maybe StandardUnit
unit :: Maybe StandardUnit
$sel:unit:MetricTransformation' :: MetricTransformation -> Maybe StandardUnit
unit} -> Maybe StandardUnit
unit) (\s :: MetricTransformation
s@MetricTransformation' {} Maybe StandardUnit
a -> MetricTransformation
s {$sel:unit:MetricTransformation' :: Maybe StandardUnit
unit = Maybe StandardUnit
a} :: MetricTransformation)

-- | The name of the CloudWatch metric.
metricTransformation_metricName :: Lens.Lens' MetricTransformation Prelude.Text
metricTransformation_metricName :: (Text -> f Text) -> MetricTransformation -> f MetricTransformation
metricTransformation_metricName = (MetricTransformation -> Text)
-> (MetricTransformation -> Text -> MetricTransformation)
-> Lens MetricTransformation MetricTransformation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Text
metricName :: Text
$sel:metricName:MetricTransformation' :: MetricTransformation -> Text
metricName} -> Text
metricName) (\s :: MetricTransformation
s@MetricTransformation' {} Text
a -> MetricTransformation
s {$sel:metricName:MetricTransformation' :: Text
metricName = Text
a} :: MetricTransformation)

-- | A custom namespace to contain your metric in CloudWatch. Use namespaces
-- to group together metrics that are similar. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace Namespaces>.
metricTransformation_metricNamespace :: Lens.Lens' MetricTransformation Prelude.Text
metricTransformation_metricNamespace :: (Text -> f Text) -> MetricTransformation -> f MetricTransformation
metricTransformation_metricNamespace = (MetricTransformation -> Text)
-> (MetricTransformation -> Text -> MetricTransformation)
-> Lens MetricTransformation MetricTransformation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Text
metricNamespace :: Text
$sel:metricNamespace:MetricTransformation' :: MetricTransformation -> Text
metricNamespace} -> Text
metricNamespace) (\s :: MetricTransformation
s@MetricTransformation' {} Text
a -> MetricTransformation
s {$sel:metricNamespace:MetricTransformation' :: Text
metricNamespace = Text
a} :: MetricTransformation)

-- | The value to publish to the CloudWatch metric when a filter pattern
-- matches a log event.
metricTransformation_metricValue :: Lens.Lens' MetricTransformation Prelude.Text
metricTransformation_metricValue :: (Text -> f Text) -> MetricTransformation -> f MetricTransformation
metricTransformation_metricValue = (MetricTransformation -> Text)
-> (MetricTransformation -> Text -> MetricTransformation)
-> Lens MetricTransformation MetricTransformation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricTransformation' {Text
metricValue :: Text
$sel:metricValue:MetricTransformation' :: MetricTransformation -> Text
metricValue} -> Text
metricValue) (\s :: MetricTransformation
s@MetricTransformation' {} Text
a -> MetricTransformation
s {$sel:metricValue:MetricTransformation' :: Text
metricValue = Text
a} :: MetricTransformation)

instance Core.FromJSON MetricTransformation where
  parseJSON :: Value -> Parser MetricTransformation
parseJSON =
    String
-> (Object -> Parser MetricTransformation)
-> Value
-> Parser MetricTransformation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MetricTransformation"
      ( \Object
x ->
          Maybe Double
-> Maybe (HashMap Text Text)
-> Maybe StandardUnit
-> Text
-> Text
-> Text
-> MetricTransformation
MetricTransformation'
            (Maybe Double
 -> Maybe (HashMap Text Text)
 -> Maybe StandardUnit
 -> Text
 -> Text
 -> Text
 -> MetricTransformation)
-> Parser (Maybe Double)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe StandardUnit
      -> Text
      -> Text
      -> Text
      -> MetricTransformation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultValue")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe StandardUnit
   -> Text
   -> Text
   -> Text
   -> MetricTransformation)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe StandardUnit
      -> Text -> Text -> Text -> MetricTransformation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dimensions" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe StandardUnit
   -> Text -> Text -> Text -> MetricTransformation)
-> Parser (Maybe StandardUnit)
-> Parser (Text -> Text -> Text -> MetricTransformation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StandardUnit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unit")
            Parser (Text -> Text -> Text -> MetricTransformation)
-> Parser Text -> Parser (Text -> Text -> MetricTransformation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"metricName")
            Parser (Text -> Text -> MetricTransformation)
-> Parser Text -> Parser (Text -> MetricTransformation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"metricNamespace")
            Parser (Text -> MetricTransformation)
-> Parser Text -> Parser MetricTransformation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"metricValue")
      )

instance Prelude.Hashable MetricTransformation

instance Prelude.NFData MetricTransformation

instance Core.ToJSON MetricTransformation where
  toJSON :: MetricTransformation -> Value
toJSON MetricTransformation' {Maybe Double
Maybe (HashMap Text Text)
Maybe StandardUnit
Text
metricValue :: Text
metricNamespace :: Text
metricName :: Text
unit :: Maybe StandardUnit
dimensions :: Maybe (HashMap Text Text)
defaultValue :: Maybe Double
$sel:metricValue:MetricTransformation' :: MetricTransformation -> Text
$sel:metricNamespace:MetricTransformation' :: MetricTransformation -> Text
$sel:metricName:MetricTransformation' :: MetricTransformation -> Text
$sel:unit:MetricTransformation' :: MetricTransformation -> Maybe StandardUnit
$sel:dimensions:MetricTransformation' :: MetricTransformation -> Maybe (HashMap Text Text)
$sel:defaultValue:MetricTransformation' :: MetricTransformation -> Maybe Double
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"defaultValue" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
defaultValue,
            (Text
"dimensions" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
dimensions,
            (Text
"unit" Text -> StandardUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StandardUnit -> Pair) -> Maybe StandardUnit -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StandardUnit
unit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metricName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"metricNamespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricNamespace),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metricValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricValue)
          ]
      )