Exemple #1
0
def init_analytics():
    import analytics
    analytics_key = getattr(settings, 'SEGMENT_IO_KEY', None)
    if analytics_key:  # pragma: needs cover
        analytics.init(analytics_key, send=settings.IS_PROD, log=not settings.IS_PROD, log_level=logging.DEBUG)

    from temba.utils.analytics import init_librato
    librato_user = getattr(settings, 'LIBRATO_USER', None)
    librato_token = getattr(settings, 'LIBRATO_TOKEN', None)
    if librato_user and librato_token:  # pragma: needs cover
        init_librato(librato_user, librato_token)
Exemple #2
0
def init_analytics():
    import analytics
    analytics_key = getattr(settings, 'SEGMENT_IO_KEY', None)
    if analytics_key:
        analytics.init(analytics_key, send=settings.IS_PROD, log=not settings.IS_PROD, log_level=logging.DEBUG)

    from temba.utils.analytics import init_librato
    librato_user = getattr(settings, 'LIBRATO_USER', None)
    librato_token = getattr(settings, 'LIBRATO_TOKEN', None)
    if librato_user and librato_token:
        init_librato(librato_user, librato_token)
Exemple #3
0
def init_analytics():
    import analytics

    analytics.send = False  #settings.IS_PROD
    analytics.debug = True  #not settings.IS_PROD

    analytics_key = getattr(settings, 'SEGMENT_IO_KEY', '')

    if settings.IS_PROD and not analytics_key and False:
        raise ValueError('SEGMENT.IO analytics key is required for production'
                         )  # pragma: no cover

    analytics.write_key = analytics_key

    from temba.utils.analytics import init_librato
    librato_user = getattr(settings, 'LIBRATO_USER', None)
    librato_token = getattr(settings, 'LIBRATO_TOKEN', None)
    if librato_user and librato_token:  # pragma: needs cover
        init_librato(librato_user, librato_token)