chore(ingest): update mixpanel api endpoint (#5750)

This commit is contained in:
Harshal Sheth 2022-08-27 18:02:53 -07:00 committed by GitHub
parent a6369d355b
commit d5547d0fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,7 @@ if any(var in os.environ for var in CI_ENV_VARS):
ENV_ENABLED = False ENV_ENABLED = False
TIMEOUT = int(os.environ.get("DATAHUB_TELEMETRY_TIMEOUT", "10")) TIMEOUT = int(os.environ.get("DATAHUB_TELEMETRY_TIMEOUT", "10"))
MIXPANEL_ENDPOINT = "track.datahubproject.io/mp"
MIXPANEL_TOKEN = "5ee83d940754d63cacbf7d34daa6f44a" MIXPANEL_TOKEN = "5ee83d940754d63cacbf7d34daa6f44a"
@ -113,7 +114,10 @@ class Telemetry:
if self.enabled: if self.enabled:
try: try:
self.mp = Mixpanel( self.mp = Mixpanel(
MIXPANEL_TOKEN, consumer=Consumer(request_timeout=int(TIMEOUT)) MIXPANEL_TOKEN,
consumer=Consumer(
request_timeout=int(TIMEOUT), api_host=MIXPANEL_ENDPOINT
),
) )
except Exception as e: except Exception as e:
logger.debug(f"Error connecting to mixpanel: {e}") logger.debug(f"Error connecting to mixpanel: {e}")
@ -214,7 +218,7 @@ class Telemetry:
}, },
) )
except Exception as e: except Exception as e:
logger.debug(f"Error reporting telemetry: {e}") logger.debug(f"Error initializing telemetry: {e}")
self.init_track = True self.init_track = True
def ping( def ping(