packages feed

kiroku-metrics-0.1.0.0: kiroku-metrics.cabal

cabal-version:   3.0
name:            kiroku-metrics
version:         0.1.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
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

library
  import:          common
  exposed-modules:
    Kiroku.Metrics
    Kiroku.Metrics.Collector
    Kiroku.Metrics.Config
    Kiroku.Metrics.Health
    Kiroku.Metrics.JSON
    Kiroku.Metrics.Prometheus
    Kiroku.Metrics.Server
    Kiroku.Metrics.Subscriptions
    Kiroku.Metrics.Types
    Kiroku.Metrics.WebSocket

  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
    , hasql           >=1.10 && <1.11
    , hasql-pool      >=1.2  && <1.5
    , http-types      >=0.12 && <0.13
    , kiroku-cli      ^>=0.1
    , kiroku-store    ^>=0.2
    , 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

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.2
    , kiroku-test-support
    , 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
  main-is:        Main.hs
  other-modules:
    Test.CollectorSpec
    Test.IntegrationSpec
    Test.ServerSpec
    Test.SubscriptionsSpec
    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
    , containers           >=0.6  && <0.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.1
    , kiroku-metrics
    , kiroku-store         ^>=0.2
    , kiroku-test-support
    , lens                 >=5.2  && <5.4
    , scientific           >=0.3  && <0.4
    , stm                  >=2.5  && <2.6
    , text                 >=2.0  && <2.2
    , uuid                 >=1.3  && <1.4
    , warp                 >=3.4  && <3.5
    , websockets           >=0.13 && <0.14