graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Tracing.Class

Description

Defines the Tracing API.

The MonadTrace class defines the "public API" of this component.

Synopsis

Documentation

class Monad m => MonadTrace m where Source #

Methods

newTraceWith :: TraceContext -> SamplingPolicy -> Text -> m a -> m a Source #

Trace the execution of a block of code, attaching a human-readable name. This starts a new trace and its corresponding root span, to which subsequent spans will be attached.

newSpanWith :: SpanId -> Text -> m a -> m a Source #

Starts a new span within the current trace. No-op if there's no current trace.

TODO: we could rewrite this to start a new trace if there isn't one, using the default reporter and policy? This would guarantee that no span is ever lost, but would also risk reporting undesired spans.

currentContext :: m (Maybe TraceContext) Source #

Ask for the current tracing context, so that we can provide it to any downstream services, e.g. in HTTP headers. Returns Nothing if we're not currently tracing anything.

attachMetadata :: TraceMetadata -> m () Source #

Log some arbitrary metadata to be attached to the current span, if any.

Instances

Instances details
MonadTrace AppM Source # 
Instance details

Defined in Hasura.App

MonadTrace m => MonadTrace (AgentClientT m) Source # 
Instance details

Defined in Hasura.Backends.DataConnector.Agent.Client

MonadTrace m => MonadTrace (CacheRWT m) Source # 
Instance details

Defined in Hasura.RQL.DDL.Schema.Cache

MonadTrace m => MonadTrace (MetadataT m) Source # 
Instance details

Defined in Hasura.RQL.Types.SchemaCache.Build

MonadTrace m => MonadTrace (Handler m) Source # 
Instance details

Defined in Hasura.Server.App

(MonadIO m, MonadBaseControl IO m) => MonadTrace (TraceT m) Source # 
Instance details

Defined in Hasura.Tracing.Monad

MonadTrace m => MonadTrace (MaybeT m) Source # 
Instance details

Defined in Hasura.Tracing.Class

MonadTrace m => MonadTrace (TxET e m) Source # 
Instance details

Defined in Hasura.Backends.Postgres.Connection.MonadTx

MonadTrace m => MonadTrace (ExceptT e m) Source # 
Instance details

Defined in Hasura.Tracing.Class

MonadTrace m => MonadTrace (ReaderT r m) Source # 
Instance details

Defined in Hasura.Tracing.Class

MonadTrace m => MonadTrace (StateT e m) Source # 
Instance details

Defined in Hasura.Tracing.Class

newTrace :: (MonadIO m, MonadTrace m) => SamplingPolicy -> Text -> m a -> m a Source #

Create a new trace using a randomly-generated context.

newSpan :: (MonadIO m, MonadTrace m) => Text -> m a -> m a Source #

Create a new span with a randomly-generated id.