{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module OpenTelemetry.Resource.Host (
Host (..),
) where
import Data.Text (Text)
import OpenTelemetry.Resource (ToResource (..), mkResource, (.=?))
data Host = Host
{ Host -> Maybe Text
hostId :: Maybe Text
, Host -> Maybe Text
hostName :: Maybe Text
, Host -> Maybe Text
hostType :: Maybe Text
, Host -> Maybe Text
hostArch :: Maybe Text
, Host -> Maybe Text
hostImageName :: Maybe Text
, Host -> Maybe Text
hostImageId :: Maybe Text
, Host -> Maybe Text
hostImageVersion :: Maybe Text
}
instance ToResource Host where
type ResourceSchema Host = 'Nothing
toResource :: Host -> Resource (ResourceSchema Host)
toResource Host {Maybe Text
hostId :: Host -> Maybe Text
hostName :: Host -> Maybe Text
hostType :: Host -> Maybe Text
hostArch :: Host -> Maybe Text
hostImageName :: Host -> Maybe Text
hostImageId :: Host -> Maybe Text
hostImageVersion :: Host -> Maybe Text
hostId :: Maybe Text
hostName :: Maybe Text
hostType :: Maybe Text
hostArch :: Maybe Text
hostImageName :: Maybe Text
hostImageId :: Maybe Text
hostImageVersion :: Maybe Text
..} =
[Maybe (Text, Attribute)] -> Resource 'Nothing
forall (r :: Maybe Symbol). [Maybe (Text, Attribute)] -> Resource r
mkResource
[ Text
"host.id" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostId
, Text
"host.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostName
, Text
"host.type" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostType
, Text
"host.arch" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostArch
, Text
"host.image.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostImageName
, Text
"host.image.id" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostImageId
, Text
"host.image.version" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
hostImageVersion
]