def analytics_ping(app): """ Note: telemetry can be disabled by including TELEMETRY_DISABLED in your user # config.json. """ try: telemetry_uuid = "" # get UUID if it exists if "TELEMETRY_UUID" in app.config: telemetry_uuid = app.config["TELEMETRY_UUID"] else: telemetry_uuid = str(uuid.uuid4()) write_config(app, "TELEMETRY_UUID", telemetry_uuid) data = {"user_uuid": telemetry_uuid, "active": check_active(app)} requests.post("https://analytics.orchest.io", json=data, timeout=1) logging.info("Sending TELEMETRY ping: %s" % data) except Exception as e: logging.warning("Exception while sending telemetry request %s" % e)
def _get_telemetry_uuid(app: Flask) -> str: telemetry_uuid = app.config.get("TELEMETRY_UUID") if telemetry_uuid is None: telemetry_uuid = str(uuid.uuid4()) write_config(app, "TELEMETRY_UUID", telemetry_uuid) return telemetry_uuid
def get_telemetry_uuid(app): # get UUID if it exists if "TELEMETRY_UUID" in app.config: telemetry_uuid = app.config["TELEMETRY_UUID"] else: telemetry_uuid = str(uuid.uuid4()) write_config(app, "TELEMETRY_UUID", telemetry_uuid) return telemetry_uuid
def analytics_ping(app): try: logging.info("Sending TELEMETRY ping.") telemetry_uuid = "" # get UUID if it exists if "TELEMETRY_UUID" in app.config: telemetry_uuid = app.config["TELEMETRY_UUID"] else: telemetry_uuid = str(uuid.uuid4()) write_config(app, "TELEMETRY_UUID", telemetry_uuid) requests.post("https://analytics.orchest.io", json={"user_uuid": telemetry_uuid}, timeout=1) except Exception as e: logging.warning("Exception while sending telemetry request %s" % e)