eventuo11y-prometheus-0.1.0.0: Prometheus backend for eventuo11y
CopyrightCopyright 2023 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Observe.Event.Render.Prometheus

Description

 
Synopsis

Documentation

prometheusEventBackend :: forall es s. EventMetrics es => Registry -> RenderSelectorPrometheus s es -> IO (EventBackend IO PrometheusReference s) Source #

An EventBackend that populates a Registry.

All metrics are registered before the backend is returned.

class (EventMetric (Counter es), EventMetric (Gauge es), EventHistogram (Histogram es)) => EventMetrics es Source #

A specification of a collection of prometheus metrics.

Note that due to limitations in the underlying prometheus client library, summaries are not yet supported.

Associated Types

type Counter es Source #

type Gauge es Source #

The gauges

type Histogram es Source #

class (Ord a, Enum a, Bounded a) => EventMetric a where Source #

A specification of a single prometheus metric of any type

Must satisfy ∀ x : a, x `elem` [minBound .. maxBound]

Methods

metricName :: a -> Name Source #

The name of the metric

metricLabels :: a -> Labels Source #

The labels of the metric

class EventMetric h => EventHistogram h where Source #

A specification of a prometheus histogram

Methods

metricBounds :: h -> [UpperBound] Source #

The upper bounds of the histogram buckets.

type RenderSelectorPrometheus s es = forall f. s f -> PrometheusRendered f es Source #

Render all events selectable by s to prometheus metrics according to EventMetrics es

We may want to add functionality for easily combining RenderSelectorPrometheuss and EventMetrics from nested selector types, possibly with additional labels layered on top.

data PrometheusRendered f es Source #

How to render a specific Event according to EventMetrics es

Constructors

PrometheusRendered 

Fields

data MetricModification es Source #

DSL for modifying metrics specified in EventMetrics es

Constructors

ModifyCounter !CounterModification !(Counter es)

Modify the specified counter

ModifyGauge !GaugeModification !(Gauge es)

Modify the specified gauge

ModifyHistogram !HistogramModification !(Histogram es)

Modify the specified histogram

data CounterModification Source #

DSL for modifying a counter metric

Constructors

AddCounter !Int

Add a value to a counter

IncCounter

Increment a counter

data GaugeModification Source #

DSL for modifying a gauge metric

Constructors

AddGauge !Double

Add a value to a gauge

Sub !Double

Subtract a value from a gauge

IncGauge

Increment a gauge

Dec

Decrement a gauge

Set !Double

Set the value of a gauge

data HistogramModification Source #

DSL for modifying a histogram metric

Constructors

Observe !Double

Record an observation

data EventDuration Source #

What duration event is this?

Constructors

Immediate

A immediately finalized event

Extended

An event with an extended lifetime

data PrometheusReference Source #

Reference type for prometheusEventBackend

Prometheus can't make use of references, so this carries no information.

Constructors

PrometheusReference