Merge pull request #9650 from edx/gabe/fix-backend-order

Fix order of tracking backends
This commit is contained in:
Gabe Mulley
2015-09-17 15:01:15 -04:00
5 changed files with 17 additions and 9 deletions

View File

@@ -293,8 +293,8 @@ BROKER_URL = "{0}://{1}:{2}@{3}/{4}".format(CELERY_BROKER_TRANSPORT,
# Event tracking
TRACKING_BACKENDS.update(AUTH_TOKENS.get("TRACKING_BACKENDS", {}))
EVENT_TRACKING_BACKENDS['tracking_logs']['OPTIONS']['backends'].update(AUTH_TOKENS.get("EVENT_TRACKING_BACKENDS", {}))
EVENT_TRACKING_BACKENDS['segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whitelist'].extend(
EVENT_TRACKING_BACKENDS['0_tracking_logs']['OPTIONS']['backends'].update(AUTH_TOKENS.get("EVENT_TRACKING_BACKENDS", {}))
EVENT_TRACKING_BACKENDS['1_segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whitelist'].extend(
AUTH_TOKENS.get("EVENT_TRACKING_SEGMENTIO_EMIT_WHITELIST", []))
SUBDOMAIN_BRANDING = ENV_TOKENS.get('SUBDOMAIN_BRANDING', {})

View File

@@ -828,8 +828,12 @@ TRACKING_BACKENDS = {
TRACKING_IGNORE_URL_PATTERNS = [r'^/event', r'^/login', r'^/heartbeat']
EVENT_TRACKING_ENABLED = True
# NOTE: the sort order of the backend names is important here, the events will be sent to the backends in sorted
# order. In this case a processor modifies the event in a way that is only intended to be seen by segment.io, so
# we want to make sure that backend and processor is run *after* the event has been sent to the tracking logs.
EVENT_TRACKING_BACKENDS = {
'tracking_logs': {
'0_tracking_logs': {
'ENGINE': 'eventtracking.backends.routing.RoutingBackend',
'OPTIONS': {
'backends': {
@@ -847,7 +851,7 @@ EVENT_TRACKING_BACKENDS = {
]
}
},
'segmentio': {
'1_segmentio': {
'ENGINE': 'eventtracking.backends.routing.RoutingBackend',
'OPTIONS': {
'backends': {