graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Server.Telemetry.Counters

Description

Counters used in telemetry collection. Additional counters can be added here.and serviced in Hasura.Server.Telemetry.

Synopsis

Documentation

data RequestDimensions Source #

The properties that characterize this request. The dimensions over which we collect metrics for each serviced request.

Instances

Instances details
Eq RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep RequestDimensions :: Type -> Type #

Hashable RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser RequestDimensions

parseJSONList :: Value -> Parser [RequestDimensions]

ToJSON RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RequestDimensions Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RequestDimensions = D1 ('MetaData "RequestDimensions" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RequestDimensions" 'PrefixI 'True) (S1 ('MetaSel ('Just "telemQueryType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QueryType) :*: (S1 ('MetaSel ('Just "telemLocality") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Locality) :*: S1 ('MetaSel ('Just "telemTransport") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Transport))))

data RequestTimings Source #

Accumulated time metrics.

Constructors

RequestTimings 

Fields

data RequestTimingsCount Source #

RequestTimings along with the count

Constructors

RequestTimingsCount 

Fields

Instances

Instances details
Eq RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep RequestTimingsCount :: Type -> Type #

Semigroup RequestTimingsCount Source #

Sum

Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser RequestTimingsCount

parseJSONList :: Value -> Parser [RequestTimingsCount]

ToJSON RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RequestTimingsCount Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RequestTimingsCount = D1 ('MetaData "RequestTimingsCount" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RequestTimingsCount" 'PrefixI 'True) (S1 ('MetaSel ('Just "telemTimeIO") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Seconds) :*: (S1 ('MetaSel ('Just "telemTimeTot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Seconds) :*: S1 ('MetaSel ('Just "telemCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word))))

requestCounters :: IORef (HashMap (RequestDimensions, RunningTimeBucket) RequestTimingsCount) Source #

Internal. Counts and durations across many RequestDimensions.

NOTE: We use the global mutable variable pattern for metric collection counters for convenience at collection site (don't wear hairshirts that discourage useful reporting).

approxStartTime :: POSIXTime Source #

Internal. Since these metrics are accumulated while graphql-engine is running and sent periodically, we need to include a tag that is unique for each start of hge. This lets us e.g. query for just the latest uploaded sample for each start of hge.

We use time rather than a UUID since having this be monotonic increasing is convenient.

data QueryType Source #

Was this request a mutation (involved DB writes)?

Constructors

Mutation 
Query 

Instances

Instances details
Enum QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Eq QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep QueryType :: Type -> Type #

Hashable QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser QueryType

parseJSONList :: Value -> Parser [QueryType]

ToJSON QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

toJSON :: QueryType -> Value

toEncoding :: QueryType -> Encoding

toJSONList :: [QueryType] -> Value

toEncodingList :: [QueryType] -> Encoding

type Rep QueryType Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep QueryType = D1 ('MetaData "QueryType" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "Mutation" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Query" 'PrefixI 'False) (U1 :: Type -> Type))

data Locality Source #

Was this a PG local query, or did it involve remote execution?

Constructors

Empty

No data was fetched

Local

local DB data

Remote

remote schema

Heterogeneous

mixed

Instances

Instances details
Enum Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Eq Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep Locality :: Type -> Type #

Methods

from :: Locality -> Rep Locality x #

to :: Rep Locality x -> Locality #

Semigroup Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Monoid Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Hashable Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser Locality

parseJSONList :: Value -> Parser [Locality]

ToJSON Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

toJSON :: Locality -> Value

toEncoding :: Locality -> Encoding

toJSONList :: [Locality] -> Value

toEncodingList :: [Locality] -> Encoding

type Rep Locality Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep Locality = D1 ('MetaData "Locality" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) ((C1 ('MetaCons "Empty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Local" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Remote" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Heterogeneous" 'PrefixI 'False) (U1 :: Type -> Type)))

data Transport Source #

Was this a query over http or websockets?

Constructors

HTTP 
WebSocket 

Instances

Instances details
Enum Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Eq Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep Transport :: Type -> Type #

Hashable Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser Transport

parseJSONList :: Value -> Parser [Transport]

ToJSON Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

toJSON :: Transport -> Value

toEncoding :: Transport -> Encoding

toJSONList :: [Transport] -> Value

toEncodingList :: [Transport] -> Encoding

type Rep Transport Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep Transport = D1 ('MetaData "Transport" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "HTTP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WebSocket" 'PrefixI 'False) (U1 :: Type -> Type))

newtype RunningTimeBucket Source #

The timings and counts here were from requests with total time longer than $sel:bucketGreaterThan:RunningTimeBucket (but less than any larger bucket cutoff times).

Instances

Instances details
Eq RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep RunningTimeBucket :: Type -> Type #

Hashable RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

FromJSON RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser RunningTimeBucket

parseJSONList :: Value -> Parser [RunningTimeBucket]

ToJSON RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RunningTimeBucket Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep RunningTimeBucket = D1 ('MetaData "RunningTimeBucket" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'True) (C1 ('MetaCons "RunningTimeBucket" 'PrefixI 'True) (S1 ('MetaSel ('Just "bucketGreaterThan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Seconds)))

recordTimingMetric :: MonadIO m => RequestDimensions -> RequestTimings -> m () Source #

Save a timing metric sample in our in-memory store. These will be accumulated and uploaded periodically in Hasura.Server.Telemetry.

data ServiceTimingMetrics Source #

The final shape of this part of our metrics data JSON. This should allow reasonably efficient querying using GIN indexes and JSONB containment operations (which treat arrays as sets).

Constructors

ServiceTimingMetrics 

Fields

Instances

Instances details
Eq ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep ServiceTimingMetrics :: Type -> Type #

FromJSON ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser ServiceTimingMetrics

parseJSONList :: Value -> Parser [ServiceTimingMetrics]

ToJSON ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep ServiceTimingMetrics Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep ServiceTimingMetrics = D1 ('MetaData "ServiceTimingMetrics" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ServiceTimingMetrics" 'PrefixI 'True) (S1 ('MetaSel ('Just "collectionTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "serviceTimingMetrics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ServiceTimingMetric])))

data ServiceTimingMetric Source #

Instances

Instances details
Eq ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Ord ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Show ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Generic ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Associated Types

type Rep ServiceTimingMetric :: Type -> Type #

FromJSON ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

Methods

parseJSON :: Value -> Parser ServiceTimingMetric

parseJSONList :: Value -> Parser [ServiceTimingMetric]

ToJSON ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep ServiceTimingMetric Source # 
Instance details

Defined in Hasura.Server.Telemetry.Counters

type Rep ServiceTimingMetric = D1 ('MetaData "ServiceTimingMetric" "Hasura.Server.Telemetry.Counters" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ServiceTimingMetric" 'PrefixI 'True) (S1 ('MetaSel ('Just "dimensions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RequestDimensions) :*: (S1 ('MetaSel ('Just "bucket") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RunningTimeBucket) :*: S1 ('MetaSel ('Just "metrics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RequestTimingsCount))))