Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make atomic field limits configurable #850

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

pondzix
Copy link
Contributor

@pondzix pondzix commented Jan 19, 2024

This PR adds new configuration section which allows us to set custom length limits for atomic fields. Previously those limits were hardcoded in enrich code with values equal to the ones in the atomic schema.

New configuration looks like this:

{
  ...
  
  # Optional. Configuration section for various validation-oriented settings.
  "validation": {
   
    # Optional. Configuration for custom maximum atomic fields (strings) length.
    # Map-like structure with keys being field names and values being their max allowed length

    "atomicFieldsLimits": {
        "app_id": 5
        "mkt_clickid": 100000
        # ...and any other 'atomic' field with custom limit
    }
  }
}

with defaults set in application.conf:

Note: page_url, page_referrer and mkt_clickid have now increased limit by default!

{
  ...
  "validation": {
    "atomicFieldsLimits": { 
       "app_id": 255
       "platform": 255
       "event": 128
       "event_id": 36
       "name_tracker": 128
       "v_tracker": 100
       "v_collector": 100
       "v_etl": 100
       "user_id": 255
       "user_ipaddress": 128
       "user_fingerprint": 128
       "domain_userid": 128
       "network_userid": 128
       "geo_country": 2
       "geo_region": 3
       "geo_city": 75
       "geo_zipcode": 15
       "geo_region_name": 100
       "ip_isp": 100
       "ip_organization": 128
       "ip_domain": 128
       "ip_netspeed": 100
       "page_url": 10000 # Different than the one in atomic schema (4096)
       "page_title": 2000
       "page_referrer": 10000 # Different than the one in atomic schema (4096)
       "page_urlscheme": 16
       "page_urlhost": 255
       "page_urlpath": 3000
       "page_urlquery": 6000
       "page_urlfragment": 3000
       "refr_urlscheme": 16
       "refr_urlhost": 255
       "refr_urlpath": 6000
       "refr_urlquery": 6000
       "refr_urlfragment": 3000
       "refr_medium": 25
       "refr_source": 50
       "refr_term": 255
       "mkt_clickid": 1000 # Different than the one in atomic schema (128)
       "mkt_network": 64
       "mkt_medium": 255
       "mkt_source": 255
       "mkt_term": 255
       "mkt_content": 500
       "mkt_campaign": 255
       "se_category": 1000
       "se_action": 1000
       "se_label": 4096
       "se_property": 1000
       "tr_orderid": 255
       "tr_affiliation": 255
       "tr_city": 255
       "tr_state": 255
       "tr_country": 255
       "ti_orderid": 255
       "ti_sku": 255
       "ti_name": 255
       "ti_category": 255
       "useragent": 1000
       "br_name": 50
       "br_family": 50
       "br_version": 50
       "br_type": 50
       "br_renderengine": 50
       "br_lang": 255
       "br_colordepth": 12
       "os_name": 50
       "os_family": 50
       "os_manufacturer": 50
       "os_timezone": 255
       "dvce_type": 50
       "doc_charset": 128
       "tr_currency": 3
       "ti_currency": 3
       "base_currency": 3
       "geo_timezone": 64
       "etl_tags": 500
       "refr_domain_userid": 128
       "domain_sessionid": 128
       "event_vendor": 1000
       "event_name": 1000
       "event_format": 128
       "event_version": 128
       "event_fingerprint": 128
    }
  }
}

@pondzix pondzix force-pushed the configurable_atomic_field_limits branch from 0e2efb9 to 5edcaa2 Compare January 19, 2024 09:13
Copy link
Contributor

@istreeter istreeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

Copy link
Contributor

@benjben benjben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pondzix pondzix force-pushed the configurable_atomic_field_limits branch from b13dc68 to 304df4e Compare January 23, 2024 12:09
@pondzix pondzix merged commit 304df4e into develop Jan 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants