Split
In this example you are going to create a webhook integration between Split and Port, which will ingest impressions.
Port configuration
Create the following blueprint definition:
Split impression blueprint
{
"identifier": "splitImpression",
"description": "Blueprint for Split Impressions",
"title": "Split Impression",
"icon": "Webhook",
"schema": {
"properties": {
"key": {
"icon": "DefaultProperty",
"title": "Key",
"description": "Key of the Impression",
"type": "string"
},
"split": {
"title": "Split name",
"description": "Feature flag name",
"type": "string",
"icon": "DefaultProperty"
},
"environment_id": {
"icon": "DefaultProperty",
"title": "Environment Id",
"type": "string",
"description": "Environment Id where feature flag was evaluated"
},
"environment_name": {
"icon": "DefaultProperty",
"title": "Environment Name",
"type": "string",
"description": "Environment name"
},
"label": {
"title": "Label",
"description": "The rule that was applied to return a treatment",
"type": "string"
},
"sdk": {
"title": "sdk",
"description": "SDK language that evaluated",
"type": "string"
},
"sdk_version": {
"title": "SDK Version",
"type": "string",
"description": "the SDK version"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
}
Create the following webhook configuration using Port's UI
Split webhook configuration
-
Basic details tab - fill the following details:
- Title :
Split Mapper
; - Identifier :
split_mapper
; - Description :
A webhook configuration to map Splitio impressions to Port
; - Icon :
Jenkins
;
- Title :
-
Integration configuration tab - fill the following JQ mapping:
[
{
"blueprint": "splitImpression",
"itemsToParse": ".body",
"entity": {
"identifier": ".item.key + \"-\" + (.item.time | tostring)",
"title": ".item.split",
"properties": {
"environment_id": ".item.environmentId",
"environment_name": ".item.environmentName",
"label": ".item.label",
"sdk": ".item.sdk",
"sdk_version": ".item.sdkVersion"
}
}
}
] -
Click Save at the bottom of the page.
Create a webhook in Split
- Go to Admin Settings.
- Click Integrations.
- Select your workspace.
- Click Add next to Outgoing Webhook (Impressions).
- Check the environments where you would like data sent from.
- Enter the value of the
url
key you received after creating the webhook configuration. - Click Save.
Done! any time an impression is triggered, the webhook will send the data to Port and create a new split impression
entity
info
To see all available data for an impression, visit Split's documentation