diff --git a/docs/graphql/manual/guides/telemetry.rst b/docs/graphql/manual/guides/telemetry.rst index ce723eb98aa..e820b14b97b 100644 --- a/docs/graphql/manual/guides/telemetry.rst +++ b/docs/graphql/manual/guides/telemetry.rst @@ -33,9 +33,9 @@ Server ~~~~~~ The server periodically sends the number of tables, views, relationships, -permission rules, event triggers and remote schemas tracked by GraphQL Engine, -along with randomly generated UUID per database and per instance. The -server version is also sent. +permission rules, custom SQL functions, event triggers and remote schemas +tracked by GraphQL Engine, along with randomly generated UUID per database and +per instance. The server version is also sent. Here is a sample row from the telemetry database: @@ -50,6 +50,7 @@ Here is a sample row from the telemetry database: "metrics": { "views": 1, "tables": 2, + "functions": 1, "permissions": { "roles": 1, "delete": 2, @@ -145,4 +146,4 @@ by the CLI at ``~/.hasura/.config.json`` to perisist the setting. Privacy Policy -------------- -You can check out our privacy policy `here `_. \ No newline at end of file +You can check out our privacy policy `here `_. diff --git a/server/src-lib/Hasura/Server/Telemetry.hs b/server/src-lib/Hasura/Server/Telemetry.hs index f55c6511e90..db5537abf3b 100644 --- a/server/src-lib/Hasura/Server/Telemetry.hs +++ b/server/src-lib/Hasura/Server/Telemetry.hs @@ -63,6 +63,7 @@ data Metrics , _mtPermissions :: !PermissionMetric , _mtEventTriggers :: !Int , _mtRemoteSchemas :: !Int + , _mtFunctions :: !Int } deriving (Show, Eq) $(A.deriveJSON (A.aesonDrop 3 A.snakeCase) ''Metrics) @@ -141,8 +142,9 @@ computeMetrics sc = evtTriggers = Map.size $ Map.filter (not . Map.null) $ Map.map tiEventTriggerInfoMap usrTbls rmSchemas = Map.size $ scRemoteResolvers sc + funcs = Map.size $ Map.filter (not . fiSystemDefined) $ scFunctions sc - in Metrics nTables nViews relMetrics permMetrics evtTriggers rmSchemas + in Metrics nTables nViews relMetrics permMetrics evtTriggers rmSchemas funcs where usrTbls = Map.filter (not . tiSystemDefined) $ scTables sc @@ -166,7 +168,7 @@ getDbId = Q.withQE defaultTxErrorHandler [Q.sql| SELECT (hasura_uuid :: text) FROM hdb_catalog.hdb_version - |] () False + |] () False -- | Logging related