Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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 #
type KVConstraints kv :: Type -> Type -> Constraint Source #
(.@) :: KVConstraints kv from to => Key to -> from -> kv infixr 8 Source #
Instances
KV (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal type KVConstraints (AttrsBuilder af) :: Type -> Type -> Constraint Source # (.@) :: KVConstraints (AttrsBuilder af) from to => Key to -> from -> AttrsBuilder af Source # |
Timestamp | |
|
data TimestampSource Source #
Instances
Show TimestampSource Source # | |
Defined in OTel.API.Common.Internal showsPrec :: Int -> TimestampSource -> ShowS # show :: TimestampSource -> String # showList :: [TimestampSource] -> ShowS # | |
Eq TimestampSource Source # | |
Defined in OTel.API.Common.Internal (==) :: TimestampSource -> TimestampSource -> Bool # (/=) :: TimestampSource -> TimestampSource -> Bool # |
data InstrumentationScope Source #
Instances
newtype InstrumentationScopeName Source #
Instances
schemaURLToText :: SchemaURL -> Text Source #
Attributes
class WithAttrs (a :: Type) where Source #
type WithAttrsAttrType a :: AttrsFor Source #
(.:@) :: 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 #
Instances
Monoid (AttrsBuilder af) Source # | |
Defined in OTel.API.Common.Internal 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 (<>) :: 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 type KVConstraints (AttrsBuilder af) :: Type -> Type -> Constraint Source # (.@) :: 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 #
data AttrsBuilderElem Source #
data AttrsLimits (af :: AttrsFor) Source #
Instances
ToJSON (AttrsLimits af) Source # | |
Defined in OTel.API.Common.Internal toJSON :: AttrsLimits af -> Value # toEncoding :: AttrsLimits af -> Encoding # toJSONList :: [AttrsLimits af] -> Value # toEncodingList :: [AttrsLimits af] -> Encoding # omitField :: AttrsLimits af -> Bool # |
defaultAttrsLimits :: AttrsLimits af Source #
Instances
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
.
AttrVals | |
|
Instances
data AttrType (a :: Type) where Source #
class KnownAttrType a where Source #
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 #
OnException | |
|
Instances
OnTimeout | |
|
Instances
data BufferedLoggerSpec Source #
BufferedLoggerSpec | |
|
includeLogAggregateViaAeson Source #
:: 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 #
Instances
ToJSON BufferedLog Source # | |
Defined in OTel.API.Common.Internal toJSON :: BufferedLog -> Value # toEncoding :: BufferedLog -> Encoding # toJSONList :: [BufferedLog] -> Value # toEncodingList :: [BufferedLog] -> Encoding # omitField :: BufferedLog -> Bool # | |
Eq BufferedLog Source # | |
Defined in OTel.API.Common.Internal (==) :: BufferedLog -> BufferedLog -> Bool # (/=) :: BufferedLog -> BufferedLog -> Bool # | |
Hashable BufferedLog Source # | |
Defined in OTel.API.Common.Internal hashWithSalt :: Int -> BufferedLog -> Int # hash :: BufferedLog -> Int # |
toBufferedLog :: Loc -> LogSource -> LogLevel -> LogStr -> (BufferedLog, KeyMap Value) Source #
data BufferedLogAgg Source #
Instances
ToJSON BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal toJSON :: BufferedLogAgg -> Value # toEncoding :: BufferedLogAgg -> Encoding # toJSONList :: [BufferedLogAgg] -> Value # toEncodingList :: [BufferedLogAgg] -> Encoding # omitField :: BufferedLogAgg -> Bool # | |
Semigroup BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal (<>) :: BufferedLogAgg -> BufferedLogAgg -> BufferedLogAgg # sconcat :: NonEmpty BufferedLogAgg -> BufferedLogAgg # stimes :: Integral b => b -> BufferedLogAgg -> BufferedLogAgg # | |
Eq BufferedLogAgg Source # | |
Defined in OTel.API.Common.Internal (==) :: BufferedLogAgg -> BufferedLogAgg -> Bool # (/=) :: BufferedLogAgg -> BufferedLogAgg -> Bool # |