jessepollak / mixpanel-python-async

:zap: Batch and send your Mixpanel API calls asynchronously in Python
Other
59 stars 16 forks source link

Some events are being dropped #14

Open skorokithakis opened 7 years ago

skorokithakis commented 7 years ago

I am using the lib for a project of mine, and I noticed some events are being dropped. I added printing calls to the official Mixpanel lib (that MPA uses) and used the following code:

            mp.track(str(request.user.pk), "changed settings")
            mp.people_set(str(user.pk), {
                "$email": user.email,
                "$name": user.name,
                "$ip": request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR')).split(',')[-1].strip(),
                "username": user.username,
            })
            mp.track(str(request.user.pk), "changed settings 2")

What came out was:

web_1        | {'data': b'[{"properties":{"distinct_id":"21","token":"decoded this from base64 to redact the token","time":1508248513,"$lib_version":"4.3.2","mp_lib":"python"},"event":"changed settings"}]'
, 'verbose': 1, 'ip': 0}
web_1        | 172.26.0.5 - - [17/Oct/2017 13:55:13] "POST /settings/ HTTP/1.1" 302 -

And that's it. Even after minutes, nothing else is sent. I'm using runserver_plus to run this, but it also happens on production with uWSGI. You will notice that only the first event got sent, and all subsequent events are lost.

prafulbagai commented 3 years ago

I too am facing this. Were you able to resolve this @skorokithakis ?

skorokithakis commented 3 years ago

Hmm, no, I think in the end I just switched to the sync library.

prafulbagai commented 3 years ago

Guess, I have to do the same. :(

martin-thoma commented 2 years ago

I've just noticed that I cannot see the events when I set api_host="api-eu.mixpanel.com". I don't understand why.