packages feed

eventlog-live-0.8.0.0: eventlog-live.cabal

cabal-version: 3.0
name: eventlog-live
version: 0.8.0.0
synopsis: Real-time monitoring for any Haskell application with little to no instrumentation
description: Real-time monitoring for any Haskell application with little to no instrumentation!
license: BSD-3-Clause
license-file: LICENSE
author: Wen Kokke
maintainer: wen@well-typed.com
copyright: (c) 2021-2026 Well-Typed
build-type: Simple
category: Debug, Monitoring, System
extra-doc-files:
  CHANGELOG.md
  README.md

extra-source-files:
  data/config.schema.json
  data/default.yaml

tested-with:
  ghc ==9.2.8 || ==9.4.8 || ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.4

source-repository head
  type: git
  location: https://github.com/well-typed/eventlog-live.git
  subdir: eventlog-live

source-repository this
  type: git
  location: https://github.com/well-typed/eventlog-live.git
  tag: eventlog-live-v0.8.0.0
  subdir: eventlog-live

-- This flag enables the control command server, which is an HTTP endpoint
-- that gets started by eventlog-live-otlp. If +control is set, then
-- eventlog-socket SHOULD also be compiled with +control. If this flag is
-- set at compile-time, the control server can be enabled at runtime.
flag control
  description: Enable control command server.
  default: False
  manual: True

-- 2025-12-09:
-- This flag should enable switching between concurrent-machines and the
-- vendored copy of the packages, as it currently does not easily build.
flag use-concurrent-machines
  description: Use concurrent-machines in place of the vendored copy
  default: False
  manual: True

-- 2026-07-29:
-- This flag should enable switching between hs-opentelemetry-api and the
-- vendored copy of the packages, as only a small subset is needed.
flag use-hs-opentelemetry-api
  description: Use hs-opentelemetry-api in place of the vendored copy
  default: False
  manual: True

-- 2026-04-02:
-- This flag should enable switching the use of eventlog-socket on
-- and off, since it may cause issues with certain versions of GHC.
flag use-eventlog-socket
  description: Use eventlog-socket
  default: False
  manual: True

-- 2025-11-10:
-- This flag should enable switching the use of ghc-debug-stub on
-- and off, since it may cause issues with certain versions of GHC.
-- See https://github.com/well-typed/eventlog-live/issues/88
flag use-ghc-debug-stub
  description: Use ghc-debug-stub
  default: False
  manual: True

-- 2025-11-06:
-- This flag should enable switching between template-haskell and
-- template-haskell-lift, because the latter is not on nixpkgs.
flag use-template-haskell-lift
  description: Use template-haskell-lift in place of template-haskell
  default: False
  manual: False

common language
  ghc-options:
    -Wall
    -Wcompat
    -Widentities
    -Wprepositive-qualified-module
    -Wredundant-constraints
    -Wunticked-promoted-constructors
    -Wunused-packages

  default-language: Haskell2010
  default-extensions:
    BangPatterns
    ConstraintKinds
    DataKinds
    DefaultSignatures
    DeriveFoldable
    DeriveFunctor
    DeriveGeneric
    DeriveLift
    DeriveTraversable
    DerivingStrategies
    DerivingVia
    DuplicateRecordFields
    FlexibleContexts
    FlexibleInstances
    FunctionalDependencies
    GADTs
    GeneralizedNewtypeDeriving
    ImportQualifiedPost
    InstanceSigs
    KindSignatures
    LambdaCase
    MultiParamTypeClasses
    NamedFieldPuns
    NoFieldSelectors
    NumericUnderscores
    OverloadedRecordDot
    PatternSynonyms
    RankNTypes
    RecordWildCards
    ScopedTypeVariables
    StandaloneDeriving
    StandaloneKindSignatures
    TupleSections
    TypeApplications
    TypeFamilies
    TypeOperators
    ViewPatterns

