This version can be pinned in stack with:hs-opentelemetry-instrumentation-gogol-1.0.0.0@sha256:1823fec3bb61650a65db3534ca83d5fc20f8463552757ce39381ab32bcb053aa,2009
OpenTelemetry instrumentation for the Gogol Google Cloud SDK.
Usage
Gogol does not have a hooks/middleware API, so instrumentation is provided as
wrapper functions. Replace send with tracedSend (or sendEither with
tracedSendEither):
import Gogol
import OpenTelemetry.Instrumentation.Gogol (tracedSend)
main :: IO ()
main = do
tracer <- ...
env <- newEnv
runResourceT . runGoogle env $ do
-- Instead of: send (newObjectsGet bucket object)
result <- tracedSend tracer send (newObjectsGet bucket object)
...
Attributes
Each span includes:
Attribute
Example
rpc.system
gcp-api
rpc.service
storage
rpc.method
ObjectsGet
server.address
storage.googleapis.com
cloud.provider
gcp
error.type
(on failure)
http.response.status_code
(on failure)
Design
Because Gogol runs in a Google monad (essentially ReaderT (Env s) (ResourceT IO))
without hook points, the wrappers take the send function as a parameter. This
avoids depending on the full gogol package (only gogol-core) and works with
any send-like function.
Changes
Changelog for hs-opentelemetry-instrumentation-gogol
1.0.0.0 - 2026-05-29
Promoted to 1.0.0.0 for the hs-opentelemetry 1.0 release.
0.1.0.0
Initial release
tracedSend and tracedSendEither wrappers for Gogol API calls