{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module OpenTelemetry.Resource.Process where
import Data.Text (Text)
import OpenTelemetry.Resource
data Process = Process
{ Process -> Maybe Int
processPid :: Maybe Int
, Process -> Maybe Text
processExecutableName :: Maybe Text
, Process -> Maybe Text
processExecutablePath :: Maybe Text
, Process -> Maybe Text
processCommand :: Maybe Text
, Process -> Maybe Text
processCommandLine :: Maybe Text
, Process -> Maybe [Text]
processCommandArgs :: Maybe [Text]
, Process -> Maybe Text
processOwner :: Maybe Text
}
instance ToResource Process where
type ResourceSchema Process = 'Nothing
toResource :: Process -> Resource (ResourceSchema Process)
toResource Process {Maybe Int
Maybe [Text]
Maybe Text
processPid :: Process -> Maybe Int
processExecutableName :: Process -> Maybe Text
processExecutablePath :: Process -> Maybe Text
processCommand :: Process -> Maybe Text
processCommandLine :: Process -> Maybe Text
processCommandArgs :: Process -> Maybe [Text]
processOwner :: Process -> Maybe Text
processPid :: Maybe Int
processExecutableName :: Maybe Text
processExecutablePath :: Maybe Text
processCommand :: Maybe Text
processCommandLine :: Maybe Text
processCommandArgs :: Maybe [Text]
processOwner :: Maybe Text
..} =
[Maybe (Text, Attribute)] -> Resource 'Nothing
forall (r :: Maybe Symbol). [Maybe (Text, Attribute)] -> Resource r
mkResource
[ Text
"process.pid" Text -> Maybe Int -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Int
processPid
, Text
"process.executable.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processExecutableName
, Text
"process.executable.path" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processExecutablePath
, Text
"process.command" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processCommand
, Text
"process.command_line" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processCommandLine
, Text
"process.command_args" Text -> Maybe [Text] -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe [Text]
processCommandArgs
, Text
"process.owner" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processOwner
]
data ProcessRuntime = ProcessRuntime
{ ProcessRuntime -> Maybe Text
processRuntimeName :: Maybe Text
, ProcessRuntime -> Maybe Text
processRuntimeVersion :: Maybe Text
, ProcessRuntime -> Maybe Text
processRuntimeDescription :: Maybe Text
}
instance ToResource ProcessRuntime where
type ResourceSchema ProcessRuntime = 'Nothing
toResource :: ProcessRuntime -> Resource (ResourceSchema ProcessRuntime)
toResource ProcessRuntime {Maybe Text
processRuntimeName :: ProcessRuntime -> Maybe Text
processRuntimeVersion :: ProcessRuntime -> Maybe Text
processRuntimeDescription :: ProcessRuntime -> Maybe Text
processRuntimeName :: Maybe Text
processRuntimeVersion :: Maybe Text
processRuntimeDescription :: Maybe Text
..} =
[Maybe (Text, Attribute)] -> Resource 'Nothing
forall (r :: Maybe Symbol). [Maybe (Text, Attribute)] -> Resource r
mkResource
[ Text
"process.runtime.name" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processRuntimeName
, Text
"process.runtime.version" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processRuntimeVersion
, Text
"process.runtime.description" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
processRuntimeDescription
]