{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module OpenTelemetry.Resource.Telemetry where
import Data.Text (Text)
import OpenTelemetry.Resource
data Telemetry = Telemetry
{ Telemetry -> Text
telemetrySdkName :: Text
, Telemetry -> Maybe Text
telemetrySdkLanguage :: Maybe Text
, Telemetry -> Maybe Text
telemetrySdkVersion :: Maybe Text
, Telemetry -> Maybe Text
telemetryAutoVersion :: Maybe Text
}
instance ToResource Telemetry where
type ResourceSchema Telemetry = 'Nothing
toResource :: Telemetry -> Resource (ResourceSchema Telemetry)
toResource Telemetry {Maybe Text
Text
telemetrySdkName :: Telemetry -> Text
telemetrySdkLanguage :: Telemetry -> Maybe Text
telemetrySdkVersion :: Telemetry -> Maybe Text
telemetryAutoVersion :: Telemetry -> Maybe Text
telemetrySdkName :: Text
telemetrySdkLanguage :: Maybe Text
telemetrySdkVersion :: Maybe Text
telemetryAutoVersion :: Maybe Text
..} =
[Maybe (Text, Attribute)] -> Resource 'Nothing
forall (r :: Maybe Symbol). [Maybe (Text, Attribute)] -> Resource r
mkResource
[ Text
"telemetry.sdk.name" Text -> Text -> Maybe (Text, Attribute)
forall a. ToAttribute a => Text -> a -> Maybe (Text, Attribute)
.= Text
telemetrySdkName
, Text
"telemetry.sdk.language" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
telemetrySdkLanguage
, Text
"telemetry.sdk.version" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
telemetrySdkVersion
, Text
"telemetry.auto.version" Text -> Maybe Text -> Maybe (Text, Attribute)
forall a.
ToAttribute a =>
Text -> Maybe a -> Maybe (Text, Attribute)
.=? Maybe Text
telemetryAutoVersion
]