mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-15 18:13:18 +08:00
Add option `USE_TELEMETRY` that can be used to exclude telemetry from the compile. Telemetry-specific SQL is moved, which is only included when extension is compiled with telemetry and the notice is changed so that the message about telemetry is not printed when Telemetry is not compiled in. The following code is not compiled in when telemetry is not used: - Cross-module functions for telemetry. - Checks for telemetry job in job execution. - GUC variables `telemetry_level` and `telemetry_cloud`. Telemetry subsystem is not included when compiling without telemetry, which requires some functions to be moved out of the telemetry subsystem: - Metadata handling is moved out of the telemetry module since it is used not only with telemetry. - UUID functions are moved into a separate module instead of being part of the telemetry subsystem. - Telemetry functions are either added or removed when updating from a previous version. Tests are updated to: - Not use telemetry functions to get UUID or Metadata and instead use the moved UUID and metadata functions. - Not include telemetry information in tests that do not require it. - Configuration files do not set telemetry variables when telemetry is not compiled in. - Replaced usage of telemetry functions in non-telemetry tests with other sources of same information. Fixes #3931
12 lines
701 B
SQL
12 lines
701 B
SQL
-- This file and its contents are licensed under the Apache License 2.0.
|
|
-- Please see the included NOTICE for copyright information and
|
|
-- LICENSE-APACHE for a copy of the license.
|
|
|
|
CREATE OR REPLACE FUNCTION @extschema@.get_telemetry_report() RETURNS jsonb
|
|
AS '@MODULE_PATHNAME@', 'ts_telemetry_get_report_jsonb'
|
|
LANGUAGE C STABLE PARALLEL SAFE;
|
|
|
|
INSERT INTO _timescaledb_config.bgw_job (id, application_name, schedule_interval, max_runtime, max_retries, retry_period, proc_schema, proc_name, owner, scheduled) VALUES
|
|
(1, 'Telemetry Reporter [1]', INTERVAL '24h', INTERVAL '100s', -1, INTERVAL '1h', '_timescaledb_internal', 'policy_telemetry', CURRENT_ROLE, true)
|
|
ON CONFLICT (id) DO NOTHING;
|