code: def send_telemetry(func):
      """
      Decorator that sends the output of the wrapped function to PostHog.
      The wrapped function is actually called only if telemetry is enabled.
      """
  
      # FIXME? Somehow, functools.wraps makes `telemetry` out of scope. Let's take care of it later.
      def send_telemetry_wrapper(*args, **kwargs):
          try:
              if telemetry:
                  output = func(*args, **kwargs)
                  if output:
                      telemetry.send_event(*output)
          except Exception as e:
              # Never let telemetry break things
              logger.debug(
                  "There was an issue sending a telemetry event",
                  exc_info=e,
              )
  
      return send_telemetry_wrapper
  
file_path: haystack/haystack/telemetry/_telemetry.py
imports: from typing import Any, Dict, Optional, TYPE_CHECKING, List, Tuple
  import os
  from pathlib import Path
  from collections import defaultdict
  import datetime
  import logging
  import uuid
  import yaml
  import posthog
  from haystack.telemetry._environment import collect_system_specs
label_desc: Use image node_id 1 for calling a global function with example usage: send_telemetry(func) and returns: send_telemetry_wrapper