packages feed

hs-opentelemetry-sdk 0.0.2.0 → 0.0.2.2

raw patch · 11 files changed

+295/−37 lines, 11 filesbinary-added

Files

ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for hs-opentelemetry-sdk +## 0.0.2.1++- Doc enhancements+- `makeTracer` introduced to replace `getTracer`+- Tighten exports. Not likely to cause any breaking changes for existing users.+ ## 0.0.2.0  - Update hs-opentelemetry-api bounds
README.md view
@@ -69,8 +69,8 @@  ### TracerProvider -A `TracerProvider` is key to using OpenTelemetry tracing. It is the data structure responsible-for designating how spans are +A `TracerProvider` is key to using OpenTelemetry tracing. It is the data structure responsible for designating how spans are processed and exported+to external systems.  ## Install Dependencies 
+ docs/img/traces_spans.png view

binary file changed (absent → 92469 bytes)

hs-opentelemetry-sdk.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           hs-opentelemetry-sdk-version:        0.0.2.0+version:        0.0.2.2 synopsis:       OpenTelemetry SDK for use in applications. description:    Please see the README on GitHub at <https://github.com/iand675/hs-opentelemetry/tree/main/sdk#readme> category:       OpenTelemetry, Telemetry, Monitoring, Observability, Metrics@@ -20,6 +20,8 @@ extra-source-files:     README.md     ChangeLog.md+extra-doc-files:+    docs/img/traces_spans.png  source-repository head   type: git
src/OpenTelemetry/Processor/Batch.hs view
@@ -1,4 +1,17 @@ {-# LANGUAGE RecordWildCards #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  OpenTelemetry.Processor.Batch+-- Copyright   :  (c) Ian Duncan, 2021+-- License     :  BSD-3+-- Description :  Performant exporting of spans in time & space-bounded batches.+-- Maintainer  :  Ian Duncan+-- Stability   :  experimental+-- Portability :  non-portable (GHC extensions)+--+-- This is an implementation of the Span Processor which create batches of finished spans and passes the export-friendly span data representations to the configured Exporter.+--+----------------------------------------------------------------------------- module OpenTelemetry.Processor.Batch   ( BatchTimeoutConfig(..)   , batchTimeoutConfig@@ -142,17 +155,17 @@  -- TODO, counters for dropped spans, exported spans -data BoundedSpanMap = BoundedSpanMap+data BoundedMap a = BoundedMap   { itemBounds :: !Int   , itemCount :: !Int-  , itemMap :: HashMap InstrumentationLibrary (Builder.Builder ImmutableSpan)+  , itemMap :: HashMap InstrumentationLibrary (Builder.Builder a)   } -boundedSpanMap :: Int -> BoundedSpanMap-boundedSpanMap bounds = BoundedSpanMap bounds 0 mempty+boundedMap :: Int -> BoundedMap a+boundedMap bounds = BoundedMap bounds 0 mempty -pushSpan :: ImmutableSpan -> BoundedSpanMap -> Maybe BoundedSpanMap-pushSpan s m = if itemCount m + 1 >= itemBounds m+push :: ImmutableSpan -> BoundedMap ImmutableSpan -> Maybe (BoundedMap ImmutableSpan)+push s m = if itemCount m + 1 >= itemBounds m   then Nothing   else Just $! m     { itemCount = itemCount m + 1@@ -163,8 +176,8 @@         itemMap m     } -buildSpanExport :: BoundedSpanMap -> (BoundedSpanMap, HashMap InstrumentationLibrary (Vector ImmutableSpan))-buildSpanExport m =+buildExport :: BoundedMap a -> (BoundedMap a, HashMap InstrumentationLibrary (Vector a))+buildExport m =   ( m { itemCount = 0, itemMap = mempty }   , Builder.build <$> itemMap m   )@@ -173,13 +186,13 @@ -- The batch processor accepts spans and places them into batches. Batching helps better compress the data and reduce the number of outgoing connections  -- required to transmit the data. This processor supports both size and time based batching. ---batchProcessor :: MonadIO m => BatchTimeoutConfig -> Exporter -> m Processor+batchProcessor :: MonadIO m => BatchTimeoutConfig -> Exporter ImmutableSpan -> m Processor batchProcessor BatchTimeoutConfig{..} exporter = liftIO $ do-  batch <- newIORef $ boundedSpanMap maxQueueSize+  batch <- newIORef $ boundedMap maxQueueSize   workSignal <- newEmptyMVar   worker <- async $ forever $ do     void $ timeout (millisToMicros scheduledDelayMillis) $ takeMVar workSignal-    batchToProcess <- atomicModifyIORef' batch buildSpanExport+    batchToProcess <- atomicModifyIORef' batch buildExport     Exporter.exporterExport exporter batchToProcess  @@ -188,7 +201,7 @@     , processorOnEnd = \s -> do         span_ <- readIORef s         appendFailed <- atomicModifyIORef' batch $ \builder ->-          case pushSpan span_ builder of+          case push span_ builder of             Nothing -> (builder, True)             Just b' -> (b', False)         when appendFailed $ void $ tryPutMVar workSignal ()
src/OpenTelemetry/Processor/Simple.hs view
@@ -16,7 +16,7 @@ import qualified Data.HashMap.Strict as HashMap  newtype SimpleProcessorConfig = SimpleProcessorConfig-  { exporter :: Exporter.Exporter+  { exporter :: Exporter.Exporter ImmutableSpan   -- ^ The exporter where the spans are pushed.   } 
src/OpenTelemetry/Resource/Host/Detector.hs view
@@ -1,6 +1,10 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-}-module OpenTelemetry.Resource.Host.Detector where+module OpenTelemetry.Resource.Host.Detector +  ( detectHost+  , builtInHostDetectors+  , HostDetector+  ) where  import OpenTelemetry.Resource.Host 
src/OpenTelemetry/Resource/OperatingSystem/Detector.hs view
@@ -1,5 +1,19 @@ {-# LANGUAGE OverloadedStrings #-}-module OpenTelemetry.Resource.OperatingSystem.Detector where+-----------------------------------------------------------------------------+-- |+-- Module      :  OpenTelemetry.Resource.OperatingSystem.Detector+-- Copyright   :  (c) Ian Duncan, 2021+-- License     :  BSD-3+-- Maintainer  :  Ian Duncan+-- Stability   :  experimental+-- Portability :  non-portable (GHC extensions)+--+-- Detect information about the current system's OS.+--+-----------------------------------------------------------------------------+module OpenTelemetry.Resource.OperatingSystem.Detector +  ( detectOperatingSystem+  ) where import OpenTelemetry.Resource.OperatingSystem import qualified Data.Text as T import System.Info ( os )
src/OpenTelemetry/Resource/Process/Detector.hs view
@@ -8,6 +8,8 @@ import System.Info import Data.Version import OpenTelemetry.Resource.Process+import Control.Exception (try, throwIO)+import System.IO.Error  -- | Create a 'Process' 'Resource' based off of the current process' knowledge -- of itself.@@ -22,7 +24,16 @@     pure Nothing <*>     pure Nothing <*>     (Just . map T.pack <$> getArgs) <*>-    (Just . T.pack <$> getEffectiveUserName)+    tryGetUser++tryGetUser :: IO (Maybe T.Text)+tryGetUser = do+  eResult <- try getEffectiveUserName+  case eResult of+    Left err -> if isDoesNotExistError err+      then pure Nothing+      else throwIO err+    Right ok -> pure $ Just $ T.pack ok  -- | A 'ProcessRuntime' 'Resource' populated with the current process' knoweldge -- of itself.
src/OpenTelemetry/Trace.hs view
@@ -2,9 +2,86 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DataKinds #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  OpenTelemetry.Trace+-- Copyright   :  (c) Ian Duncan, 2021+-- License     :  BSD-3+-- Description :  Application Tracing API+-- Maintainer  :  Ian Duncan+-- Stability   :  experimental+-- Portability :  non-portable (GHC extensions)+--+-- Traces track the progression of a single request, called a trace, as it is handled +-- by services that make up an application. The request may be initiated by a user or +-- an application. Distributed tracing is a form of tracing that traverses process, network +-- and security boundaries. Each unit of work in a trace is called a span; a trace is a tree of spans. +-- Spans are objects that represent the work being done by individual services or components involved in a request as it flows through a system. A span contains a span context, which is a set of globally unique identifiers that represent the unique request that each span is a part of. +-- A span provides Request, Error and Duration (RED) metrics that can be used to debug availability as well as performance issues.+--+-- Here is a visualization of the relationship between traces and spans:+--+-- <<docs/img/traces_spans.png>>+--+-- A trace contains a single root span which encapsulates the end-to-end latency for the entire request. You can think of this as a single logical operation, such as clicking a button in a web application to add a product to a shopping cart. The root span would measure the time it took from an end-user clicking that button to the operation being completed or failing (so, the item is added to the cart or some error occurs) and the result being displayed to the user. A trace is comprised of the single root span and any number of child spans, which represent operations taking place as part of the request. Each span contains metadata about the operation, such as its name, start and end timestamps, attributes (which represent additonal user-defined metadata about a span), events, and status.+-- +-- To create and manage spans in OpenTelemetry, the OpenTelemetry API provides the tracer interface. This object is responsible for tracking the active span in your process, and allows you to access the current span in order to perform operations on it such as adding attributes, events, and finishing it when the work it tracks is complete. One or more tracer objects can be created in a process through the tracer provider, a factory interface that allows for multiple tracers to be instantiated in a single process with different options.+-- +-- Generally, the lifecycle of a span resembles the following:+-- +-- - A request is received by a service. The span context is extracted from the request headers, if it exists.+-- - A new span is created as a child of the extracted span context; if none exists, a new root span is created.+-- - The service handles the request. Additional attributes and events are added to the span that are useful for understanding the context of the request, such as the hostname of the machine handling the request, or customer identifiers.+-- - New spans may be created to represent work being done by sub-components of the service.+-- - When the service makes a remote call to another service, the current span context is serialized and forwarded to the next service by injecting the span context into the headers or message envelope.+-- - The work being done by the service completes, successfully or not. The span status is appropriately set, and the span is marked finished.+-- - For more information, see the traces specification, which covers concepts including: trace, span, parent/child relationship, span context, attributes, events and links.+--+--+-- This module implements eveything required to conform to the trace & span public interface described+-- by the OpenTelemetry specification.+--+-- See "OpenTelemetry.Trace.Monad" for an implementation of 'inSpan' variants that are+-- slightly easier to use in idiomatic Haskell monadic code.+--+----------------------------------------------------------------------------- module OpenTelemetry.Trace    ( +  -- * How to use this library++  -- ** Quick start+  -- $use+  +  -- ** Configuration+  -- Nearly everything is configurable via environment variables.++  -- *** General configuration variables+  -- $envGeneral++  -- *** Batch span processor configuration variables+  -- $envBsp++  -- *** Attribute limits+  -- $envAttributeLimits++  -- *** Span limits+  -- $envSpanLimits+++  -- ** Exporting data+  --+  -- By default, the <https://hackage.haskell.org/package/hs-opentelemetry-exporter-otlp OTLP protocol exporter>+  -- will be used. It supports exporting to the <https://opentelemetry.io/docs/collector/getting-started/ OpenTelemetry collector agent>,+  -- which supports a wide array of 3rd party services, and also provides a wide array of data enrichment abilities.+  -- +  -- Additionally, a number of third party services directly support the OTLP protocol, so you can also often directly connect+  -- to their API gateway to send data. See your telemetry vendor's documentation to determine if this is the case.+  --+  -- There are a number of other exporters <https://hackage.haskell.org/packages/search?terms=hs-opentelemetry-exporter available on hackage>, including+  -- an in-memory exporter for testing.+   -- * 'TracerProvider' operations+  -- $tracerProvider     TracerProvider   , initializeGlobalTracerProvider   , initializeTracerProvider@@ -13,44 +90,49 @@   -- ** Getting / setting the global 'TracerProvider'   , getGlobalTracerProvider   , setGlobalTracerProvider-  -- ** Alternative 'TracerProvider' initialization-  , createTracerProvider-  , TracerProviderOptions(..)-  , emptyTracerProviderOptions-  , detectBuiltInResources   -- * 'Tracer' operations   , Tracer   , tracerName   , getTracer+  , makeTracer   , TracerOptions(..)   , tracerOptions   , HasTracer(..)   , InstrumentationLibrary(..)   -- * 'Span' operations   , Span-  , createSpan-  , createSpanWithoutCallStack+  , inSpan   , defaultSpanArguments   , SpanArguments(..)+  , SpanKind(..)+  , NewLink(..)+  , inSpan'   , updateName   , addAttribute    , addAttributes+  , recordException+  , setStatus+  , SpanStatus(..)+  , NewEvent(..)+  , addEvent+  , inSpan''+  -- * Primitive span and tracing operations+  -- ** Alternative 'TracerProvider' initialization+  , createTracerProvider+  , TracerProviderOptions(..)+  , emptyTracerProviderOptions+  , detectBuiltInResources+  , createSpan+  , createSpanWithoutCallStack+  , endSpan   , spanGetAttributes   , ToAttribute(..)   , ToPrimitiveAttribute(..)   , Attribute(..)   , PrimitiveAttribute(..)-  , SpanKind(..)   , Link-  , NewLink(..)   , Event-  , NewEvent(..)-  , addEvent-  , recordException-  , setStatus-  , SpanStatus(..)   , SpanContext(..)-  , endSpan   -- TODO, don't remember if this is okay with the spec or not   , ImmutableSpan(..)   ) where@@ -85,6 +167,99 @@ import OpenTelemetry.Resource.Telemetry.Detector (detectTelemetry) import OpenTelemetry.Trace.Id.Generator.Default (defaultIdGenerator) +-- $use+--+-- 1. Initialize a 'TracerProvider'.+-- 2. Create a 'Tracer' for your system.+-- 3. Add <https://hackage.haskell.org/packages/search?terms=hs-opentelemetry-instrumentation relevant pre-made instrumentation>+-- 4. Annotate your internal functions using the 'inSpan' function or one of its variants.++-- $tracerProvider+-- +-- A `TracerProvider` is key to using OpenTelemetry tracing. It is the data structure responsible for designating how spans are processed and exported+--+-- You will generally only need to call 'initializeGlobalTracerProvider' on initialization,+-- and 'shutdownTracerProvider' when your application exits.+--+-- @+--+-- main :: IO ()+-- main = withTracer $ \tracer -> do+--   -- your existing code here...+--   pure ()+--   where+--     withTracer f = bracket +--       -- Install the SDK, pulling configuration from the environment+--       initializeGlobalTracerProvider+--       -- Ensure that any spans that haven't been exported yet are flushed+--       shutdownTracerProvider+--       (\tracerProvider -> do+--         -- Get a tracer so you can create spans+--         tracer <- getTracer tracerProvider "your-app-name-or-subsystem"+--         f tracer+--       )+--+-- @+--++-- $envGeneral+--+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | Name                      | Description                                                                                                   | Default                                                                                                                                        | Notes                                                                                                                                                                                                                                                                          |+-- +===========================+===============================================================================================================+================================================================================================================================================+================================================================================================================================================================================================================================================================================++-- | OTEL_RESOURCE_ATTRIBUTES  | Key-value pairs to be used as resource attributes                                                             | See [Resource semantic conventions](resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value) for details.  | See [Resource SDK](./resource/sdk.md#specifying-resource-information-via-an-environment-variable) for more details.                                                                                                                                                            |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | OTEL_SERVICE_NAME         | Sets the value of the [`service.name`](./resource/semantic_conventions/README.md#service) resource attribute  |                                                                                                                                                | If `service.name` is also provided in `OTEL_RESOURCE_ATTRIBUTES`, then `OTEL_SERVICE_NAME` takes precedence.                                                                                                                                                                   |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | OTEL_LOG_LEVEL            | Log level used by the SDK logger                                                                              | "info"                                                                                                                                         |                                                                                                                                                                                                                                                                                |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | OTEL_PROPAGATORS          | Propagators to be used as a comma-separated list                                                              | "tracecontext,baggage"                                                                                                                         | Values MUST be deduplicated in order to register a `Propagator` only once.                                                                                                                                                                                                     |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | OTEL_TRACES_SAMPLER       | Sampler to be used for traces                                                                                 | "parentbased_always_on"                                                                                                                        | See [Sampling](./trace/sdk.md#sampling)                                                                                                                                                                                                                                        |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-- | OTEL_TRACES_SAMPLER_ARG   | String value to be used as the sampler argument                                                               |                                                                                                                                                | The specified value will only be used if OTEL_TRACES_SAMPLER is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input MUST be logged and MUST be otherwise ignored, i.e. the SDK MUST behave as if OTEL_TRACES_SAMPLER_ARG is not set.  |+-- +---------------------------+---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++-- $envBsp+-- +---------------------------------+-------------------------------------------------+----------+--------------------------------------------------------++-- | Name                            | Description                                     | Default  | Notes                                                  |+-- +=================================+=================================================+==========+========================================================++-- | OTEL_BSP_SCHEDULE_DELAY         | Delay interval between two consecutive exports  | 5000     |                                                        |+-- +---------------------------------+-------------------------------------------------+----------+--------------------------------------------------------++-- | OTEL_BSP_EXPORT_TIMEOUT         | Maximum allowed time to export data             | 30000    |                                                        |+-- +---------------------------------+-------------------------------------------------+----------+--------------------------------------------------------++-- | OTEL_BSP_MAX_QUEUE_SIZE         | Maximum queue size                              | 2048     |                                                        |+-- +---------------------------------+-------------------------------------------------+----------+--------------------------------------------------------++-- | OTEL_BSP_MAX_EXPORT_BATCH_SIZE  | Maximum batch size                              | 512      | Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE  |+-- +---------------------------------+-------------------------------------------------+----------+--------------------------------------------------------+++-- $envAttributeLimits+-- +------------------------------------+---------------------------------------+----------+-----------------------------------------------------------------------------------++-- | Name                               | Description                           | Default  | Notes                                                                             |+-- +====================================+=======================================+==========+===================================================================================++-- | OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT  | Maximum allowed attribute value size  |          | Empty value is treated as infinity. Non-integer and negative values are invalid.  |+-- +------------------------------------+---------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_ATTRIBUTE_COUNT_LIMIT         | Maximum allowed span attribute count  | 128      |                                                                                   |+-- +------------------------------------+---------------------------------------+----------+-----------------------------------------------------------------------------------+++-- $envSpanLimits+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | Name                                    | Description                                     | Default  | Notes                                                                             |+-- +=========================================+=================================================+==========+===================================================================================++-- | OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT  | Maximum allowed attribute value size            |          | Empty value is treated as infinity. Non-integer and negative values are invalid.  |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT         | Maximum allowed span attribute count            | 128      |                                                                                   |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_SPAN_EVENT_COUNT_LIMIT             | Maximum allowed span event count                | 128      |                                                                                   |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_SPAN_LINK_COUNT_LIMIT              | Maximum allowed span link count                 | 128      |                                                                                   |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT        | Maximum allowed attribute per span event count  | 128      |                                                                                   |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------++-- | OTEL_LINK_ATTRIBUTE_COUNT_LIMIT         | Maximum allowed attribute per span link count   | 128      |                                                                                   |+-- +-----------------------------------------+-------------------------------------------------+----------+-----------------------------------------------------------------------------------+++ knownPropagators :: [(T.Text, Propagator Context RequestHeaders ResponseHeaders)] knownPropagators =   [ ("tracecontext", w3cTraceContextPropagator)@@ -98,6 +273,14 @@ readRegisteredPropagators :: IO [(T.Text, Propagator Context RequestHeaders ResponseHeaders)] readRegisteredPropagators = pure knownPropagators +-- | Create a new 'TracerProvider' and set it as the global+-- tracer provider. This pulls all configuration from environment+-- variables. The full list of environment variables supported is+-- specified in the configuration section of this module's documentation.+-- +-- Note however, that 3rd-party span processors, exporters, sampling strategies,+-- etc. may have their own set of environment-based configuration values that they+-- utilize. initializeGlobalTracerProvider :: IO TracerProvider initializeGlobalTracerProvider = do   t <- initializeTracerProvider@@ -200,7 +383,7 @@   <*> readEnv "OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT"   <*> readEnv "OTEL_LINK_ATTRIBUTE_COUNT_LIMIT" -knownExporters :: [(T.Text, IO Exporter)]+knownExporters :: [(T.Text, IO (Exporter ImmutableSpan))] knownExporters =   [ ("otlp", do       otlpConfig <- loadExporterEnvironmentVariables@@ -210,9 +393,8 @@   , ("zipkin", error "Zipkin exporter not implemented")   ] --- TODO, rename Exporter to Exporter -- TODO, support multiple exporters-detectExporters :: IO [Exporter]+detectExporters :: IO [Exporter ImmutableSpan] detectExporters = do   exportersInEnv <- fmap (T.splitOn "," . T.pack) <$> lookupEnv "OTEL_TRACES_EXPORTER"   if exportersInEnv == Just ["none"]@@ -250,6 +432,20 @@ readEnv :: forall a. Read a => String -> IO (Maybe a) readEnv k = (>>= readMaybe) <$> lookupEnv k +-- | Use all built-in resource detectors to populate resource information.+--+-- Currently used detectors include:+--+-- - 'detectService'+-- - 'detectProcess'+-- - 'detectOperatingSystem'+-- - 'detectHost'+-- - 'detectTelemetry'+-- - 'detectProcessRuntime'+--+-- This list will grow in the future as more detectors are implemented.+--+-- @since 0.0.1.0 detectBuiltInResources :: IO (Resource 'Nothing) detectBuiltInResources = do   svc <- detectService
src/OpenTelemetry/Trace/Id/Generator/Default.hs view
@@ -1,4 +1,16 @@ {-# LANGUAGE CPP #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  OpenTelemetry.Trace.Id.Generator.Default+-- Copyright   :  (c) Ian Duncan, 2021+-- License     :  BSD-3+-- Maintainer  :  Ian Duncan+-- Stability   :  experimental+-- Portability :  non-portable (GHC extensions)+--+-- A reasonably performant out of the box implementation of random span and trace id generation.+--+----------------------------------------------------------------------------- module OpenTelemetry.Trace.Id.Generator.Default    ( defaultIdGenerator   ) where