OpenTelemetry.Eventlog

opentelemetry-0.8.0

Safe Haskell | None
Language | Haskell2010

OpenTelemetry.Eventlog

Contents

- Spans
- Metrics

Synopsis

- beginSpan :: MonadIO m => ByteString -> m SpanInFlight
- endSpan :: MonadIO m => SpanInFlight -> m ()
- withSpan :: (MonadIO m, MonadMask m) => ByteString -> (SpanInFlight -> m a) -> m a
- withSpan_ :: (MonadIO m, MonadMask m) => ByteString -> m a -> m a
- setSpanId :: MonadIO m => SpanInFlight -> SpanId -> m ()
- setTraceId :: MonadIO m => SpanInFlight -> TraceId -> m ()
- setTag :: MonadIO m => SpanInFlight -> ByteString -> ByteString -> m ()
- addEvent :: MonadIO m => SpanInFlight -> ByteString -> ByteString -> m ()
- setParentSpanContext :: MonadIO m => SpanInFlight -> SpanContext -> m ()
- newtype SpanInFlight = SpanInFlight ProcessLocalSpanSerialNumber
- mkCounter :: MonadIO m => InstrumentName -> m Counter
- mkUpDownCounter :: MonadIO m => InstrumentName -> m UpDownCounter
- mkValueRecorder :: MonadIO m => InstrumentName -> m ValueRecorder
- mkSumObserver :: MonadIO m => InstrumentName -> m SumObserver
- mkUpDownSumObserver :: MonadIO m => InstrumentName -> m UpDownSumObserver
- mkValueObserver :: MonadIO m => InstrumentName -> m ValueObserver
- add :: forall m (m' :: Monotonicity). MonadIO m => Instrument 'Synchronous 'Additive m' -> Int -> m ()
- record :: forall m (m' :: Monotonicity). MonadIO m => Instrument 'Synchronous 'NonAdditive m' -> Int -> m ()
- observe :: forall m (a :: Additivity) (m' :: Monotonicity). MonadIO m => Instrument 'Asynchronous a m' -> Int -> m ()
- data Instrument (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity)
- data SomeInstrument = SomeInstrument (Instrument s a m)
- type Counter = Instrument 'Synchronous 'Additive 'Monotonic
- type UpDownCounter = Instrument 'Synchronous 'Additive 'NonMonotonic
- type ValueRecorder = Instrument 'Synchronous 'NonAdditive 'NonMonotonic
- type SumObserver = Instrument 'Asynchronous 'Additive 'Monotonic
- type UpDownSumObserver = Instrument 'Asynchronous 'Additive 'NonMonotonic
- type ValueObserver = Instrument 'Asynchronous 'NonAdditive 'NonMonotonic
- data Synchronicity
  - = Synchronous
  - | Asynchronous
- data Additivity
  - = Additive
  - | NonAdditive
- data Monotonicity
  - = Monotonic
  - | NonMonotonic
- type InstrumentName = ByteString
- type InstrumentId = Word64
- instrumentName :: forall (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity). Instrument s a m -> InstrumentName
- instrumentId :: forall (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity). Instrument s a m -> InstrumentId

# Spans

beginSpan :: MonadIO m => ByteString -> m SpanInFlight #

endSpan :: MonadIO m => SpanInFlight -> m () #

withSpan :: (MonadIO m, MonadMask m) => ByteString -> (SpanInFlight -> m a) -> m a #

withSpan_ :: (MonadIO m, MonadMask m) => ByteString -> m a -> m a #

setSpanId :: MonadIO m => SpanInFlight -> SpanId -> m () #

setTraceId :: MonadIO m => SpanInFlight -> TraceId -> m () #

setTag :: MonadIO m => SpanInFlight -> ByteString -> ByteString -> m () #

addEvent :: MonadIO m => SpanInFlight -> ByteString -> ByteString -> m () #

setParentSpanContext :: MonadIO m => SpanInFlight -> SpanContext -> m () #

newtype SpanInFlight #

Constructors

SpanInFlight ProcessLocalSpanSerialNumber |

#### Instances

Instances details

Show SpanInFlight # |
Instance details Defined in OpenTelemetry.Eventlog_Internal Methods showsPrec :: Int -> SpanInFlight -> ShowS # show :: SpanInFlight -> String # showList :: [SpanInFlight] -> ShowS #
Eq SpanInFlight # |
Instance details Defined in OpenTelemetry.Eventlog_Internal Methods (==) :: SpanInFlight -> SpanInFlight -> Bool # (/=) :: SpanInFlight -> SpanInFlight -> Bool #
Hashable SpanInFlight # |
Instance details Defined in OpenTelemetry.Eventlog_Internal Methods hashWithSalt :: Int -> SpanInFlight -> Int # hash :: SpanInFlight -> Int #

# Metrics

mkCounter :: MonadIO m => InstrumentName -> m Counter #

mkUpDownCounter :: MonadIO m => InstrumentName -> m UpDownCounter #

mkValueRecorder :: MonadIO m => InstrumentName -> m ValueRecorder #

mkSumObserver :: MonadIO m => InstrumentName -> m SumObserver #

mkUpDownSumObserver :: MonadIO m => InstrumentName -> m UpDownSumObserver #

mkValueObserver :: MonadIO m => InstrumentName -> m ValueObserver #

add :: forall m (m' :: Monotonicity). MonadIO m => Instrument 'Synchronous 'Additive m' -> Int -> m () #

Take a measurement for a synchronous, additive instrument (`Counter`, `UpDownCounter`)

record :: forall m (m' :: Monotonicity). MonadIO m => Instrument 'Synchronous 'NonAdditive m' -> Int -> m () #

Take a measurement for a synchronous, non-additive instrument (`ValueRecorder`)

observe :: forall m (a :: Additivity) (m' :: Monotonicity). MonadIO m => Instrument 'Asynchronous a m' -> Int -> m () #

Take a measurement for an asynchronous instrument (`SumObserver`, `UpDownSumObserver`, `ValueObserver`)

data Instrument (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity) #

An OpenTelemetry instrument as defined in the OpenTelemetry Metrics API (https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api.md)

#### Instances

Instances details

Show (Instrument s a m) # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods showsPrec :: Int -> Instrument s a m -> ShowS # show :: Instrument s a m -> String # showList :: [Instrument s a m] -> ShowS #
Eq (Instrument s a m) # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods (==) :: Instrument s a m -> Instrument s a m -> Bool # (/=) :: Instrument s a m -> Instrument s a m -> Bool #
Hashable (Instrument s a m) # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods hashWithSalt :: Int -> Instrument s a m -> Int # hash :: Instrument s a m -> Int #

data SomeInstrument #

Existential wrapper for `Instrument`. Use when the exact type of Instrument does not matter.

Constructors

SomeInstrument (Instrument s a m) |

#### Instances

Instances details

Show SomeInstrument # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods showsPrec :: Int -> SomeInstrument -> ShowS # show :: SomeInstrument -> String # showList :: [SomeInstrument] -> ShowS #
Eq SomeInstrument # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods (==) :: SomeInstrument -> SomeInstrument -> Bool # (/=) :: SomeInstrument -> SomeInstrument -> Bool #
Hashable SomeInstrument # |
Instance details Defined in OpenTelemetry.Metrics_Internal Methods hashWithSalt :: Int -> SomeInstrument -> Int # hash :: SomeInstrument -> Int #

type Counter = Instrument 'Synchronous 'Additive 'Monotonic #

type UpDownCounter = Instrument 'Synchronous 'Additive 'NonMonotonic #

type ValueRecorder = Instrument 'Synchronous 'NonAdditive 'NonMonotonic #

type SumObserver = Instrument 'Asynchronous 'Additive 'Monotonic #

type UpDownSumObserver = Instrument 'Asynchronous 'Additive 'NonMonotonic #

type ValueObserver = Instrument 'Asynchronous 'NonAdditive 'NonMonotonic #

data Synchronicity #

Constructors

Synchronous |
Asynchronous |

data Additivity #

Constructors

Additive |
NonAdditive |

data Monotonicity #

Constructors

Monotonic |
NonMonotonic |

type InstrumentName = ByteString #

type InstrumentId = Word64 #

instrumentName :: forall (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity). Instrument s a m -> InstrumentName #

instrumentId :: forall (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity). Instrument s a m -> InstrumentId #