code: def pipeline_running(
      pipeline: "Pipeline",
  ) -> Optional[Tuple[str, Dict[str, Any]]]:
      """
      Collects name, type and the content of the _telemetry_data attribute, if present, for each component in the
      pipeline and sends such data to Posthog.
  
      :param pipeline: the pipeline that is running.
      """
      pipeline._telemetry_runs += 1
      if (
          pipeline._last_telemetry_sent
          and (
              datetime.datetime.now() - pipeline._last_telemetry_sent
          ).seconds
          < MIN_SECONDS_BETWEEN_EVENTS
      ):
          return None
  
      pipeline._last_telemetry_sent = datetime.datetime.now()
  
      # Collect info about components
      pipeline_description = pipeline.to_dict()
      components: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
      for component_name, component in pipeline_description[
          "components"
      ].items():
          instance = pipeline.get_component(component_name)
          if hasattr(instance, "_get_telemetry_data"):
              telemetry_data = getattr(
                  instance, "_get_telemetry_data"
              )()
              try:
                  components[component["type"]].append(
                      {"name": component_name, **telemetry_data}
                  )
              except TypeError:
                  components[component["type"]].append(
                      {"name": component_name}
                  )
          else:
              components[component["type"]].append(
                  {"name": component_name}
              )
  
      # Data sent to Posthog
      return "Pipeline run (2.x)", {
          "pipeline_id": str(id(pipeline)),
          "runs": pipeline._telemetry_runs,
          "components": components,
      }
  
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 2 for calling a global function with example usage: pipeline_running(pipeline) and returns: str,  dict, None