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

Hasura.Server.Prometheus

Description

Mutable references for Prometheus metrics.

These metrics are independent from the metrics in Hasura.Server.Metrics.

Synopsis

Documentation

makeDummyPrometheusMetrics :: IO PrometheusMetrics Source #

Create dummy mutable references without associating them to a metrics store.

data ConnectionsGauge Source #

A mutable reference for atomically sampling the number of websocket connections and number of threads forked by the warp webserver.

Because we derive the number of (non-websocket) HTTP connections by the difference of these two metrics, we must sample them simultaneously, otherwise we might report a negative number of HTTP connections.

data ResponseStatus Source #

Constructors

Success 
Failed 

newtype EventStatusLabel Source #

Constructors

EventStatusLabel 

Fields

data EventStatusWithTriggerLabel Source #

Instances

Instances details
Generic EventStatusWithTriggerLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Associated Types

type Rep EventStatusWithTriggerLabel :: Type -> Type #

ToLabels EventStatusWithTriggerLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Eq EventStatusWithTriggerLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Ord EventStatusWithTriggerLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep EventStatusWithTriggerLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep EventStatusWithTriggerLabel = D1 ('MetaData "EventStatusWithTriggerLabel" "Hasura.Server.Prometheus" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "EventStatusWithTriggerLabel" 'PrefixI 'True) (S1 ('MetaSel ('Just "_eswtlStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EventStatusLabel) :*: S1 ('MetaSel ('Just "_eswtlDynamicLabels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DynamicEventTriggerLabel))))

data SubscriptionKindLabel Source #

Instances

Instances details
Generic SubscriptionKindLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Associated Types

type Rep SubscriptionKindLabel :: Type -> Type #

ToLabels SubscriptionKindLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Eq SubscriptionKindLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Ord SubscriptionKindLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep SubscriptionKindLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep SubscriptionKindLabel = D1 ('MetaData "SubscriptionKindLabel" "Hasura.Server.Prometheus" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "SubscriptionKindLabel" 'PrefixI 'True) (S1 ('MetaSel ('Just "subscription_kind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

data DynamicSubscriptionLabel Source #

Instances

Instances details
Generic DynamicSubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Associated Types

type Rep DynamicSubscriptionLabel :: Type -> Type #

ToLabels DynamicSubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Eq DynamicSubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Ord DynamicSubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep DynamicSubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep DynamicSubscriptionLabel = D1 ('MetaData "DynamicSubscriptionLabel" "Hasura.Server.Prometheus" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "DynamicSubscriptionLabel" 'PrefixI 'True) (S1 ('MetaSel ('Just "_dslParamQueryHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParameterizedQueryHash) :*: S1 ('MetaSel ('Just "_dslOperationName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe OperationName))))

data SubscriptionLabel Source #

Instances

Instances details
Generic SubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Associated Types

type Rep SubscriptionLabel :: Type -> Type #

ToLabels SubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Eq SubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

Ord SubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep SubscriptionLabel Source # 
Instance details

Defined in Hasura.Server.Prometheus

type Rep SubscriptionLabel = D1 ('MetaData "SubscriptionLabel" "Hasura.Server.Prometheus" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "SubscriptionLabel" 'PrefixI 'True) (S1 ('MetaSel ('Just "_slKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubscriptionKindLabel) :*: S1 ('MetaSel ('Just "_slDynamicLabels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DynamicSubscriptionLabel))))

recordMetricWithLabel :: MonadIO m => IO GranularPrometheusMetricsState -> Bool -> IO () -> IO () -> m () Source #

Record metrics with dynamic label

observeHistogramWithLabel :: (Ord l, MonadIO m) => IO GranularPrometheusMetricsState -> Bool -> HistogramVector (Maybe l) -> l -> Double -> m () Source #

Observe a histogram metric with a label.

If the granularity is set to GranularMetricsOn, the label will be included in the metric. Otherwise, the label will be set to Nothing

recordSubcriptionMetric :: MonadIO m => IO GranularPrometheusMetricsState -> Bool -> HashMap (Maybe OperationName) Int -> ParameterizedQueryHash -> SubscriptionKindLabel -> (SubscriptionLabel -> IO ()) -> m () Source #

Record a subscription metric for all the operation names present in the subscription. Use this when you want to update the same value of the metric for all the operation names.