@@ -53,10 +53,10 @@ import Data.Time
5353import Data.Time.Calendar.WeekDate
5454import Data.Typeable
5555import Data.UUID
56+import qualified Data.UUID.V4 as UUID4
5657import Database.Bloodhound
5758import Network.HTTP.Client
5859import Network.HTTP.Types.Status
59−import System.Random
6060-------------------------------------------------------------------------------
6161import Katip.Core
6262import Katip.Scribes.ElasticSearch.Annotations
@@ -64,13 +64,13 @@ import Katip.Scribes.ElasticSearch.Annotations
6464
6565
6666data EsScribeCfg = EsScribeCfg {
67− essRetryPolicy :: RetryPolicy
67+ essRetryPolicy :: RetryPolicy
6868 -- ^ Retry policy when there are errors sending logs to the server
69− , essQueueSize :: EsQueueSize
69+ , essQueueSize :: EsQueueSize
7070 -- ^ Maximum size of the bounded log queue
71− , essPoolSize :: EsPoolSize
71+ , essPoolSize :: EsPoolSize
7272 -- ^ Worker pool size limit for sending data to the
73− , essAnnotateTypes :: Bool
73+ , essAnnotateTypes :: Bool
7474 -- ^ Different payload items coexist in the "data" attribute in
7575 -- ES. It is possible for different payloads to have different
7676 -- types for the same key, e.g. an "id" key that is sometimes a
@@ -83,8 +83,8 @@ data EsScribeCfg = EsScribeCfg {
8383 -- exposes a querying API, we will try to make deserialization and
8484 -- querying transparently remove the type annotations if this is
8585 -- enabled.
86− , essIndexSettings :: IndexSettings
87− , essIndexSharding :: IndexShardingPolicy
86+ , essIndexSettings :: IndexSettings
87+ , essIndexSharding :: IndexShardingPolicy
8888 } deriving (Typeable)
8989
9090
@@ -322,7 +322,7 @@ esDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd'T
322322
323323-------------------------------------------------------------------------------
324324mkDocId :: IO DocId
325−mkDocId = (DocId . T.decodeUtf8 . toASCIIBytes) `fmap` randomIO
325+mkDocId = (DocId . T.decodeUtf8 . toASCIIBytes) `fmap` UUID4.nextRandom
326326
327327
328328-------------------------------------------------------------------------------