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

Hasura.Server.Telemetry

Description

Send anonymized metrics to the telemetry server regarding usage of various features of Hasura.

The general workflow for telemetry is as follows:

  1. We generate metrics for each backend in the graphql-engine code and send it to telemetryUrl. The relevant types can be found in Hasura.Server.Telemetry.Types.
  2. The telemetryUrl endpoint is handled by code in: https://github.com/hasura/hasura-analytics/tree/hge-upgrade, specifically manager/main.go and manager/analytics.go. This server endpoint receives the telemetry payload and sends it to another graphql-engine which runs locally and is backed by a postgres database. The database schema for the telemetry endpoint can also be found in the same repo under hge/migrations/.
  3. The information from the postgres db can be viewed in Metabase: https://metabase.telemetry.hasura.io/browse/2/schema/public.

For more information about telemetry in general, visit the user-facing docs on the topic: https://hasura.io/docs/latest/graphql/core/guides/telemetry.

Synopsis

Logging and error handling

mkTelemetryLog :: Text -> Text -> Maybe TelemetryHttpError -> TelemetryLog Source #

Endpoint

Execution

runTelemetry Source #

Arguments

:: forall m impl. (MonadIO m, HasAppEnv m) 
=> Logger Hasura 
-> AppStateRef impl

an action that always returns the latest schema cache ref

-> MetadataDbId 
-> PGVersion 
-> ComputeResourcesResponse 
-> m Void 

An infinite loop that sends updated telemetry data (Metrics) every 24 hours. The send time depends on when the server was started and will naturally drift.

Generate metrics