1.20.x telemetry.api.php hook_telemetry_info_alter(array &$info)

Alter the list of data collected by Telemetry.

Parameters

array $info: A list of telemetry data to be collected. Keyed as described in hook_telemetry_info(). In addition to the keys there, the following additional keys are added prior to this hook being invoked:

  • module: The machine-name of the providing module for this bit of data.

Related topics

File

modules/telemetry/telemetry.api.php, line 50
Hooks provided by the Telemetry module.

Code

function hook_telemetry_info_alter(array &$info) {
  // Prevent this site from reporting server OS:
  unset($info['server_os']);

  // Prevent one particular module from reporting anything.
  foreach ($info as $info_key => $info_data) {
    if ($info_data['module'] === 'mymodule') {
      unset($info[$info_key]);
    }
  }
}