hs-opentelemetry-instrumentation-amazonka: OpenTelemetry instrumentation for the Amazonka AWS SDK

[ aws, bsd3, library, monitoring, observability, opentelemetry, telemetry ] [ Propose Tags ] [ Report a vulnerability ]

Automatic tracing for Amazonka AWS SDK calls via the hooks API. Creates spans per AWS API call with semantic convention attributes (rpc.system, rpc.service, rpc.method, aws.request_id, etc.).


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0
Change log ChangeLog.md
Dependencies amazonka (>=2.0 && <2.1), amazonka-core (>=2.0 && <2.1), base (>=4.7 && <5), bytestring, case-insensitive, hs-opentelemetry-api (>=1.0 && <1.1), hs-opentelemetry-semantic-conventions (>=1.40 && <2), http-client, http-types, text, unordered-containers [details]
License BSD-3-Clause
Copyright 2024 Ian Duncan, Mercury Technologies
Author Ian Duncan, Jade Lovelace
Maintainer ian@iankduncan.com
Uploaded by IanDuncan at 2026-05-29T14:41:38Z
Category OpenTelemetry, Telemetry, Monitoring, Observability, AWS
Home page https://github.com/iand675/hs-opentelemetry#readme
Bug tracker https://github.com/iand675/hs-opentelemetry/issues
Source repo head: git clone https://github.com/iand675/hs-opentelemetry
Distributions
Downloads 2 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hs-opentelemetry-instrumentation-amazonka-1.0.0.0

[back to package description]

hs-opentelemetry-instrumentation-amazonka

hs-opentelemetry-instrumentation-amazonka

OpenTelemetry instrumentation for the Amazonka AWS SDK.

GHC Compatibility

This package requires amazonka >= 2.0. As of April 2026, the published amazonka-2.0 on Hackage does not compile with GHC 9.10+ due to DuplicateRecordFields changes in generated service packages (amazonka-sts, amazonka-sso). You may need to use amazonka from its GitHub main branch or wait for the next Hackage release.

Usage

import Amazonka
import OpenTelemetry.Instrumentation.Amazonka (instrumentEnv)
import OpenTelemetry.Trace (getTracerProvider, makeTracer, tracerOptions)

main :: IO ()
main = do
  tp <- getTracerProvider
  let tracer = makeTracer tp "my-app" tracerOptions
  env <- newEnv discover
  let tracedEnv = instrumentEnv tracer env
  -- All send calls through tracedEnv will create OTel spans
  runResourceT $ send tracedEnv someRequest

Attributes

Per the OTel AWS SDK semantic conventions:

Attribute Description
rpc.system Always "aws-api"
rpc.service AWS service abbreviation (e.g., "S3", "DynamoDB")
rpc.method AWS operation name (e.g., "GetObject", "PutItem")
aws.request_id From response headers when available
http.response.status_code HTTP status code
server.address AWS endpoint host
cloud.region AWS region