|
| 1 | +{-# LANGUAGE CPP #-} |
| 2 | + |
| 3 | +#if !MIN_VERSION_trace_dispatcher(2,13,0) |
| 4 | +{-# LANGUAGE PackageImports #-} |
| 5 | +#endif |
| 6 | + |
1 | 7 | module Main(main) where |
2 | 8 |
|
3 | 9 | import Cardano.Logging |
@@ -42,6 +48,12 @@ import qualified System.Metrics as EKG |
42 | 48 |
|
43 | 49 | import Streaming |
44 | 50 |
|
| 51 | +#if !MIN_VERSION_trace_dispatcher(2,13,0) && !MIN_VERSION_contra_tracer(0,2,0) |
| 52 | +import "contra-tracer" Control.Tracer (Tracer(..)) |
| 53 | +#elif !MIN_VERSION_trace_dispatcher(2,13,0) && MIN_VERSION_contra_tracer(0,2,0) |
| 54 | +import "contra-tracer" Control.Tracer (mkTracer) |
| 55 | +#endif |
| 56 | + |
45 | 57 |
|
46 | 58 | check :: OnMissingKey -> Bool -> Word -> Trace IO App.TraceMessage -> Formula TemporalEvent Text -> [TemporalEvent] -> IO () |
47 | 59 | check omk greppable idx {- Formula index -} tr phi events = |
@@ -117,7 +129,15 @@ setupTraceDispatcher optTraceDispatcherConfigFile = do |
117 | 129 | configureTracers configReflection cfg [tr] |
118 | 130 | configureTracers configReflection cfg [prometheusSimpleTr] |
119 | 131 | for_ (prometheusSimple cfg) $ \ps -> do |
120 | | - runPrometheusSimple (mkTracer (traceWith prometheusSimpleTr)) ekgStore ps >>= link |
| 132 | + let |
| 133 | + |
| 134 | +#if !MIN_VERSION_contra_tracer(0,2,0) |
| 135 | + t = Tracer (traceWith prometheusSimpleTr) |
| 136 | +#else |
| 137 | + t = mkTracer (traceWith prometheusSimpleTr) |
| 138 | +#endif |
| 139 | + |
| 140 | + runPrometheusSimple t ekgStore ps >>= link |
121 | 141 | pure tr |
122 | 142 | where |
123 | 143 | defaultTraceConfig :: TraceConfig |
|
0 commit comments