Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Send anonymized metrics to the telemetry server regarding usage of various features of Hasura.
The general workflow for telemetry is as follows:
- 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. - 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/. - 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
- mkTelemetryLog :: Text -> Text -> Maybe TelemetryHttpError -> TelemetryLog
- runTelemetry :: forall m impl. (MonadIO m, HasAppEnv m) => Logger Hasura -> AppStateRef impl -> MetadataDbId -> PGVersion -> ComputeResourcesResponse -> m Void
Logging and error handling
Endpoint
Execution
:: 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.