library
  import: language
  hs-source-dirs:
    src-lib

  exposed-modules:
    GHC.Eventlog.Live.Data.Attribute
    GHC.Eventlog.Live.Data.Capability
    GHC.Eventlog.Live.Data.Group
    GHC.Eventlog.Live.Data.HeapProfBreakdown
    GHC.Eventlog.Live.Data.LogRecord
    GHC.Eventlog.Live.Data.Metric
    GHC.Eventlog.Live.Data.Severity
    GHC.Eventlog.Live.Data.Span
    GHC.Eventlog.Live.Data.Thread
    GHC.Eventlog.Live.Logger
    GHC.Eventlog.Live.Machine.Analysis.Capability
    GHC.Eventlog.Live.Machine.Analysis.Heap
    GHC.Eventlog.Live.Machine.Analysis.Log
    GHC.Eventlog.Live.Machine.Analysis.Profile
    GHC.Eventlog.Live.Machine.Analysis.Thread
    GHC.Eventlog.Live.Machine.Core
    GHC.Eventlog.Live.Machine.Decoder
    GHC.Eventlog.Live.Machine.Sink
    GHC.Eventlog.Live.Machine.Source
    GHC.Eventlog.Live.Machine.WithStartTime
    GHC.Eventlog.Live.Options
    GHC.Eventlog.Live.Source
    GHC.Eventlog.Live.Source.Core

  build-depends:
    ansi-terminal >=1.1 && <1.2,
    base >=4.16 && <5,
    bytestring >=0.11 && <0.13,
    clock >=0.8 && <0.9,
    co-log-core >=0.3 && <0.4,
    containers >=0.6 && <0.9,
    dlist >=1.0 && <1.1,
    ghc-events >=0.20 && <0.21,
    ghc-stack-profiler-core >=0.3 && <0.4,
    hashable >=1.4 && <1.6,
    ipedb >=0.2 && <0.3,
    machines >=0.7.4 && <0.8,
    monad-control >=1.0 && <1.1,
    network >=3.2.7 && <3.3,
    optparse-applicative >=0.17 && <0.20,
    stm >=2.5 && <2.6,
    text >=1.2 && <2.2,
    transformers >=0.2 && <0.7,
    unordered-containers >=0.2.20 && <0.3,
    vector >=0.12.2 && <0.14,

  -- 2026-07-17:
  -- This includes a vendored copy of mapAccumM from the base-compat
  -- package version 0.15.0.
  hs-source-dirs:
    vendor/base-compat-0.15.0

  other-modules:
    Data.Traversable.Compat

  -- 2025-12-09:
  -- This configures the build requirements for the vendored copy of
  -- the concurrent-machines package version 0.3.1.5.
  if flag(use-concurrent-machines)
    build-depends: concurrent-machines >=0.1 && <0.4
  else
    ghc-options: -Wno-prepositive-qualified-module
    hs-source-dirs: vendor/concurrent-machines-0.3.1.5/src
    other-modules:
      Data.Machine.Concurrent
      Data.Machine.Concurrent.AsyncStep
      Data.Machine.Concurrent.Buffer
      Data.Machine.Concurrent.Fanout
      Data.Machine.Concurrent.Scatter
      Data.Machine.Concurrent.Tee
      Data.Machine.Concurrent.Wye
      Data.Machine.Regulated

    build-depends:
      async >=2.0.1 && <2.3,
      containers >=0.5 && <0.8,
      lifted-async >=0.10 && <0.12,
      time >=1.4 && <1.16,
      transformers-base >=0.4 && <0.5,

