Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
OTel.API.Common.Internal
Contents
Synopsis
- class KV (kv :: Type) where
- type KVConstraints kv :: Type -> Type -> Constraint
- (.@) :: KVConstraints kv from to => Key to -> from -> kv
- class (k ~ Text, v ~ Text) => IsTextKV k v
- newtype Key a = Key {}
- newtype Timestamp = Timestamp {}
- timestampFromNanoseconds :: Integer -> Timestamp
- timestampToNanoseconds :: Timestamp -> Integer
- data TimestampSource
- data InstrumentationScope = InstrumentationScope {}
- defaultInstrumentationScope :: InstrumentationScope
- newtype InstrumentationScopeName = InstrumentationScopeName {}
- newtype Version = Version {}
- newtype SchemaURL = SchemaURL {
- unSchemaURL :: Text
- schemaURLFromText :: Text -> Either Text SchemaURL
- schemaURLToText :: SchemaURL -> Text
- class WithAttrs (a :: Type) where
- type WithAttrsAttrType a :: AttrsFor
- (.:@) :: a -> AttrsBuilder (WithAttrsAttrType a) -> a
- data Attrs (af :: AttrsFor) = Attrs {}
- emptyAttrs :: Attrs af
- nullAttrs :: Attrs af -> Bool
- sizeAttrs :: Attrs af -> Int
- memberAttrs :: Key a -> Attrs af -> Bool
- lookupAttrs :: forall a af. KnownAttrType a => Key a -> Attrs af -> Maybe (Attr a)
- foldMapWithKeyAttrs :: forall m af. Monoid m => (forall a. Key a -> Attr a -> m) -> Attrs af -> m
- filterWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> Bool) -> Attrs af -> Attrs af
- mapWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> Attr a) -> Attrs af -> Attrs af
- convertWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> SomeAttr) -> Attrs af -> Attrs af
- droppedAttrsCount :: Attrs af -> Int
- newtype AttrsBuilder (af :: AttrsFor) = AttrsBuilder {}
- runAttrsBuilder :: AttrsBuilder af -> AttrsLimits af -> Attrs af
- jsonAttrs :: forall a af. ToJSON a => Text -> a -> AttrsBuilder af
- data AttrsAcc = AttrsAcc {}
- data AttrsBuilderElem = AttrsBuilderElem {}
- data AttrsFor
- data AttrsLimits (af :: AttrsFor) = AttrsLimits {}
- defaultAttrsLimits :: AttrsLimits af
- data SomeAttr where
- data Attr a = Attr {}
- asTextAttr :: Attr a -> Attr Text
- newtype AttrVals a = AttrVals {
- unAttrVals :: Vector a
- data AttrType (a :: Type) where
- AttrTypeText :: AttrType Text
- AttrTypeBool :: AttrType Bool
- AttrTypeDouble :: AttrType Double
- AttrTypeInt :: AttrType Int64
- AttrTypeTextArray :: AttrType (AttrVals Text)
- AttrTypeBoolArray :: AttrType (AttrVals Bool)
- AttrTypeDoubleArray :: AttrType (AttrVals Double)
- AttrTypeIntArray :: AttrType (AttrVals Int64)
- class KnownAttrType a where
- attrTypeVal :: Proxy a -> AttrType a
- class KnownAttrType to => ToAttrVal from to | from -> to where
- toAttrVal :: from -> to
- with :: a -> (a -> b) -> b
- newtype OnException a = OnException {
- runOnException :: SomeException -> [SeriesElem] -> LoggingT IO a
- askException :: OnException SomeException
- askExceptionMetadata :: OnException [SeriesElem]
- newtype OnTimeout a = OnTimeout {
- runOnTimeout :: Int -> [SeriesElem] -> LoggingT IO a
- askTimeoutMicros :: OnTimeout Int
- askTimeoutMetadata :: OnTimeout [SeriesElem]
- data BufferedLoggerSpec = BufferedLoggerSpec {
- bufferedLoggerSpecShouldBuffer :: Loc -> LogSource -> LogLevel -> LogStr -> Bool
- bufferedLoggerSpecLogger :: Logger
- bufferedLoggerSpecFlushPeriod :: Int
- bufferedLoggerSpecFlushTimeout :: Int
- bufferedLoggerSpecOnFlushTimeout :: BufferedLogs -> OnTimeout ()
- bufferedLoggerSpecOnFlushException :: BufferedLog -> BufferedLogAgg -> OnException ()
- bufferedLoggerSpecOnFlushExceptionLogger :: Logger
- bufferedLoggerSpecIncludeLogAggregate :: BufferedLog -> BufferedLogAgg -> [SeriesElem] -> LogStr
- defaultBufferedLoggerSpec :: BufferedLoggerSpec
- includeLogAggregateViaAeson :: forall a. ToJSON a => (BufferedLogAgg -> Maybe a) -> BufferedLog -> BufferedLogAgg -> [SeriesElem] -> LogStr
- withBufferedLogger :: forall m a. MonadUnliftIO m => BufferedLoggerSpec -> (Logger -> m a) -> m a
- withBufferedLoggerIO :: forall a. BufferedLoggerSpec -> (Logger -> IO a) -> IO a
- type BufferedLogs = HashMap BufferedLog BufferedLogAgg
- insertBufferedLog :: BufferedLog -> KeyMap Value -> BufferedLogs -> BufferedLogs
- insertBufferedLogWithAgg :: BufferedLog -> BufferedLogAgg -> BufferedLogs -> BufferedLogs
- data BufferedLog = BufferedLog {}
- toBufferedLog :: Loc -> LogSource -> LogLevel -> LogStr -> (BufferedLog, KeyMap Value)
- data BufferedLogAgg = BufferedLogAgg {}
- type Logger = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
Disclaimer
In general, changes to this module will not be reflected in the library's version updates. Direct use of this module should be done with utmost care, otherwise invariants will easily be violated.
General
class KV (kv :: Type) where Source #
Associated Types
type KVConstraints kv :: Type -> Type -> Constraint Source #
Methods
(.@) :: KVConstraints kv from to => Key to -> from -> kv infixr 8 Source #
Instances
KV (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal Associated Types type KVConstraints (AttrsBuilder af) :: Type -> Type -> Constraint Source # Methods (.@) :: KVConstraints (AttrsBuilder af) from to => Key to -> from -> AttrsBuilder af Source # |
Constructors
Timestamp | |
Fields
|
data TimestampSource Source #
Constructors
TimestampSourceNow | |
TimestampSourceAt Timestamp |
Instances
Show TimestampSource Source # | |
Defined in OTel.API.Common.Internal Methods showsPrec :: Int -> TimestampSource -> ShowS # show :: TimestampSource -> String # showList :: [TimestampSource] -> ShowS # | |
Eq TimestampSource Source # | |
Defined in OTel.API.Common.Internal Methods (==) :: TimestampSource -> TimestampSource -> Bool # (/=) :: TimestampSource -> TimestampSource -> Bool # |
data InstrumentationScope Source #
Constructors
InstrumentationScope | |
Instances
newtype InstrumentationScopeName Source #
Constructors
InstrumentationScopeName | |
Fields |
Instances
Constructors
SchemaURL | |
Fields
|
Instances
ToJSON SchemaURL Source # | |
Show SchemaURL Source # | |
Eq SchemaURL Source # | |
Ord SchemaURL Source # | |
Hashable SchemaURL Source # | |
Defined in OTel.API.Common.Internal |
schemaURLToText :: SchemaURL -> Text Source #
Attributes
class WithAttrs (a :: Type) where Source #
Associated Types
type WithAttrsAttrType a :: AttrsFor Source #
Methods
(.:@) :: a -> AttrsBuilder (WithAttrsAttrType a) -> a infixr 6 Source #
emptyAttrs :: Attrs af Source #
lookupAttrs :: forall a af. KnownAttrType a => Key a -> Attrs af -> Maybe (Attr a) Source #
foldMapWithKeyAttrs :: forall m af. Monoid m => (forall a. Key a -> Attr a -> m) -> Attrs af -> m Source #
filterWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> Bool) -> Attrs af -> Attrs af Source #
mapWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> Attr a) -> Attrs af -> Attrs af Source #
convertWithKeyAttrs :: forall af. (forall a. Key a -> Attr a -> SomeAttr) -> Attrs af -> Attrs af Source #
Equivalent to mapWithKeyAttrs
but allows for changing both the type and
value of each attribute rather than just the value of the attribute.
droppedAttrsCount :: Attrs af -> Int Source #
newtype AttrsBuilder (af :: AttrsFor) Source #
Constructors
AttrsBuilder | |
Fields |
Instances
Monoid (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal Methods mempty :: AttrsBuilder af # mappend :: AttrsBuilder af -> AttrsBuilder af -> AttrsBuilder af # mconcat :: [AttrsBuilder af] -> AttrsBuilder af # | |
Semigroup (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal Methods (<>) :: AttrsBuilder af -> AttrsBuilder af -> AttrsBuilder af # sconcat :: NonEmpty (AttrsBuilder af) -> AttrsBuilder af # stimes :: Integral b => b -> AttrsBuilder af -> AttrsBuilder af # | |
KV (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal Associated Types type KVConstraints (AttrsBuilder af) :: Type -> Type -> Constraint Source # Methods (.@) :: KVConstraints (AttrsBuilder af) from to => Key to -> from -> AttrsBuilder af Source # | |
type KVConstraints (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal |
runAttrsBuilder :: AttrsBuilder af -> AttrsLimits af -> Attrs af Source #
Constructors
AttrsAcc | |
Fields |
data AttrsBuilderElem Source #
Constructors
AttrsBuilderElem | |
Fields |
data AttrsLimits (af :: AttrsFor) Source #
Constructors
AttrsLimits | |
Fields |
Instances
ToJSON (AttrsLimits af) Source # | |
Defined in OTel.API.Common.Internal Methods toJSON :: AttrsLimits af -> Value # toEncoding :: AttrsLimits af -> Encoding # toJSONList :: [AttrsLimits af] -> Value # toEncodingList :: [AttrsLimits af] -> Encoding # omitField :: AttrsLimits af -> Bool # |
defaultAttrsLimits :: AttrsLimits af Source #
asTextAttr :: Attr a -> Attr Text Source #
Convert an attribute to a text attribute.
This function is identity if the attribute already is a text attribute.
Otherwise, the attribute value is passed to show
.
Constructors
AttrVals | |
Fields
|
Instances
data AttrType (a :: Type) where Source #
Constructors
class KnownAttrType a where Source #
Methods
attrTypeVal :: Proxy a -> AttrType a Source #
Instances
KnownAttrType Int64 Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType Text Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType Bool Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType Double Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType (AttrVals Int64) Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType (AttrVals Text) Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType (AttrVals Bool) Source # | |
Defined in OTel.API.Common.Internal | |
KnownAttrType (AttrVals Double) Source # | |
Defined in OTel.API.Common.Internal |
class KnownAttrType to => ToAttrVal from to | from -> to where Source #
Instances
newtype OnException a Source #
Constructors
OnException | |
Fields
|
Instances
Constructors
OnTimeout | |
Fields
|
Instances
data BufferedLoggerSpec Source #
Constructors
BufferedLoggerSpec | |
Fields
|
includeLogAggregateViaAeson Source #
Arguments
:: forall a. ToJSON a | |
=> (BufferedLogAgg -> Maybe a) | Summarizes the aggregated info |
-> BufferedLog | |
-> BufferedLogAgg | |
-> [SeriesElem] | |
-> LogStr |
withBufferedLogger :: forall m a. MonadUnliftIO m => BufferedLoggerSpec -> (Logger -> m a) -> m a Source #
withBufferedLoggerIO :: forall a. BufferedLoggerSpec -> (Logger -> IO a) -> IO a Source #
insertBufferedLog :: BufferedLog -> KeyMap Value -> BufferedLogs -> BufferedLogs Source #
data BufferedLog Source #
Constructors
BufferedLog | |
Fields |
Instances
ToJSON BufferedLog Source # | |
Defined in OTel.API.Common.Internal Methods toJSON :: BufferedLog -> Value # toEncoding :: BufferedLog -> Encoding # toJSONList :: [BufferedLog] -> Value # toEncodingList :: [BufferedLog] -> Encoding # omitField :: BufferedLog -> Bool # | |
Eq BufferedLog Source # | |
Defined in OTel.API.Common.Internal | |
Hashable BufferedLog Source # | |
Defined in OTel.API.Common.Internal |
toBufferedLog :: Loc -> LogSource -> LogLevel -> LogStr -> (BufferedLog, KeyMap Value) Source #
data BufferedLogAgg Source #
Constructors
BufferedLogAgg | |
Fields |
Instances
ToJSON BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal Methods toJSON :: BufferedLogAgg -> Value # toEncoding :: BufferedLogAgg -> Encoding # toJSONList :: [BufferedLogAgg] -> Value # toEncodingList :: [BufferedLogAgg] -> Encoding # omitField :: BufferedLogAgg -> Bool # | |
Semigroup BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal Methods (<>) :: BufferedLogAgg -> BufferedLogAgg -> BufferedLogAgg # sconcat :: NonEmpty BufferedLogAgg -> BufferedLogAgg # stimes :: Integral b => b -> BufferedLogAgg -> BufferedLogAgg # | |
Eq BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal Methods (==) :: BufferedLogAgg -> BufferedLogAgg -> Bool # (/=) :: BufferedLogAgg -> BufferedLogAgg -> Bool # |