packages feed

kiroku-metrics-0.3.0.0: kiroku-metrics.cabal

cabal-version:   3.0
name:            kiroku-metrics
version:         0.3.0.0
synopsis:
  Metrics, health, and event-streaming HTTP endpoints for Kiroku

description:
  HTTP/JSON, Prometheus, and WebSocket endpoints exposing operational metrics for
  a running Kiroku event store, plus a WebSocket channel for streaming events out
  of the store. A sister package to @kiroku-store@; the core library never depends
  on a web framework.

author:          Nadeem Bitar
maintainer:      nadeem@gmail.com
license:         BSD-3-Clause
license-file:    LICENSE
build-type:      Simple
category:        Database, Eventing, Observability
extra-doc-files: CHANGELOG.md
homepage:        https://github.com/shinzui/kiroku
bug-reports:     https://github.com/shinzui/kiroku/issues

source-repository head
  type:     git
  location: https://github.com/shinzui/kiroku.git

common common
  default-language:   GHC2024
  default-extensions:
    DeriveAnyClass
    DerivingStrategies
    DuplicateRecordFields
    LambdaCase
    OverloadedRecordDot
    OverloadedStrings
    RecordWildCards

  ghc-options:        -Wall -Werror=incomplete-patterns

library
  import:          common
  exposed-modules:
    Kiroku.Metrics
    Kiroku.Metrics.Browse
    Kiroku.Metrics.Capabilities
    Kiroku.Metrics.Checkpoints
    Kiroku.Metrics.Collector
    Kiroku.Metrics.Config
    Kiroku.Metrics.Cors
    Kiroku.Metrics.DeadLetters
    Kiroku.Metrics.Health
    Kiroku.Metrics.JSON
    Kiroku.Metrics.Prometheus
    Kiroku.Metrics.Server
    Kiroku.Metrics.Standalone
    Kiroku.Metrics.Subscriptions
    Kiroku.Metrics.Types
    Kiroku.Metrics.WebSocket

  other-modules:   Paths_kiroku_metrics
  autogen-modules: Paths_kiroku_metrics
  build-depends:
    , aeson                 >=2.1       && <2.3
    , async                 >=2.2       && <2.3
    , base                  >=4.18      && <5
    , bytestring            >=0.11      && <0.13
    , containers            >=0.6       && <0.8
    , effectful-core        >=2.6.1     && <2.7  || >=2.7.1.1 && <2.8
    , hasql                 >=1.10      && <1.11
    , hasql-pool            >=1.2       && <1.5
    , http-types            >=0.12      && <0.13
    , kiroku-cli            ^>=0.2.0.10
    , kiroku-store          ^>=0.11.0.0
    , network               >=3.1       && <3.3
    , optparse-applicative  >=0.19      && <0.20
    , stm                   >=2.5       && <2.6
    , text                  >=2.0       && <2.2
    , time                  >=1.12      && <1.15
    , uuid                  >=1.3       && <1.4
    , vector                >=0.13      && <0.14
    , wai                   >=3.2       && <3.3
    , wai-websockets        >=3.0       && <3.1
    , warp                  >=3.4       && <3.5
    , websockets            >=0.13      && <0.14

  hs-source-dirs:  src

executable kiroku-inspect
  import:         common
  main-is:        Main.hs
  hs-source-dirs: app-inspect
  ghc-options:    -threaded -rtsopts -with-rtsopts=-N
  build-depends:
    , base                  >=4.18 && <5
    , kiroku-metrics
    , optparse-applicative  >=0.19 && <0.20
    , text                  >=2.0  && <2.2
    , unix                  >=2.8  && <2.9

flag example
  description:
    Build the self-verifying example executable. Off by default because it
    depends on @kiroku-test-support@/@ephemeral-pg@, which are not published to
    Hackage (so a default build of the released package would fail to resolve
    them) and have no buildable source in the pinned Nix Haskell set. Enable
    with @-fexample@ to run @cabal run kiroku-metrics-example@ in the dev shell.

  default:     False
  manual:      True

