{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module OpenTelemetry.Resource.Container where
import Data.Text (Text)
import OpenTelemetry.Resource
data Container = Container
{ Container -> Maybe Text
containerName :: Maybe Text
, Container -> Maybe Text
containerId :: Maybe Text
, Container -> Maybe Text
containerRuntime :: Maybe Text
, Container -> Maybe Text
containerImageName :: Maybe Text
, Container -> Maybe Text
containerImageTag :: Maybe Text
}
instance ToResource Container where
type ResourceSchema Container = 'Nothing
toResource :: Container -> Resource (ResourceSchema Container)
toResource Container {Maybe Text
containerName :: Container -> Maybe Text
containerId :: Container -> Maybe Text
containerRuntime :: Container -> Maybe Text
containerImageName :: Container -> Maybe Text
containerImageTag :: Container -> Maybe Text
containerName :: Maybe Text
containerId :: Maybe Text
containerRuntime :: Maybe Text
containerImageName :: Maybe Text
containerImageTag :: Maybe Text
..} =
[Maybe (Text, Attribute)] -> Resource 'Nothing
forall (r :: Maybe Symbol). [Maybe (Text, Attribute)] -> Resource r
mkResource
[ Text
"container.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
containerName
, Text
"container.id" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
containerId
, Text
"container.runtime" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
containerRuntime
, Text
"container.image.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
containerImageName
, Text
"container.image.tag" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
containerImageTag
]