class_docstr: Haystack reports anonymous usage statistics to support continuous software improvements for all its users.
  
  You can opt-out of sharing usage statistics by manually setting the environment
  variable `HAYSTACK_TELEMETRY_ENABLED` as described for different operating systems on the
  [documentation page](https://docs.haystack.deepset.ai/docs/telemetry#how-can-i-opt-out).
  
  Check out the documentation for more details: [Telemetry](https://docs.haystack.deepset.ai/docs/telemetry).
class_docstr_tok: ["Haystack","reports","anonymous","usage","statistics","to","support","continuous","software","improvements","for","all","its","users",".","You","can","opt-out","of","sharing","usage","statistics","by","manually","setting","the","environment","variable","`","HAYSTACK_TELEMETRY_ENABLED","`","as","described","for","different","operating","systems","on","the","[","documentation","page","]","(","https",":","\/\/docs.haystack.deepset.ai\/docs\/telemetry","#","how-can-i-opt-out",")",".","Check","out","the","documentation","for","more","details",":","[","Telemetry","]","(","https",":","\/\/docs.haystack.deepset.ai\/docs\/telemetry",")","."]
docstr: Sends a telemetry event.
  
  :param event_name: The name of the event to show in PostHog.
  :param event_properties: Additional event metadata. These are merged with the
      system metadata collected in __init__, so take care not to overwrite them.
docstr_tok: ["Sends","a","telemetry","event",".",":","param","event_name",":","The","name","of","the","event","to","show","in","PostHog",".",":","param","event_properties",":","Additional","event","metadata",".","These","are","merged","with","the","system","metadata","collected","in","__init__",",","so","take","care","not","to","overwrite","them","."]
code: def send_event(
      self,
      event_name: str,
      event_properties: Optional[Dict[str, Any]] = None,
  ):
      """
      Sends a telemetry event.
  
      :param event_name: The name of the event to show in PostHog.
      :param event_properties: Additional event metadata. These are merged with the
          system metadata collected in __init__, so take care not to overwrite them.
      """
      event_properties = event_properties or {}
      try:
          posthog.capture(
              distinct_id=self.user_id,
              event=event_name,
              properties={**self.event_properties, **event_properties},
          )
      except Exception as e:
          logger.debug(
              "Telemetry couldn't make a POST request to PostHog.",
              exc_info=e,
          )
  
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 the Telemetry obj's underlying member method code with example usage: obj.send_event(event_name, event_properties) without return types