executable kiroku-metrics-example
  import:         common
  main-is:        Main.hs
  hs-source-dirs: example
  ghc-options:    -threaded -rtsopts -with-rtsopts=-N

  if !flag(example)
    buildable: False

  build-depends:
    , aeson                >=2.1       && <2.3
    , async                >=2.2       && <2.3
    , base                 >=4.18      && <5
    , bytestring           >=0.11      && <0.13
    , containers           >=0.6       && <0.8
    , http-client          >=0.7       && <0.8
    , http-types           >=0.12      && <0.13
    , kiroku-metrics
    , kiroku-store         ^>=0.11.0.0
    , kiroku-test-support  ^>=0.1
    , lens                 >=5.2       && <5.4
    , scientific           >=0.3       && <0.4
    , stm                  >=2.5       && <2.6
    , text                 >=2.0       && <2.2
    , websockets           >=0.13      && <0.14

test-suite kiroku-metrics-test
  import:             common
  type:               exitcode-stdio-1.0
  build-tool-depends: kiroku-metrics:kiroku-inspect
  main-is:            Main.hs
  other-modules:
    Test.BrowseSpec
    Test.CapabilitiesSpec
    Test.CheckpointsSpec
    Test.CollectorSpec
    Test.CorsSpec
    Test.DeadLettersSpec
    Test.IntegrationSpec
    Test.ServerSpec
    Test.StandaloneSpec
    Test.SubscriptionsSpec
    Test.WebSocketConvergenceSpec
    Test.WebSocketSpec

  hs-source-dirs:     test
  ghc-options:        -threaded -rtsopts -with-rtsopts=-N
  build-depends:
    , aeson                 >=2.1       && <2.3
    , async                 >=2.2       && <2.3
    , base                  >=4.18      && <5
    , bytestring            >=0.11      && <0.13
    , case-insensitive      >=1.2       && <1.3
    , containers            >=0.6       && <0.8
    , directory             >=1.3       && <1.4
    , effectful-core        >=2.6.1     && <2.7  || >=2.7.1.1 && <2.8
    , generic-lens          >=2.2       && <2.4
    , hasql                 >=1.10      && <1.11
    , hasql-pool            >=1.2       && <1.5
    , hspec                 >=2.10      && <2.12
    , http-client           >=0.7       && <0.8
    , http-types            >=0.12      && <0.13
    , kiroku-cli            ^>=0.2.0.10
    , kiroku-metrics
    , kiroku-store          ^>=0.11.0.0
    , kiroku-test-support
    , lens                  >=5.2       && <5.4
    , network               >=3.1       && <3.3
    , optparse-applicative  >=0.19      && <0.20
    , process               >=1.6       && <1.7
    , scientific            >=0.3       && <0.4
    , stm                   >=2.5       && <2.6
    , text                  >=2.0       && <2.2
    , time                  >=1.12      && <1.15
    , unix                  >=2.8       && <2.9
    , uuid                  >=1.3       && <1.4
    , vector                >=0.13      && <0.14
    , wai                   >=3.2       && <3.3
    , warp                  >=3.4       && <3.5
    , websockets            >=0.13      && <0.14

benchmark kiroku-websocket-tail
  import:         common
  type:           exitcode-stdio-1.0
  main-is:        WebSocketTail.hs
  hs-source-dirs: bench
  ghc-options:    -threaded -rtsopts "-with-rtsopts=-N -A32m"
  build-depends:
    , aeson                >=2.1  && <2.3
    , async                >=2.2  && <2.3
    , base                 >=4.18 && <5
    , bytestring           >=0.11 && <0.13
    , kiroku-metrics
    , kiroku-store
    , kiroku-test-support
    , stm                  >=2.5  && <2.6
    , text                 >=2.0  && <2.2
    , time                 >=1.12 && <1.15
    , vector               >=0.13 && <0.14