packages feed

hs-opentelemetry-instrumentation-ghc-metrics-1.0.0.0: hs-opentelemetry-instrumentation-ghc-metrics.cabal

cabal-version: 2.4
name:          hs-opentelemetry-instrumentation-ghc-metrics
version:       1.0.0.0
synopsis:      OpenTelemetry metrics for the GHC runtime (RTS statistics)
description:
  Registers observable instruments that report GHC RTS statistics as OpenTelemetry
  metrics.  Requires the program to be run with @+RTS -T@ (or @-t@, @-s@, etc.)
  so that 'GHC.Stats.getRTSStats' is enabled.
  .
  Metric names follow the @process.runtime.ghc.*@ namespace convention.

category:      OpenTelemetry, Telemetry, Monitoring, Observability
homepage:      https://github.com/iand675/hs-opentelemetry#readme
bug-reports:   https://github.com/iand675/hs-opentelemetry/issues
author:        Ian Duncan
maintainer:    ian@iankduncan.com
copyright:     2024-2026 Ian Duncan, Mercury Technologies
license:       BSD-3-Clause
license-file:  LICENSE
build-type:    Simple
extra-doc-files: ChangeLog.md

source-repository head
  type:     git
  location: https://github.com/iand675/hs-opentelemetry

library
  exposed-modules:
    OpenTelemetry.Instrumentation.GHCMetrics
    OpenTelemetry.Instrumentation.ProcessMetrics
  hs-source-dirs:   src
  default-language:  Haskell2010
  default-extensions:
    OverloadedStrings
  ghc-options:       -Wall
  build-depends:
      base >= 4.16 && < 5
    , hs-opentelemetry-api ^>= 1.0
    , hs-opentelemetry-semantic-conventions >= 1.40 && < 2
    , text

  if os(darwin)
    c-sources: cbits/process_metrics.c
    frameworks: CoreFoundation

  if os(linux)
    build-depends:
        bytestring
      , directory

test-suite hs-opentelemetry-instrumentation-ghc-metrics-test
  type:             exitcode-stdio-1.0
  main-is:          Spec.hs
  hs-source-dirs:   test
  default-language:  Haskell2010
  default-extensions:
    OverloadedStrings
  ghc-options:       -threaded -rtsopts "-with-rtsopts=-T -N"
  build-depends:
      base >= 4.16 && < 5
    , hs-opentelemetry-api ^>= 1.0
    , hs-opentelemetry-exporter-in-memory ^>= 1.0
    , hs-opentelemetry-instrumentation-ghc-metrics ^>= 1.0
    , hs-opentelemetry-sdk ^>= 1.0
    , hspec >= 2.0
    , text
    , vector