executable eventlog-live-otlp
  import: language
  main-is: eventlog-live-otlp.hs
  hs-source-dirs:
    app

  ghc-options:
    -threaded
    -rtsopts
    -finfo-table-map

  hs-source-dirs:
    src-app

  other-modules:
    GHC.Eventlog.Live.Otlp
    GHC.Eventlog.Live.Otlp.Config
    GHC.Eventlog.Live.Otlp.Config.Default
    GHC.Eventlog.Live.Otlp.Config.Default.Raw
    GHC.Eventlog.Live.Otlp.Config.Types
    GHC.Eventlog.Live.Otlp.Control
    GHC.Eventlog.Live.Otlp.Environment
    GHC.Eventlog.Live.Otlp.Exporter.Core
    GHC.Eventlog.Live.Otlp.Exporter.Logs
    GHC.Eventlog.Live.Otlp.Exporter.Metrics
    GHC.Eventlog.Live.Otlp.Exporter.Profiles
    GHC.Eventlog.Live.Otlp.Exporter.Traces
    GHC.Eventlog.Live.Otlp.Options
    GHC.Eventlog.Live.Otlp.Processor.Common.Core
    GHC.Eventlog.Live.Otlp.Processor.Common.Logs
    GHC.Eventlog.Live.Otlp.Processor.Common.Metrics
    GHC.Eventlog.Live.Otlp.Processor.Common.ProfilesDictionary
    GHC.Eventlog.Live.Otlp.Processor.Common.SymbolTable
    GHC.Eventlog.Live.Otlp.Processor.Common.Traces
    GHC.Eventlog.Live.Otlp.Processor.Heap
    GHC.Eventlog.Live.Otlp.Processor.Logs
    GHC.Eventlog.Live.Otlp.Processor.Profiles
    GHC.Eventlog.Live.Otlp.Processor.Threads
    GHC.Eventlog.Live.Otlp.Stats

  hs-source-dirs:
    src-app-internal

  other-modules:
    GHC.Debug.Stub.Compat
    GHC.Eventlog.Socket.Compat
    Language.Haskell.TH.Lift.Compat
    Options.Applicative.Compat
    Options.Applicative.Extra.Feature
    Paths_eventlog_live
    System.Random.Compat

  autogen-modules: Paths_eventlog_live
  build-depends:
    ansi-terminal >=1.1 && <1.2,
    base >=4.16 && <5,
    bytestring >=0.11 && <0.13,
    case-insensitive >=1.2 && <1.3,
    containers >=0.6 && <0.8,
    data-default >=0.2 && <0.9,
    dlist >=1.0 && <1.1,
    eventlog-live,
    file-embed >=0.0.16 && <0.1,
    ghc-events >=0.20 && <0.21,
    grapesy >=1.0.0 && <1.2,
    hashable >=1.4 && <1.6,
    hs-opentelemetry-otlp >=0.2.0 && <0.3,
    HsYAML >=0.2 && <0.3,
    http-client >=0.7 && <0.8,
    http-client-tls >=0.3 && <0.4,
    http-types >=0.12 && <0.13,
    ipedb >=0.2.0.1 && <0.3,
    lens-family >=2.1.3 && <2.2,
    machines >=0.7.4 && <0.8,
    network-uri >=2.6 && <2.8,
    optparse-applicative >=0.17 && <0.20,
    proto-lens >=0.7.1 && <0.8,
    random >=1.2 && <1.4,
    stm >=2.5 && <2.6,
    strict-list >=0.1 && <0.2,
    table-layout >=1.0 && <1.1,
    text >=1.2 && <2.2,
    transformers >=0.2 && <0.7,
    unordered-containers >=0.2.20 && <0.3,
    vector >=0.11 && <0.14,

  if flag(control)
    build-depends:
      aeson >=2.2 && <2.3,
      binary >=0.8 && <0.9,
      eventlog-socket-control >=0.1.1 && <0.2,
      fast-logger >=3.0 && <3.3,
      http-api-data >=0.6 && <0.7,
      network >=3.2.7 && <3.3,
      servant >=0.20 && <0.21,
      servant-server >=0.20 && <0.21,
      wai >=3.2 && <3.3,
      wai-cors >=0.2 && <0.3,
      wai-extra >=3.1 && <3.2,
      warp >=3.4 && <3.5,

    cpp-options: -DEVENTLOG_LIVE_OTELCOL_FEATURE_CONTROL

  if flag(use-eventlog-socket)
    build-depends: eventlog-socket >=0.1.2 && <0.2
    cpp-options: -DEVENTLOG_LIVE_OTELCOL_USE_EVENTLOG_SOCKET

  if flag(use-ghc-debug-stub)
    build-depends: ghc-debug-stub >=0.1 && <1
    cpp-options: -DEVENTLOG_LIVE_OTELCOL_USE_GHC_DEBUG_STUB

  -- 2026-07-29:
  -- This configures the build requirements for the vendored copy of
  -- the hs-opentelemetry-api package version 1.0.0.0.
  if flag(use-hs-opentelemetry-api)
    build-depends: hs-opentelemetry-api >=1.0.0.0 && <1.1
  else
    hs-source-dirs: vendor/hs-opentelemetry-api-1.0.0.0/src
    other-modules: OpenTelemetry.Baggage

  -- 2025-11-06:
  -- This configures the build requirements for using either template-haskell
  -- or template-haskell-lift.
  if flag(use-template-haskell-lift)
    build-depends: template-haskell-lift >=0.1 && <0.2
    cpp-options: -DEVENTLOG_LIVE_OTELCOL_USE_TEMPLATE_HASKELL_LIFT
  else
    build-depends: template-haskell >=2.2 && <3