{"id":29670430,"url":"https://github.com/percona/percona_pg_telemetry","last_synced_at":"2025-07-22T19:36:15.837Z","repository":{"id":230107573,"uuid":"778529976","full_name":"percona/percona_pg_telemetry","owner":"percona","description":"Percona telemetry extension for PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-07-18T10:24:32.000Z","size":152,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-07-18T10:32:39.941Z","etag":null,"topics":["percona","percona-distribution","pg","postgresql","telemetry","telemetry-collection"],"latest_commit_sha":null,"homepage":"https://docs.percona.com/postgresql/17/telemetry.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/percona.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-27T22:21:51.000Z","updated_at":"2025-07-18T06:29:48.000Z","dependencies_parsed_at":"2024-03-27T22:28:18.316Z","dependency_job_id":"76d728b9-6c52-4c47-843d-22bbf8d7ce3d","html_url":"https://github.com/percona/percona_pg_telemetry","commit_stats":null,"previous_names":["percona-lab/pg_percona_telemetry","percona/percona_pg_telemetry"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/percona/percona_pg_telemetry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percona%2Fpercona_pg_telemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percona%2Fpercona_pg_telemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percona%2Fpercona_pg_telemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percona%2Fpercona_pg_telemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/percona","download_url":"https://codeload.github.com/percona/percona_pg_telemetry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percona%2Fpercona_pg_telemetry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266561555,"owners_count":23948632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["percona","percona-distribution","pg","postgresql","telemetry","telemetry-collection"],"created_at":"2025-07-22T19:36:15.196Z","updated_at":"2025-07-22T19:36:15.828Z","avatar_url":"https://github.com/percona.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![postgresql-12-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-12-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-12-build.yml)\n[![postgresql-13-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-13-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-13-build.yml)\n[![postgresql-14-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-14-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-14-build.yml)\n[![postgresql-15-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-15-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-15-build.yml)\n[![postgresql-16-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-16-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-16-build.yml)\n[![postgresql-17-build](https://github.com/percona/percona_pg_telemetry/actions/workflows/postgresql-17-build.yml/badge.svg)](https://github.com/Percona-Lab/percona_pg_telemetry/actions/workflows/postgresql-17-build.yml)\n\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/percona/percona_pg_telemetry/badge)](https://scorecard.dev/viewer/?uri=github.com/percona/percona_pg_telemetry)\n[![Forum](https://img.shields.io/badge/Forum-join-brightgreen)](https://forums.percona.com/)\n\n# Percona Telemetry Extension for PostgreSQL\n\nWelcome to `percona_pg_telemetry` - extension for Percona telemetry data collection for PostgreSQL!\n\n## Overview\n\nThe extenions it be provided with the Percona distribution. The extension, at no point in time, collects, maintains, or sends any user personal/identifiable/sensitive data.\n\n### Configuration\n\nYou can find the configuration parameters of the `percona_pg_telemetry` extension in the `pg_settings` view by filtering `name` column with `percona_pg_telemetry` prefix. To change the default configuration, specify new values for the desired parameters using the GUC (Grand Unified Configuration) system. Alternatively, values may be changed by a superuser either at the server start time or via `ALTER SYSTEM` command followed `SELECT pg_reload_conf();` statement.\n\n#### Parameters\n\n1. `percona_pg_telemetry.enabled`\n\n  * Default: true\n  * Unit: boolean\n  * When set to `false`, the leader process terminates when the configuration is read.\n\n2. `percona_pg_telemetry.path`\n\n  * Default: /usr/local/percona/telemetry/pg\n\n3. `percona_pg_telemetry.scrape_interval`\n\n  * Default: 86,400 (24 hours)\n  * Unit: s\n  * It is configured to wakeup the leader process every 24 hours by default. The leader\n    may be woken up by a configuration reload interrupt or when the shutdown process is\n    initiated.\n\n4. `percona_pg_telemetry.files_to_keep`\n\n  * Default: 7\n  * Unit: Integer\n  * It forces the extension to maintain upto this number of files. Older files will get\n    removed and new files will be created.\n\n\u003e **NOTE** GUCs 3 - 4 are only visible if environment variable PT_DEBUG is set. This is prevent users in production environment to change these variables which are only for testing purposes.\n\n#### Functions\n\n1. `percona_pg_telemetry_version()`\n\n  * Outputs the version of the extension.\n\n2. `percona_pg_telemetry_status()`\n\n  * OUT: latest_output_filename   - TEXT\n    - Path of the JSON output file.\n  * OUT: pt_enabled               - BOOLEAN\n    - True if telemetry data collection is enabled.\n\n\u003e **NOTE** Functions are only visible after you have created the extension using the 'CREATE EXTENSION percona_pg_telemetry;' command.\n\n### Setup\n\nYou can enable `percona_pg_telemetry` when your `postgresql` instance is not running.\n\n`percona_pg_telemetry` needs to be loaded at the start time. The extension requires additional shared memory; therefore,  add the `percona_pg_telemetry` value for the `shared_preload_libraries` parameter and restart the `postgresql` instance.\n\nUse the [ALTER SYSTEM](https://www.postgresql.org/docs/current/sql-altersystem.html) command from `psql` terminal to modify the `shared_preload_libraries` parameter.\n\n```sql\nALTER SYSTEM SET shared_preload_libraries = 'percona_pg_telemetry';\n```\n\n\u003e **NOTE**: If you’ve added other modules to the `shared_preload_libraries` parameter (for example, `pg_stat_monitor`), list all of them separated by commas for the `ALTER SYSTEM` command.\n\nStart or restart the `postgresql` instance to apply the changes.\n\nCreate the extension using the [CREATE EXTENSION](https://www.postgresql.org/docs/current/sql-createextension.html) command. Using this command requires the privileges of a superuser or a database owner. Connect to `psql` as a superuser for a database and run the following command:\n\n\n```sql\nCREATE EXTENSION percona_pg_telemetry;\n```\n\n\nThis allows you to see the stats collected by `percona_pg_telemetry`.\n\nBy default, `percona_pg_telemetry` is created for the `postgres` database. To access its functions in other databases, you need to create the extension for every required database.\n\n### Building from source\n\nTo build `percona_pg_telemetry` from source code, you require the following:\n\n* git\n* make\n* gcc\n* postgresql-devel | postgresql-server-dev-all\n\n\nYou can download the source code of the latest release of `percona_pg_telemetry` from [the releases page on GitHub](https://github.com/percona/percona_pg_telemetry/releases) or using git:\n\n```\ngit clone git://github.com/percona/percona_pg_telemetry.git\n```\n\nCompile and install the extension\n\n```\ncd percona_pg_telemetry\nmake\nmake install\n```\n\nTo run the associated regression tests, a make target is available. ```make installcheck``` is deliberately disabled as the preload configuration may not be set for installed servers.\n\n```\nmake check\n```\n\n### Uninstall `percona_pg_telemetry`\n\nTo uninstall `percona_pg_telemetry`, do the following:\n\n1. Disable telemetry data collection. From the `psql` terminal or another similar client, run the following command:\n\n    ```sql\n    ALTER SYSTEM SET percona_pg_telemetry.enabled = 0;\n    SELECT pg_reload_conf();\n    ```\n**NOTE**: This will cause the leader process to exit. To restart the leader process, ensure that `percona_pg_telemetry.enabled = 1`, and then restart the database server process.\n\n2. Drop `percona_pg_telemetry` extension:\n\n    ```sql\n    DROP EXTENSION percona_pg_telemetry;\n    ```\n\n3. Remove `percona_pg_telemetry` from the `shared_preload_libraries` configuration parameter:\n\n    ```sql\n    ALTER SYSTEM SET shared_preload_libraries = '';\n    ```\n\n    **Important**: If the `shared_preload_libraries` parameter includes other modules, specify them all for the `ALTER SYSTEM SET` command to keep using them.\n\n4. Restart the `postgresql` instance to apply the changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona%2Fpercona_pg_telemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercona%2Fpercona_pg_telemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona%2Fpercona_pg_telemetry/lists"}