Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Mutable references for Prometheus metrics.
These metrics are independent from the metrics in Hasura.Server.Metrics.
Synopsis
- data PrometheusMetrics = PrometheusMetrics {
- pmConnections :: ConnectionsGauge
- pmGraphQLRequestMetrics :: GraphQLRequestMetrics
- pmEventTriggerMetrics :: EventTriggerMetrics
- pmWebSocketBytesReceived :: Counter
- pmWebSocketBytesSent :: Counter
- pmActionBytesReceived :: Counter
- pmActionBytesSent :: Counter
- pmScheduledTriggerMetrics :: ScheduledTriggerMetrics
- pmSubscriptionMetrics :: SubscriptionMetrics
- pmWebsocketMsgQueueTimeSeconds :: Histogram
- pmCacheRequestMetrics :: CacheRequestMetrics
- data GraphQLRequestMetrics = GraphQLRequestMetrics {
- gqlRequestsQuerySuccess :: Counter
- gqlRequestsQueryFailure :: Counter
- gqlRequestsMutationSuccess :: Counter
- gqlRequestsMutationFailure :: Counter
- gqlRequestsSubscriptionSuccess :: Counter
- gqlRequestsSubscriptionFailure :: Counter
- gqlRequestsUnknownFailure :: Counter
- gqlExecutionTimeSecondsQuery :: Histogram
- gqlExecutionTimeSecondsMutation :: Histogram
- data EventTriggerMetrics = EventTriggerMetrics {
- eventTriggerHTTPWorkers :: Gauge
- eventsFetchedPerBatch :: Gauge
- eventQueueTimeSeconds :: HistogramVector (Maybe DynamicEventTriggerLabel)
- eventsFetchTimePerBatch :: Histogram
- eventWebhookProcessingTime :: HistogramVector (Maybe DynamicEventTriggerLabel)
- eventProcessingTime :: HistogramVector (Maybe DynamicEventTriggerLabel)
- eventTriggerBytesReceived :: Counter
- eventTriggerBytesSent :: Counter
- eventProcessedTotal :: CounterVector EventStatusWithTriggerLabel
- eventInvocationTotal :: CounterVector EventStatusWithTriggerLabel
- data ScheduledTriggerMetrics = ScheduledTriggerMetrics {
- stmScheduledTriggerBytesReceived :: Counter
- stmScheduledTriggerBytesSent :: Counter
- stmCronEventsInvocationTotalSuccess :: Counter
- stmCronEventsInvocationTotalFailure :: Counter
- stmOneOffEventsInvocationTotalSuccess :: Counter
- stmOneOffEventsInvocationTotalFailure :: Counter
- stmCronEventsProcessedTotalSuccess :: Counter
- stmCronEventsProcessedTotalFailure :: Counter
- stmOneOffEventsProcessedTotalSuccess :: Counter
- stmOneOffEventsProcessedTotalFailure :: Counter
- data SubscriptionMetrics = SubscriptionMetrics {
- submActiveLiveQueryPollers :: Gauge
- submActiveStreamingPollers :: Gauge
- submActiveLiveQueryPollersInError :: Gauge
- submActiveStreamingPollersInError :: Gauge
- submTotalTime :: HistogramVector SubscriptionLabel
- submDBExecTotalTime :: HistogramVector SubscriptionLabel
- submActiveSubscriptions :: GaugeVector SubscriptionLabel
- data CacheRequestMetrics = CacheRequestMetrics {}
- makeDummyPrometheusMetrics :: IO PrometheusMetrics
- data ConnectionsGauge
- data Connections = Connections {}
- newConnectionsGauge :: IO ConnectionsGauge
- readConnectionsGauge :: ConnectionsGauge -> IO Connections
- incWarpThreads :: ConnectionsGauge -> IO ()
- decWarpThreads :: ConnectionsGauge -> IO ()
- incWebsocketConnections :: ConnectionsGauge -> IO ()
- decWebsocketConnections :: ConnectionsGauge -> IO ()
- data DynamicEventTriggerLabel = DynamicEventTriggerLabel {}
- data ResponseStatus
- responseStatusToLabelValue :: ResponseStatus -> Text
- newtype EventStatusLabel = EventStatusLabel {}
- eventSuccessLabel :: EventStatusLabel
- eventFailedLabel :: EventStatusLabel
- data EventStatusWithTriggerLabel = EventStatusWithTriggerLabel {}
- data SubscriptionKindLabel = SubscriptionKindLabel {}
- streamingSubscriptionLabel :: SubscriptionKindLabel
- liveQuerySubscriptionLabel :: SubscriptionKindLabel
- data DynamicSubscriptionLabel = DynamicSubscriptionLabel {}
- data SubscriptionLabel = SubscriptionLabel {}
- recordMetricWithLabel :: MonadIO m => IO GranularPrometheusMetricsState -> Bool -> IO () -> IO () -> m ()
- observeHistogramWithLabel :: (Ord l, MonadIO m) => IO GranularPrometheusMetricsState -> Bool -> HistogramVector (Maybe l) -> l -> Double -> m ()
- recordSubcriptionMetric :: MonadIO m => IO GranularPrometheusMetricsState -> Bool -> HashMap (Maybe OperationName) Int -> ParameterizedQueryHash -> SubscriptionKindLabel -> (SubscriptionLabel -> IO ()) -> m ()
Documentation
data PrometheusMetrics Source #
Mutable references for Prometheus metrics.
data GraphQLRequestMetrics Source #
data EventTriggerMetrics Source #
data ScheduledTriggerMetrics Source #
data SubscriptionMetrics Source #
data CacheRequestMetrics Source #
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 Connections Source #
incWarpThreads :: ConnectionsGauge -> IO () Source #
decWarpThreads :: ConnectionsGauge -> IO () Source #
incWebsocketConnections :: ConnectionsGauge -> IO () Source #
decWebsocketConnections :: ConnectionsGauge -> IO () Source #
data DynamicEventTriggerLabel Source #
Instances
newtype EventStatusLabel Source #
Instances
data EventStatusWithTriggerLabel Source #
Instances
data SubscriptionKindLabel Source #
Instances
data DynamicSubscriptionLabel Source #
Instances
data SubscriptionLabel Source #
Instances
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.