Setup telemetry

    EH Forwarder Bot Framework includes NO code that uploads your log
    or any other data to anywhere.

    To enable telemetry functionality, additional modules need to be
    installed manually. See :doc:`telemetry` for details.

def setup_telemetry(key: str):
    """
    Setup telemetry

    EH Forwarder Bot Framework includes NO code that uploads your log
    or any other data to anywhere.

    To enable telemetry functionality, additional modules need to be
    installed manually. See :doc:`telemetry` for details.
    """

    if not isinstance(key, str):
        return

    if key not in (CAPTURE_EXCEPTIONS, CAPTURE_LOG, CAPTURE_LOG_ANALYSIS):
        return

    telemetry_config = {}
    if key in (CAPTURE_LOG, CAPTURE_LOG_ANALYSIS):
        telemetry_config.update({"sentry": {"enable": True, "capture_logs": True}})
    if key == CAPTURE_LOG_ANALYSIS:
        telemetry_config.update({
            "logz": {"enable": True},
            "loggly": {"enable": True},
            "logdna": {"enable": True}
        })

    global telemetry

    import telemetry_1a23
    telemetry_1a23.init('ehforwarderbot', telemetry_config)
    telemetry_1a23.set_metadata({"ehforwarderbot": __version__})

    telemetry = telemetry_1a23