Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This is an internal module. The public interface is re-exported by OpenTelemetry.Eventlog
This module implements the instruments of the metrics portion of the OpenTelemetry API. It is reexported by OpenTelemetry.Eventlog and should be used by importing that.
The way to use the Instrument
type is throught the add
, record
or
observe
functions (depending on the instrument type) which capture metrics on
a given instrument.
Usage:
import OpenTelemetry.Eventlog aCounter :: Counter aCounter = Counter "myCounter" anObserver :: ValueObserver anObserver = ValueObserver "myObserver" main :: IO () main = do add aCounter 3 record anObserver 40
Synopsis
- data Instrument (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity) where
- Counter :: InstrumentName -> InstrumentId -> Counter
- UpDownCounter :: InstrumentName -> InstrumentId -> UpDownCounter
- ValueRecorder :: InstrumentName -> InstrumentId -> ValueRecorder
- SumObserver :: InstrumentName -> InstrumentId -> SumObserver
- UpDownSumObserver :: InstrumentName -> InstrumentId -> UpDownSumObserver
- ValueObserver :: InstrumentName -> InstrumentId -> ValueObserver
- data SomeInstrument = forall s a m. 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
- data Additivity
- data Monotonicity
- type InstrumentName = ByteString
- type InstrumentId = Word64
- instrumentName :: Instrument s a m -> InstrumentName
- instrumentId :: Instrument s a m -> InstrumentId
Documentation
data Instrument (s :: Synchronicity) (a :: Additivity) (m :: Monotonicity) where Source #
An OpenTelemetry instrument as defined in the OpenTelemetry Metrics API (https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api.md)
Counter :: InstrumentName -> InstrumentId -> Counter | |
UpDownCounter :: InstrumentName -> InstrumentId -> UpDownCounter | |
ValueRecorder :: InstrumentName -> InstrumentId -> ValueRecorder | |
SumObserver :: InstrumentName -> InstrumentId -> SumObserver | |
UpDownSumObserver :: InstrumentName -> InstrumentId -> UpDownSumObserver | |
ValueObserver :: InstrumentName -> InstrumentId -> ValueObserver |
Instances
Eq (Instrument s a m) Source # | |
Defined in OpenTelemetry.Metrics_Internal (==) :: Instrument s a m -> Instrument s a m -> Bool # (/=) :: Instrument s a m -> Instrument s a m -> Bool # | |
Show (Instrument s a m) Source # | |
Defined in OpenTelemetry.Metrics_Internal showsPrec :: Int -> Instrument s a m -> ShowS # show :: Instrument s a m -> String # showList :: [Instrument s a m] -> ShowS # | |
Hashable (Instrument s a m) Source # | |
Defined in OpenTelemetry.Metrics_Internal hashWithSalt :: Int -> Instrument s a m -> Int # hash :: Instrument s a m -> Int # |
data SomeInstrument Source #
Existential wrapper for Instrument
. Use when the exact type of Instrument does not matter.
forall s a m. SomeInstrument (Instrument s a m) |
Instances
Eq SomeInstrument Source # | |
Defined in OpenTelemetry.Metrics_Internal (==) :: SomeInstrument -> SomeInstrument -> Bool # (/=) :: SomeInstrument -> SomeInstrument -> Bool # | |
Show SomeInstrument Source # | |
Defined in OpenTelemetry.Metrics_Internal showsPrec :: Int -> SomeInstrument -> ShowS # show :: SomeInstrument -> String # showList :: [SomeInstrument] -> ShowS # | |
Hashable SomeInstrument Source # | |
Defined in OpenTelemetry.Metrics_Internal hashWithSalt :: Int -> SomeInstrument -> Int # hash :: SomeInstrument -> Int # |
Synonyms for specific types of Instrument
type Counter = Instrument 'Synchronous 'Additive 'Monotonic Source #
type UpDownCounter = Instrument 'Synchronous 'Additive 'NonMonotonic Source #
type ValueRecorder = Instrument 'Synchronous 'NonAdditive 'NonMonotonic Source #
type SumObserver = Instrument 'Asynchronous 'Additive 'Monotonic Source #
Used for indexing Instrument. All possible combinations are covered
type InstrumentName = ByteString Source #
type InstrumentId = Word64 Source #
instrumentName :: Instrument s a m -> InstrumentName Source #
instrumentId :: Instrument s a m -> InstrumentId Source #