From ebd7ab0fe8638bd7c74ba2109ff45217902886ca Mon Sep 17 00:00:00 2001 From: Kazuki Okamoto Date: Mon, 18 Dec 2023 03:10:22 +0900 Subject: [PATCH] Otel for HDBC and HDBC MySQL --- cabal.project | 9 + docker-compose.yaml | 8 + examples/hdbc-mysql/hdbc-mysql-example.cabal | 65 ++++++ examples/hdbc-mysql/main.hs | 37 ++++ hie.yaml | 9 + ...telemetry-instrumentation-HDBC-mysql.cabal | 64 ++++++ .../Instrumentation/HDBC/MySQL.hs | 52 +++++ ...s-opentelemetry-instrumentation-HDBC.cabal | 64 ++++++ .../src/OpenTelemetry/Instrumentation/HDBC.hs | 193 ++++++++++++++++++ stack-ghc-8.10.yaml | 5 + stack-ghc-8.10.yaml.lock | 65 +++--- stack-ghc-9.2.yaml | 5 + stack-ghc-9.2.yaml.lock | 11 + stack.yaml | 5 + stack.yaml.lock | 11 + 15 files changed, 576 insertions(+), 27 deletions(-) create mode 100644 examples/hdbc-mysql/hdbc-mysql-example.cabal create mode 100644 examples/hdbc-mysql/main.hs create mode 100644 instrumentation/hdbc-mysql/hs-opentelemetry-instrumentation-HDBC-mysql.cabal create mode 100644 instrumentation/hdbc-mysql/src/OpenTelemetry/Instrumentation/HDBC/MySQL.hs create mode 100644 instrumentation/hdbc/hs-opentelemetry-instrumentation-HDBC.cabal create mode 100644 instrumentation/hdbc/src/OpenTelemetry/Instrumentation/HDBC.hs diff --git a/cabal.project b/cabal.project index bc1404ca..30ebd578 100644 --- a/cabal.project +++ b/cabal.project @@ -12,6 +12,8 @@ packages: , instrumentation/cloudflare , instrumentation/conduit , instrumentation/grpc-haskell + , instrumentation/hdbc + , instrumentation/hdbc-mysql , instrumentation/hedis , instrumentation/herp-logger-datadog , instrumentation/hspec @@ -22,6 +24,7 @@ packages: , instrumentation/wai , instrumentation/yesod , examples/grpc-echo + , examples/hdbc-mysql , examples/http-server , examples/yesod-minimal , examples/yesod-subsite @@ -41,6 +44,12 @@ source-repository-package subdir: . core -- HEAD of master at 2023-06-09 +source-repository-package + type: git + location: https://github.com/ryantm/hdbc-mysql + tag: 80f8077b29ee27bce4141b385a8b28f42cbbbe46 + -- master at 2023-12-19 + source-repository-package type: git location: https://github.com/herp-inc/herp-logger diff --git a/docker-compose.yaml b/docker-compose.yaml index aa81cb34..e5d73bba 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,3 +16,11 @@ services: - POSTGRES_PASSWORD=password ports: - "5432:5432" + + mysql: + image: mysql + environment: + - MYSQL_ALLOW_EMPTY_PASSWORD=yes + - MYSQL_DATABASE=test + ports: + - "3306:3306" diff --git a/examples/hdbc-mysql/hdbc-mysql-example.cabal b/examples/hdbc-mysql/hdbc-mysql-example.cabal new file mode 100644 index 00000000..b2fd1891 --- /dev/null +++ b/examples/hdbc-mysql/hdbc-mysql-example.cabal @@ -0,0 +1,65 @@ +cabal-version: 2.4 + +name: hdbc-mysql-example +version: 0.0.0.0 +author: Kazuki Okamoto (岡本和樹) +maintainer: kazuki.okamoto@herp.co.jp + +common common + build-depends: base >= 4 && < 5 + ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wcompat + default-language: Haskell2010 + +executable hdbc-mysql-example + import: common + hs-source-dirs: . + main-is: main.hs + build-depends: hs-opentelemetry-sdk, + hs-opentelemetry-instrumentation-HDBC-mysql, + HDBC, + ghc-options: -threaded + -with-rtsopts=-N + -Wno-name-shadowing + if impl(ghc >= 6.4) + ghc-options: -Wincomplete-record-updates + if impl(ghc >= 6.8) + ghc-options: -Wmonomorphism-restriction + if impl(ghc >= 7.0) + ghc-options: -Wmissing-import-lists + if impl(ghc >= 7.2) + ghc-options: -Wincomplete-uni-patterns + -Widentities + if impl(ghc >= 8.0) + ghc-options: -Wmissing-exported-signatures + -Wredundant-constraints + if impl(ghc >= 8.2) + ghc-options: -Wmissing-home-modules + if impl(ghc >= 8.4) + ghc-options: -Wmissing-export-lists + -Wpartial-fields + if impl(ghc >= 8.8) + ghc-options: -Wmissing-deriving-strategies + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock + if impl(ghc >= 9.2) + ghc-options: -Wambiguous-fields + -Wmissing-kind-signatures + -Woperator-whitespace + -Wredundant-bang-patterns + if impl(ghc >= 9.4) + ghc-options: -Wredundant-strictness-flags + -Wforall-identifier + -Woperator-whitespace-ext-conflict + if impl(ghc >= 9.4.1) + ghc-options: -Wgadt-mono-local-binds + -Wtype-equality-out-of-scope + -Wtype-equality-requires-operators + if impl(ghc >= 9.6.1) + -- ghc-options: -Wloopy-superclass-solve + -- Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/24071 + if impl(ghc >= 9.8.1) + ghc-options: -Wincomplete-export-warnings diff --git a/examples/hdbc-mysql/main.hs b/examples/hdbc-mysql/main.hs new file mode 100644 index 00000000..57e5b12e --- /dev/null +++ b/examples/hdbc-mysql/main.hs @@ -0,0 +1,37 @@ +{-# LANGUAGE OverloadedStrings #-} + +import Control.Exception (bracket) +import Control.Monad (void) +import Database.HDBC (commit, disconnect, run) +import OpenTelemetry.Instrumentation.HDBC.MySQL (connectMySQL, defaultMySQLConnectInfo) +import OpenTelemetry.Trace ( + defaultSpanArguments, + inSpan, + initializeTracerProvider, + makeTracer, + shutdownTracerProvider, + tracerOptions, + ) +import System.IO (hFlush, stdout) + + +main :: IO () +main = do + bracket + initializeTracerProvider + shutdownTracerProvider + $ \tracerProvider -> do + bracket + (connectMySQL tracerProvider mempty defaultMySQLConnectInfo) + disconnect + $ \connection -> do + let tracer = makeTracer tracerProvider "hdbc-mysql-example" tracerOptions + inSpan tracer "create" defaultSpanArguments $ do + void $ run connection "CREATE TABLE test (id INTEGER PRIMARY KEY)" [] + commit connection + inSpan tracer "drop" defaultSpanArguments $ do + void $ run connection "DROP TABLE test" [] + commit connection + putStr "Press enter to exit after while..." + hFlush stdout + void $ getLine -- wait for transporting spans diff --git a/hie.yaml b/hie.yaml index e240c010..81f710ab 100644 --- a/hie.yaml +++ b/hie.yaml @@ -35,6 +35,9 @@ cradle: - path: "examples/grpc-echo/gen" component: "lib:grpc-echo-example" + - path: "examples/hdbc-mysql/main.hs" + component: "hdbc-mysql-example:exe:hdbc-mysql-example" + - path: "examples/yesod-minimal/src" component: "lib:yesod-minimal" @@ -86,6 +89,12 @@ cradle: - path: "instrumentation/grpc-haskell/src" component: "lib:hs-opentelemetry-instrumentation-grpc-haskell" + - path: "instrumentation/hdbc/src" + component: "lib:hs-opentelemetry-instrumentation-HDBC" + + - path: "instrumentation/hdbc-mysql/src" + component: "lib:hs-opentelemetry-instrumentation-HDBC-MySQL" + - path: "instrumentation/hedis/src" component: "lib:hs-opentelemetry-instrumentation-hedis" diff --git a/instrumentation/hdbc-mysql/hs-opentelemetry-instrumentation-HDBC-mysql.cabal b/instrumentation/hdbc-mysql/hs-opentelemetry-instrumentation-HDBC-mysql.cabal new file mode 100644 index 00000000..bc619572 --- /dev/null +++ b/instrumentation/hdbc-mysql/hs-opentelemetry-instrumentation-HDBC-mysql.cabal @@ -0,0 +1,64 @@ +cabal-version: 2.4 + +name: hs-opentelemetry-instrumentation-HDBC-mysql +version: 0.0.0.0 +author: Kazuki Okamoto (岡本和樹) +maintainer: kazuki.okamoto@herp.co.jp + +common common + build-depends: base >= 4 && < 5 + ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wcompat + default-language: Haskell2010 + +library + import: common + hs-source-dirs: src + exposed-modules: OpenTelemetry.Instrumentation.HDBC.MySQL + build-depends: hs-opentelemetry-api, + hs-opentelemetry-instrumentation-HDBC, + HDBC-mysql, + text, + ghc-options: -Wno-name-shadowing + if impl(ghc >= 6.4) + ghc-options: -Wincomplete-record-updates + if impl(ghc >= 6.8) + ghc-options: -Wmonomorphism-restriction + if impl(ghc >= 7.0) + ghc-options: -Wmissing-import-lists + if impl(ghc >= 7.2) + ghc-options: -Wincomplete-uni-patterns + -Widentities + if impl(ghc >= 8.0) + ghc-options: -Wmissing-exported-signatures + -Wredundant-constraints + if impl(ghc >= 8.2) + ghc-options: -Wmissing-home-modules + if impl(ghc >= 8.4) + ghc-options: -Wmissing-export-lists + -Wpartial-fields + if impl(ghc >= 8.8) + ghc-options: -Wmissing-deriving-strategies + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock + if impl(ghc >= 9.2) + ghc-options: -Wambiguous-fields + -Wmissing-kind-signatures + -Woperator-whitespace + -Wredundant-bang-patterns + if impl(ghc >= 9.4) + ghc-options: -Wredundant-strictness-flags + -Wforall-identifier + -Woperator-whitespace-ext-conflict + if impl(ghc >= 9.4.1) + ghc-options: -Wgadt-mono-local-binds + -Wtype-equality-out-of-scope + -Wtype-equality-requires-operators + if impl(ghc >= 9.6.1) + -- ghc-options: -Wloopy-superclass-solve + -- Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/24071 + if impl(ghc >= 9.8.1) + ghc-options: -Wincomplete-export-warnings diff --git a/instrumentation/hdbc-mysql/src/OpenTelemetry/Instrumentation/HDBC/MySQL.hs b/instrumentation/hdbc-mysql/src/OpenTelemetry/Instrumentation/HDBC/MySQL.hs new file mode 100644 index 00000000..b6c6645f --- /dev/null +++ b/instrumentation/hdbc-mysql/src/OpenTelemetry/Instrumentation/HDBC/MySQL.hs @@ -0,0 +1,52 @@ +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} + +module OpenTelemetry.Instrumentation.HDBC.MySQL ( + Orig.MySQLConnectInfo (..), + Otel.Connection, + connectMySQL, + Orig.defaultMySQLConnectInfo, + Orig.withRTSSignalsBlocked, +) where + +import qualified Data.Text as Text +import qualified Database.HDBC.MySQL as Orig +import qualified OpenTelemetry.Attribute as Attr +import qualified OpenTelemetry.Attribute.Attributes as Attr +import qualified OpenTelemetry.Attribute.Key as Attr +import qualified OpenTelemetry.Instrumentation.HDBC as Otel +import qualified OpenTelemetry.Trace.Core as Otel + + +connectMySQL :: Otel.TracerProvider -> Attr.Attributes -> Orig.MySQLConnectInfo -> IO Otel.Connection +connectMySQL + tracerProvider + extraAttributes + connectInfo@Orig.MySQLConnectInfo + { Orig.mysqlHost + , Orig.mysqlUser + , Orig.mysqlDatabase + , Orig.mysqlPort + , Orig.mysqlUnixSocket + } = do + connection <- Orig.connectMySQL connectInfo + let port :: Maybe Word + transport :: Text.Text + (port, transport) = + if null mysqlUnixSocket + then (Just $ fromIntegral mysqlPort, "tcp") + else (Nothing, "unix") + attributes = + Otel.Attributes + { Otel.db_connectionString = Nothing + , Otel.db_system = "mysql" + , Otel.db_user = Just $ Text.pack mysqlUser + , Otel.network_peer_address = Just $ Text.pack mysqlHost + , Otel.network_peer_port = port + , Otel.network_transport = Just transport + , Otel.network_type = Nothing + , Otel.server_address = Just $ Text.pack mysqlHost + , Otel.server_port = port + } + extraAttributes' = Attr.insert Attr.db_name (Text.pack mysqlDatabase) extraAttributes + pure $ Otel.makeConnection connection tracerProvider attributes extraAttributes' diff --git a/instrumentation/hdbc/hs-opentelemetry-instrumentation-HDBC.cabal b/instrumentation/hdbc/hs-opentelemetry-instrumentation-HDBC.cabal new file mode 100644 index 00000000..58b5e53c --- /dev/null +++ b/instrumentation/hdbc/hs-opentelemetry-instrumentation-HDBC.cabal @@ -0,0 +1,64 @@ +cabal-version: 2.4 + +name: hs-opentelemetry-instrumentation-HDBC +version: 0.0.0.0 +author: Kazuki Okamoto (岡本和樹) +maintainer: kazuki.okamoto@herp.co.jp + +common common + build-depends: base >= 4 && < 5 + ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wcompat + default-language: Haskell2010 + +library + import: common + hs-source-dirs: src + exposed-modules: OpenTelemetry.Instrumentation.HDBC + build-depends: hs-opentelemetry-api, + HDBC, + data-default-class, + text + ghc-options: -Wno-name-shadowing + if impl(ghc >= 6.4) + ghc-options: -Wincomplete-record-updates + if impl(ghc >= 6.8) + ghc-options: -Wmonomorphism-restriction + if impl(ghc >= 7.0) + ghc-options: -Wmissing-import-lists + if impl(ghc >= 7.2) + ghc-options: -Wincomplete-uni-patterns + -Widentities + if impl(ghc >= 8.0) + ghc-options: -Wmissing-exported-signatures + -Wredundant-constraints + if impl(ghc >= 8.2) + ghc-options: -Wmissing-home-modules + if impl(ghc >= 8.4) + ghc-options: -Wmissing-export-lists + -Wpartial-fields + if impl(ghc >= 8.8) + ghc-options: -Wmissing-deriving-strategies + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock + if impl(ghc >= 9.2) + ghc-options: -Wambiguous-fields + -Wmissing-kind-signatures + -Woperator-whitespace + -Wredundant-bang-patterns + if impl(ghc >= 9.4) + ghc-options: -Wredundant-strictness-flags + -Wforall-identifier + -Woperator-whitespace-ext-conflict + if impl(ghc >= 9.4.1) + ghc-options: -Wgadt-mono-local-binds + -Wtype-equality-out-of-scope + -Wtype-equality-requires-operators + if impl(ghc >= 9.6.1) + -- ghc-options: -Wloopy-superclass-solve + -- Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/24071 + if impl(ghc >= 9.8.1) + ghc-options: -Wincomplete-export-warnings diff --git a/instrumentation/hdbc/src/OpenTelemetry/Instrumentation/HDBC.hs b/instrumentation/hdbc/src/OpenTelemetry/Instrumentation/HDBC.hs new file mode 100644 index 00000000..ecdff597 --- /dev/null +++ b/instrumentation/hdbc/src/OpenTelemetry/Instrumentation/HDBC.hs @@ -0,0 +1,193 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE StandaloneKindSignatures #-} + +module OpenTelemetry.Instrumentation.HDBC ( + Connection (..), + Attributes (..), + makeConnection, +) where + +import Data.Default.Class (def) +import Data.Function ((&)) +import Data.Kind (Type) +import Data.Text (Text) +import qualified Data.Text as Text +import Database.HDBC ( + ConnWrapper (ConnWrapper), + IConnection ( + clone, + commit, + dbServerVer, + dbTransactionSupport, + describeTable, + disconnect, + getTables, + hdbcClientVer, + hdbcDriverName, + prepare, + proxiedClientName, + proxiedClientVer, + rollback, + run + ), + ) +import GHC.Generics (Generic) +import GHC.Stack (withFrozenCallStack) +import qualified OpenTelemetry.Attribute as Attr +import qualified OpenTelemetry.Attribute.Attributes as Attr +import qualified OpenTelemetry.Attribute.Key as Attr +import qualified OpenTelemetry.Trace.Core as Otel + + +type Connection :: Type +data Connection = Connection + { original :: ConnWrapper + , tracer :: Otel.Tracer + , attributes :: Attr.Attributes + } + + +-- | Specification: https://opentelemetry.io/docs/specs/semconv/database/database-spans/ +type Attributes :: Type +data Attributes = Attributes + { db_connectionString :: Maybe Text + , db_system :: Text + , db_user :: Maybe Text + , network_peer_address :: Maybe Text + , network_peer_port :: Maybe Word + , network_transport :: Maybe Text + , network_type :: Maybe Text + , server_address :: Maybe Text + , server_port :: Maybe Word + } + deriving stock (Show, Read, Eq, Ord, Generic) + + +makeConnection :: + IConnection connection => + -- | Original connection + connection -> + Otel.TracerProvider -> + Attributes -> + -- | Extra attributes + Attr.Attributes -> + Connection +makeConnection original provider attributes extraAttributes = + Connection + { original = ConnWrapper original + , tracer = Otel.makeTracer provider "hs-opentelemetry-instrumentation-hdbc" Otel.tracerOptions + , attributes = Attr.union (convertAttributes attributes) extraAttributes + } + + +convertAttributes :: Attributes -> Attr.Attributes +convertAttributes + Attributes + { db_connectionString + , db_system + , db_user + , network_peer_address + , network_peer_port + , network_transport + , network_type + , server_address + , server_port + } = + Attr.empty + & insert Attr.db_connectionString db_connectionString + & insert Attr.db_system (Just db_system) + & insert Attr.db_user db_user + & insert Attr.network_peer_address network_peer_address + & insert Attr.network_peer_port (fromIntegral <$> network_peer_port) + & insert Attr.network_transport network_transport + & insert Attr.network_type network_type + & insert Attr.server_address server_address + & insert Attr.server_port (fromIntegral <$> server_port) + where + insert :: + Attr.IsAttribute a => + Attr.Key a -> + Maybe a -> + Attr.Attributes -> + Attr.Attributes + insert _ Nothing = id + insert key (Just value) = Attr.insert key value + + +instance IConnection Connection where + disconnect Connection {original, tracer, attributes} = + withFrozenCallStack $ + Otel.inSpan tracer "disconnect" (defaultSpanArguments attributes) $ + disconnect original + + + commit Connection {original, tracer, attributes} = + withFrozenCallStack $ + Otel.inSpan tracer "commit" (defaultSpanArguments attributes) $ + commit original + + + rollback Connection {original, tracer, attributes} = + withFrozenCallStack $ + Otel.inSpan tracer "rollback" (defaultSpanArguments attributes) $ + rollback original + + + run Connection {original, tracer, attributes} query params = + withFrozenCallStack $ do + let attributes' = Attr.insert Attr.db_statement (Text.pack query) attributes + Otel.inSpan tracer "run" (defaultSpanArguments attributes') $ + run original query params + + + prepare Connection {original, tracer, attributes} query = + withFrozenCallStack $ do + let attributes' = Attr.insert Attr.db_statement (Text.pack query) attributes + Otel.inSpan tracer "prepare" (defaultSpanArguments attributes') $ + prepare original query + + + clone Connection {original, tracer, attributes} = + withFrozenCallStack $ + Otel.inSpan tracer "clone" (defaultSpanArguments attributes) $ do + conn <- clone original + pure $ Connection {original = conn, tracer, attributes} + + + hdbcDriverName Connection {original} = withFrozenCallStack $ hdbcDriverName original + + + hdbcClientVer Connection {original} = withFrozenCallStack $ hdbcClientVer original + + + proxiedClientName Connection {original} = withFrozenCallStack $ proxiedClientName original + + + proxiedClientVer Connection {original} = withFrozenCallStack $ proxiedClientVer original + + + dbServerVer Connection {original} = withFrozenCallStack $ dbServerVer original + + + dbTransactionSupport Connection {original} = withFrozenCallStack $ dbTransactionSupport original + + + getTables Connection {original, tracer, attributes} = + withFrozenCallStack $ do + Otel.inSpan tracer "getTables" (defaultSpanArguments attributes) $ + getTables original + + + describeTable Connection {original, tracer, attributes} tableName = + withFrozenCallStack $ do + let attributes' = Attr.insert Attr.db_sql_table (Text.pack tableName) attributes + Otel.inSpan tracer "describeTable" (defaultSpanArguments attributes') $ + describeTable original tableName + + +defaultSpanArguments :: Attr.Attributes -> Otel.SpanArguments +defaultSpanArguments attributes = + def {Otel.kind = Otel.Client, Otel.attributes = attributes} diff --git a/stack-ghc-8.10.yaml b/stack-ghc-8.10.yaml index 6d2dd45c..4f528246 100644 --- a/stack-ghc-8.10.yaml +++ b/stack-ghc-8.10.yaml @@ -16,6 +16,8 @@ packages: - instrumentation/conduit - instrumentation/cloudflare # - instrumentation/grpc-haskell # able to be built with cabal +- instrumentation/hdbc +- instrumentation/hdbc-mysql - instrumentation/hedis # - instrumentation/herp-logger-datadog - instrumentation/hspec @@ -25,6 +27,7 @@ packages: - instrumentation/postgresql-simple - instrumentation/yesod - instrumentation/wai +- examples/hdbc-mysql - examples/http-server - examples/yesod-minimal - examples/yesod-subsite @@ -42,6 +45,8 @@ extra-deps: - proto-lens-runtime-0.7.0.1@sha256:703f327422b2e204f8ea13c5e178edd8ab42ccd01c7a5a89fcb1b37ab474c68a,3038 - thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 - thread-utils-finalizers-0.1.0.0@sha256:a8435240bfc0ae96c94704d2986699a11a395c496f9a7f2e5f5d729a0b967549,1381 +- github: ryantm/hdbc-mysql + commit: 80f8077b29ee27bce4141b385a8b28f42cbbbe46 # HEAD of master at 2023-12-19 nix: enable: true diff --git a/stack-ghc-8.10.yaml.lock b/stack-ghc-8.10.yaml.lock index 262d77c9..15b14520 100644 --- a/stack-ghc-8.10.yaml.lock +++ b/stack-ghc-8.10.yaml.lock @@ -5,19 +5,33 @@ packages: - completed: - hackage: thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 + hackage: hspec-2.11.7@sha256:2869580a2a29e7beb6268ea3dc561583f4ae229ed1f47fb1c92e8c09ce35acec,1763 pantry-tree: - size: 450 - sha256: 605ea068880ad39c96fce0d91db9f2d54553ed43dfc41c37845fade8be2e9568 + size: 584 + sha256: f241a7710ebee50583f9aebff61aaf4d36619ba7d6538b39b80ee4695c70552e original: - hackage: thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 + hackage: hspec-2.11.7@sha256:2869580a2a29e7beb6268ea3dc561583f4ae229ed1f47fb1c92e8c09ce35acec,1763 - completed: - hackage: thread-utils-finalizers-0.1.0.0@sha256:a8435240bfc0ae96c94704d2986699a11a395c496f9a7f2e5f5d729a0b967549,1381 + hackage: hspec-core-2.11.7@sha256:90d8873356d7e15f843bc523360e206e8e356ff6b82a1fa4b3889dc31d073ea1,6814 pantry-tree: - size: 400 - sha256: 7f708d158d5d0e32ffe77f6375a792ceb6f92e4d8dd8b32fc69e7de962e7e518 + size: 6231 + sha256: 8db12c1f6965d9f0898f04d7b5f1d77682c8ab2d5c394c4a431229df7c4acb14 original: - hackage: thread-utils-finalizers-0.1.0.0@sha256:a8435240bfc0ae96c94704d2986699a11a395c496f9a7f2e5f5d729a0b967549,1381 + hackage: hspec-core-2.11.7@sha256:90d8873356d7e15f843bc523360e206e8e356ff6b82a1fa4b3889dc31d073ea1,6814 +- completed: + hackage: hspec-discover-2.11.7@sha256:6307eb16d308258a99a242025df50217d835ba0a3f205b1202a100a175877b38,2169 + pantry-tree: + size: 829 + sha256: 141b4987d519ad1ca1114737f510f20adc2456bf44c040f41a63792f47d009eb + original: + hackage: hspec-discover-2.11.7@sha256:6307eb16d308258a99a242025df50217d835ba0a3f205b1202a100a175877b38,2169 +- completed: + hackage: hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 + pantry-tree: + size: 741 + sha256: 87681840d430b84686f83f1ab8b5873b09c349775698665233443914acf9ba2b + original: + hackage: hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 - completed: hackage: persistent-2.13.3.0@sha256:89a4a286ec3739d452f67332a03a392aa57c3e97237b61efcd5b99d50aae9cfc,6762 pantry-tree: @@ -47,33 +61,30 @@ packages: original: hackage: proto-lens-runtime-0.7.0.1@sha256:703f327422b2e204f8ea13c5e178edd8ab42ccd01c7a5a89fcb1b37ab474c68a,3038 - completed: - hackage: hspec-2.11.7@sha256:2869580a2a29e7beb6268ea3dc561583f4ae229ed1f47fb1c92e8c09ce35acec,1763 - pantry-tree: - size: 584 - sha256: f241a7710ebee50583f9aebff61aaf4d36619ba7d6538b39b80ee4695c70552e - original: - hackage: hspec-2.11.7@sha256:2869580a2a29e7beb6268ea3dc561583f4ae229ed1f47fb1c92e8c09ce35acec,1763 -- completed: - hackage: hspec-core-2.11.7@sha256:90d8873356d7e15f843bc523360e206e8e356ff6b82a1fa4b3889dc31d073ea1,6814 + hackage: thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 pantry-tree: - size: 6231 - sha256: 8db12c1f6965d9f0898f04d7b5f1d77682c8ab2d5c394c4a431229df7c4acb14 + size: 450 + sha256: 605ea068880ad39c96fce0d91db9f2d54553ed43dfc41c37845fade8be2e9568 original: - hackage: hspec-core-2.11.7@sha256:90d8873356d7e15f843bc523360e206e8e356ff6b82a1fa4b3889dc31d073ea1,6814 + hackage: thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 - completed: - hackage: hspec-discover-2.11.7@sha256:6307eb16d308258a99a242025df50217d835ba0a3f205b1202a100a175877b38,2169 + hackage: thread-utils-finalizers-0.1.0.0@sha256:a8435240bfc0ae96c94704d2986699a11a395c496f9a7f2e5f5d729a0b967549,1381 pantry-tree: - size: 829 - sha256: 141b4987d519ad1ca1114737f510f20adc2456bf44c040f41a63792f47d009eb + size: 400 + sha256: 7f708d158d5d0e32ffe77f6375a792ceb6f92e4d8dd8b32fc69e7de962e7e518 original: - hackage: hspec-discover-2.11.7@sha256:6307eb16d308258a99a242025df50217d835ba0a3f205b1202a100a175877b38,2169 + hackage: thread-utils-finalizers-0.1.0.0@sha256:a8435240bfc0ae96c94704d2986699a11a395c496f9a7f2e5f5d729a0b967549,1381 - completed: - hackage: hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 + size: 29580 + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz + name: HDBC-mysql + version: 1.0.0.0 + sha256: ca7ad707203e14368d09500bcb260902e23b445c1344d12f5911e9a9ea6c9043 pantry-tree: - size: 741 - sha256: 87681840d430b84686f83f1ab8b5873b09c349775698665233443914acf9ba2b + size: 1139 + sha256: fd3e0407e96f5610fee63c076428a03c0caf361f066099444f8b703da421bcb1 original: - hackage: hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz snapshots: - completed: size: 586106 diff --git a/stack-ghc-9.2.yaml b/stack-ghc-9.2.yaml index 51bebf74..4618b83a 100644 --- a/stack-ghc-9.2.yaml +++ b/stack-ghc-9.2.yaml @@ -16,6 +16,8 @@ packages: - instrumentation/conduit - instrumentation/cloudflare # - instrumentation/grpc-haskell # able to be built with cabal +- instrumentation/hdbc +- instrumentation/hdbc-mysql - instrumentation/hedis # - instrumentation/herp-logger-datadog - instrumentation/hspec @@ -25,6 +27,7 @@ packages: - instrumentation/postgresql-simple - instrumentation/yesod - instrumentation/wai +- examples/hdbc-mysql - examples/http-server - examples/yesod-minimal - examples/yesod-subsite @@ -38,6 +41,8 @@ extra-deps: - hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 - thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 - thread-utils-finalizers-0.1.1.0@sha256:24944b71d9f1d01695a5908b4a3b44838fab870883114a323336d537995e0a5b,1381 +- github: ryantm/hdbc-mysql + commit: 80f8077b29ee27bce4141b385a8b28f42cbbbe46 # HEAD of master at 2023-12-19 nix: enable: true diff --git a/stack-ghc-9.2.yaml.lock b/stack-ghc-9.2.yaml.lock index 5da39897..d45ed144 100644 --- a/stack-ghc-9.2.yaml.lock +++ b/stack-ghc-9.2.yaml.lock @@ -46,6 +46,17 @@ packages: sha256: 8c2c2e2e22c20bf3696ee6f30b50b3a9eeae187a22beb536441eefb0a3f9c549 original: hackage: thread-utils-finalizers-0.1.1.0@sha256:24944b71d9f1d01695a5908b4a3b44838fab870883114a323336d537995e0a5b,1381 +- completed: + size: 29580 + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz + name: HDBC-mysql + version: 1.0.0.0 + sha256: ca7ad707203e14368d09500bcb260902e23b445c1344d12f5911e9a9ea6c9043 + pantry-tree: + size: 1139 + sha256: fd3e0407e96f5610fee63c076428a03c0caf361f066099444f8b703da421bcb1 + original: + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz snapshots: - completed: size: 649106 diff --git a/stack.yaml b/stack.yaml index 1a647041..6badde52 100644 --- a/stack.yaml +++ b/stack.yaml @@ -16,6 +16,8 @@ packages: - instrumentation/conduit - instrumentation/cloudflare # - instrumentation/grpc-haskell # able to be built with cabal +- instrumentation/hdbc +- instrumentation/hdbc-mysql - instrumentation/hedis # - instrumentation/herp-logger-datadog - instrumentation/hspec @@ -25,6 +27,7 @@ packages: - instrumentation/postgresql-simple - instrumentation/yesod - instrumentation/wai +- examples/hdbc-mysql - examples/http-server - examples/yesod-minimal - examples/yesod-subsite @@ -38,6 +41,8 @@ extra-deps: - hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702 - thread-utils-context-0.2.0.0@sha256:7863e568c7a43cd21616342d20484d4c962aaa9710619f104c6fb7ee32273940,1883 - thread-utils-finalizers-0.1.1.0@sha256:24944b71d9f1d01695a5908b4a3b44838fab870883114a323336d537995e0a5b,1381 +- github: ryantm/hdbc-mysql + commit: 80f8077b29ee27bce4141b385a8b28f42cbbbe46 # HEAD of master at 2023-12-19 nix: enable: true diff --git a/stack.yaml.lock b/stack.yaml.lock index 362527ec..c5912d9a 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -46,6 +46,17 @@ packages: sha256: 8c2c2e2e22c20bf3696ee6f30b50b3a9eeae187a22beb536441eefb0a3f9c549 original: hackage: thread-utils-finalizers-0.1.1.0@sha256:24944b71d9f1d01695a5908b4a3b44838fab870883114a323336d537995e0a5b,1381 +- completed: + size: 29580 + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz + name: HDBC-mysql + version: 1.0.0.0 + sha256: ca7ad707203e14368d09500bcb260902e23b445c1344d12f5911e9a9ea6c9043 + pantry-tree: + size: 1139 + sha256: fd3e0407e96f5610fee63c076428a03c0caf361f066099444f8b703da421bcb1 + original: + url: https://github.com/ryantm/hdbc-mysql/archive/80f8077b29ee27bce4141b385a8b28f42cbbbe46.tar.gz snapshots: - completed: size: 617368