on master help sign in
13 files changed+84−30
since splitsnapshots
unifiedsplit
.travis.yml+2−2 katip-datadog/changelog.md+4 katip-datadog/katip-datadog.cabal+1−1 katip-elasticsearch/bench/Main.hs+3−3 katip-elasticsearch/changelog.md+10 katip-elasticsearch/docker-compose.yml+10 katip-elasticsearch/examples/example.hs+1−1 katip-elasticsearch/katip-elasticsearch.cabal+1−4 katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+5 katip-elasticsearch/src/Katip/Scribes/ElasticSearch/Internal.hs+18−7 katip-elasticsearch/test/Main.hs+23−7 katip/README.md+1−1 stack.yaml+5−4
.travis.yml+2−2
@@ -14,8 +14,8 @@ addons:
1414# change flags or use --stack-yaml to point to a different file.
1515matrix:
1616 include:
17− - env: ARGS="--resolver=lts-12" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
18− - env: ARGS="--resolver=lts-12" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
17+ - env: ARGS="--resolver=lts-16" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
18+ - env: ARGS="--resolver=lts-16" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
1919 - env: ARGS="--resolver=nightly" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
2020 - env: ARGS="--resolver=nightly" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
2121 # nightlies may fail usually due to lagging dependencies
katip-datadog/changelog.md+4
@@ -1,3 +1,7 @@
1+0.2.0.0
2+==========
3+* Remove import of deprecated Network module
4+
150.1.0.0
26==========
37* Initial release
katip-datadog/katip-datadog.cabal+1−1
@@ -1,5 +1,5 @@
11name: katip-datadog
2−version: 0.1.0.0
2+version: 0.2.0.0
33synopsis: Datadog scribe for the Katip logging framework
44description: See README.md for more details.
55license: BSD3
katip-elasticsearch/bench/Main.hs+3−3
@@ -15,11 +15,11 @@ import qualified Data.HashMap.Strict as HM
1515import Data.Proxy (Proxy (..))
1616import System.Random
1717import qualified Data.Text as T
18−import Database.V1.Bloodhound.Types
18+import Database.Bloodhound.Types
1919import Numeric
2020-------------------------------------------------------------------------------
2121import Katip.Scribes.ElasticSearch
22−import Katip.Scribes.ElasticSearch.Internal (ESV1)
22+import Katip.Scribes.ElasticSearch.Internal (ESV5)
2323-------------------------------------------------------------------------------
2424
2525main :: IO ()
@@ -34,7 +34,7 @@ main = do
3434mkDocIdBenchmark :: Benchmark
3535mkDocIdBenchmark = bgroup "mkDocId"
3636 [
37− bench "mkDocId (randomIO)" $ nfIO (mkDocId (Proxy :: Proxy ESV1))
37+ bench "mkDocId (randomIO)" $ nfIO (mkDocId (Proxy :: Proxy ESV5))
3838 , bench "mkDocId' (shared )" $ nfIO mkDocId'
3939 ]
4040
katip-elasticsearch/changelog.md+10
@@ -1,3 +1,13 @@
1+0.7.0.0
2+=======
3+* Make compatible with unreleased bloodhound 0.17
4+* Deprecate use of ES version 1 which has been removed from bloodhound
5+ 0.17. All users should move over to ESV5 which should work for
6+ versions 5 and up.
7+* Default configuration to ESV5
8+* Add deprecation warnings for ESV1. Support for ESV1 will be removed
9+ in the future.
10+
1110.6.0.0
212=======
313* Update to katip-0.8.0.0 `PermitFunc` convention. To update, for
katip-elasticsearch/docker-compose.ymlnew file+10
@@ -0,0 +1,10 @@
1+version: "3.7"
2+services:
3+ # https://hub.docker.com/_/elasticsearch
4+ elasticsearch:
5+ image: elasticsearch:5-alpine
6+ ports:
7+ - target: 9200
8+ published: 9200
9+ protocol: tcp
10+ mode: host
katip-elasticsearch/examples/example.hs+1−1
@@ -6,7 +6,7 @@ module Main
66
77-------------------------------------------------------------------------------
88import Control.Exception
9−import Database.V5.Bloodhound
9+import Database.Bloodhound
1010import Network.HTTP.Client
1111-------------------------------------------------------------------------------
1212import Katip
katip-elasticsearch/katip-elasticsearch.cabal+1−4
@@ -1,7 +1,7 @@
11name: katip-elasticsearch
22synopsis: ElasticSearch scribe for the Katip logging framework.
33description: See README.md for more details.
4−version: 0.6.0.0
4+version: 0.7.0.0
55license: BSD3
66license-file: LICENSE
77author: Ozgun Ataman, Michael Xavier
@@ -108,7 +108,4 @@ test-suite test
108108 , bytestring
109109 , tagged
110110
111− if flag(lib-Werror)
112− ghc-options: -Wall -Werror
113−
114111 ghc-options: -threaded -rtsopts
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+5
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12-- | Includes a scribe that can be used to log structured, JSON log
23-- messages to ElasticSearch. These logs can be explored easily using
34-- <https://www.elastic.co/products/kibana kibana> or your tool of
@@ -67,12 +68,16 @@ module Katip.Scribes.ElasticSearch
6768 , essIndexSettings
6869 , essIndexSharding
6970 , defaultEsScribeCfg
71+#if !MIN_VERSION_bloodhound(0,17,0)
7072 , defaultEsScribeCfgV1
73+#endif
7174 , defaultEsScribeCfgV5
7275 -- ** Version-Proxied APIS
7376 -- $versionproxies
7477 , defaultEsScribeCfg'
78+#if !MIN_VERSION_bloodhound(0,17,0)
7579 , ESV1
80+#endif
7681 , ESV5
7782 -- * Utilities
7883 , mkDocId
katip-elasticsearch/src/Katip/Scribes/ElasticSearch/Internal.hs+18−7
@@ -28,7 +28,7 @@ import Control.Retry (RetryPolicy,
2828import Data.Aeson
2929import Data.ByteString.Lazy (ByteString)
3030import Data.List.NonEmpty (NonEmpty (..))
31−import Data.Monoid ((<>))
31+import Data.Monoid as Monoid
3232import Data.Text (Text)
3333import qualified Data.Text as T
3434import qualified Data.Text.Encoding as T
@@ -37,8 +37,12 @@ import Data.Time.Calendar.WeekDate
3737import Data.Typeable as Typeable
3838import Data.UUID
3939import qualified Data.UUID.V4 as UUID4
40+#if MIN_VERSION_bloodhound(0,17,0)
41+import qualified Database.Bloodhound as V5
42+#else
4043import qualified Database.V1.Bloodhound as V1
4144import qualified Database.V5.Bloodhound as V5
45+#endif
4246import Network.HTTP.Client
4347import Network.HTTP.Types.Status
4448import Text.Printf (printf)
@@ -95,7 +99,7 @@ data EsScribeCfg v = EsScribeCfg {
9599-- * DailyIndexSharding
96100defaultEsScribeCfg' :: ESVersion v => proxy v -> EsScribeCfg v
97101defaultEsScribeCfg' prx = EsScribeCfg {
98− essRetryPolicy = exponentialBackoff 25000 <> limitRetries 5
102+ essRetryPolicy = exponentialBackoff 25000 Monoid.<> limitRetries 5
99103 , essQueueSize = EsQueueSize 1000
100104 , essPoolSize = EsPoolSize 2
101105 , essAnnotateTypes = False
@@ -104,19 +108,22 @@ defaultEsScribeCfg' prx = EsScribeCfg {
104108 }
105109
106110
111+
112+
107113-------------------------------------------------------------------------------
108−-- | Alias of 'defaultEsScribeCfgV1' to minimize API
114+-- | Alias of 'defaultEsScribeCfgV5' to minimize API
109115-- breakage. Previous versions of katip-elasticsearch only supported
110−-- ES version 1.
111−defaultEsScribeCfg :: EsScribeCfg ESV1
112−defaultEsScribeCfg = defaultEsScribeCfgV1
116+-- ES version 1 and defaulted to it.
117+defaultEsScribeCfg :: EsScribeCfg ESV5
118+defaultEsScribeCfg = defaultEsScribeCfgV5
113119
114120
115121-------------------------------------------------------------------------------
122+#if !MIN_VERSION_bloodhound(0,17,0)
116123-- | EsScribeCfg that will use ElasticSearch V1
117124defaultEsScribeCfgV1 :: EsScribeCfg ESV1
118125defaultEsScribeCfgV1 = defaultEsScribeCfg' (Typeable.Proxy :: Typeable.Proxy ESV1)
119−
126+#endif
120127
121128-------------------------------------------------------------------------------
122129-- | EsScribeCfg that will use ElasticSearch V5
@@ -484,7 +491,10 @@ class ESVersion v where
484491
485492
486493
494+#if !MIN_VERSION_bloodhound(0,17,0)
487495data ESV1 = ESV1
496+{-# DEPRECATED ESV1 "ESV1 is deprecated and removed in bloodhound >= 0.17.0" #-}
497+
488498
489499instance ESVersion ESV1 where
490500 type BHEnv ESV1 = V1.BHEnv
@@ -524,6 +534,7 @@ instance ESVersion ESV1 where
524534 [ "type" .= String "string"
525535 , "index" .= String "analyzed"
526536 ]
537+#endif
527538
528539
529540data ESV5 = ESV5
katip-elasticsearch/test/Main.hs+23−7
@@ -34,8 +34,12 @@ import Data.Time
3434import Data.Time.Calendar.WeekDate
3535import Data.Typeable as Typeable
3636import qualified Data.Vector as V
37+#if MIN_VERSION_bloodhound(0,17,0)
38+import qualified Database.Bloodhound as V5
39+#else
3740import qualified Database.V1.Bloodhound as V1
3841import qualified Database.V5.Bloodhound as V5
42+#endif
3943import Network.HTTP.Client
4044import Network.HTTP.Types.Status
4145import Test.QuickCheck.Instances ()
@@ -54,8 +58,10 @@ main :: IO ()
5458main = defaultMainWithIngredients ings $ askOption $ \vers -> testGroup "katip-elasticsearch"
5559 [
5660 case vers of
57− TestV1 -> esTests (Typeable.Proxy :: Typeable.Proxy ESV1)
58− TestV5 -> esTests (Typeable.Proxy :: Typeable.Proxy ESV5)
61+#if !MIN_VERSION_bloodhound(0,17,0)
62+ TestV1 -> esTests (Typeable.Proxy :: Typeable.Proxy ESV1)
63+#endif
64+ TestV5 -> esTests (Typeable.Proxy :: Typeable.Proxy ESV5)
5965 , typeAnnotatedTests
6066 , roundToSundayTests
6167 ]
@@ -64,18 +70,26 @@ main = defaultMainWithIngredients ings $ askOption $ \vers -> testGroup "katip-e
6470
6571
6672-------------------------------------------------------------------------------
67−data TestWithESVersion = TestV1
68− | TestV5
69− deriving (Typeable)
73+data TestWithESVersion = TestV5
74+#if !MIN_VERSION_bloodhound(0,17,0)
75+ | TestV1
76+#endif
77+ deriving (Typeable)
7078
7179
7280instance IsOption TestWithESVersion where
73− defaultValue = TestV1
81+ defaultValue = TestV5
82+#if !MIN_VERSION_bloodhound(0,17,0)
7483 parseValue "1" = Just TestV1
84+#endif
7585 parseValue "5" = Just TestV5
7686 parseValue _ = Nothing
7787 optionName = Tagged "es-version"
78− optionHelp = Tagged "Version of ES to test against, either 1 or 5, defaulting to 1."
88+#if MIN_VERSION_bloodhound(0,17,0)
89+ optionHelp = Tagged "Version of ES to test against, either 1 or 5, defaulting to 5."
90+#else
91+ optionHelp = Tagged "Version of ES to test against, only v5 is supported, but should work for higher versions."
92+#endif
7993
8094
8195class ESVersion v => TestESVersion v where
@@ -101,6 +115,7 @@ class ESVersion v => TestESVersion v where
101115 searchByIndex :: proxy v -> IndexName v -> Search v -> BH v IO (Response ByteString)
102116
103117
118+#if !MIN_VERSION_bloodhound(0,17,0)
104119instance TestESVersion ESV1 where
105120 type Server ESV1 = V1.Server
106121 toServer _ = V1.Server
@@ -122,6 +137,7 @@ instance TestESVersion ESV1 where
122137 refreshIndex _ = V1.refreshIndex
123138 withBH _ = V1.withBH
124139 searchByIndex _ = V1.searchByIndex
140+#endif
125141
126142
127143instance TestESVersion ESV5 where
katip/README.md+1−1
@@ -16,7 +16,7 @@ Kâtip (pronounced kah-tip) is the Turkish word for scribe.
1616 add context that will be automatically merged in with existing log
1717 context.
1818
19−* *Easy to Integration:* Katip was designed to be easily integrated
19+* *Easy Integration:* Katip was designed to be easily integrated
2020 into existing monads. By using typeclasses for logging facilities,
2121 individual subsystems and even libraries can easily add their own
2222 namespacing and context without having any knowledge of their
stack.yaml+5−4
@@ -1,13 +1,14 @@
1−resolver: lts-12.26
1+resolver: lts-16.18
22packages:
33 - katip
44 - katip-elasticsearch
55 - katip-datadog
66 - katip-logzio
77extra-deps:
8− - bloodhound-0.16.0.0
9− - unliftio-core-0.2.0.1
10− - resourcet-1.2.3
8+ # ghc 8.8 support
9+ - github: wireapp/bloodhound
10+ commit: b409f52b518f20a4c20651b5893c31b7b85cb9b1
11+allow-newer: true
1112flags:
1213 katip:
1314 lib-Werror: true