You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/aggregation-property.md
+265Lines changed: 265 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -902,6 +902,271 @@ Coming soon...
902
902
903
903
</Tabs>
904
904
905
+
### Path Filter
906
+
907
+
The `pathFilter` option lets you control which entities are included in your aggregation calculation based on their relationship path from the source entity. This is useful for complex relationship chains, where you may want to aggregate data only from entities connected through specific paths.
908
+
909
+
When a `pathFilter` is defined, Port will include only entities that can be reached through the exact relationship path you specify.
Count Jira issues directly related to a Microservice:
957
+
958
+
```json
959
+
{
960
+
"identifier": "microservice",
961
+
"title": "Microservice",
962
+
"aggregationProperties": {
963
+
"directJiraIssuesCount": {
964
+
"title": "Direct Jira Issues Count",
965
+
"target": "jiraIssue",
966
+
"pathFilter": [
967
+
{
968
+
"path": ["jira_issue_rel"]
969
+
}
970
+
],
971
+
"calculationSpec": {
972
+
"calculationBy": "entities",
973
+
"func": "count"
974
+
}
975
+
}
976
+
}
977
+
}
978
+
```
979
+
980
+
The `"path": ["jira_issue_rel"]` ensures that only Jira issues directly related to the microservice through the `jira_issue_rel` relation are counted.
981
+
982
+
<h4> Example 2: Multi-hop Relationship Path</h4>
983
+
984
+
Count deployments through Service → Microservice → Deployment
985
+
986
+
```json
987
+
{
988
+
"identifier": "service",
989
+
"title": "Service",
990
+
"aggregationProperties": {
991
+
"deploymentCount": {
992
+
"title": "Deployment Count",
993
+
"target": "deployment",
994
+
"pathFilter": [
995
+
{
996
+
"path": ["microservice_rel", "deployment_rel"]
997
+
}
998
+
],
999
+
"calculationSpec": {
1000
+
"calculationBy": "entities",
1001
+
"func": "count"
1002
+
}
1003
+
}
1004
+
}
1005
+
}
1006
+
```
1007
+
1008
+
The `pathFilter` with `"path": ["microservice_rel", "deployment_rel"]` counts deployments that are connected through the `microservice_rel` relation first, then to the `deployment_rel` relation.
1009
+
1010
+
<h4>Example 3: Starting Path from Specific Blueprint</h4>
1011
+
1012
+
Count deployments by starting path traversal from the target blueprint:
1013
+
1014
+
```json
1015
+
{
1016
+
"identifier": "service",
1017
+
"title": "Service",
1018
+
"aggregationProperties": {
1019
+
"deploymentCountFromService": {
1020
+
"title": "Deployment Count from Service",
1021
+
"target": "deployment",
1022
+
"pathFilter": [
1023
+
{
1024
+
"path": ["microservice_rel", "deployment_rel"],
1025
+
"fromBlueprint": "deployment"
1026
+
}
1027
+
],
1028
+
"calculationSpec": {
1029
+
"calculationBy": "entities",
1030
+
"func": "count"
1031
+
}
1032
+
}
1033
+
}
1034
+
}
1035
+
```
1036
+
1037
+
The `fromBlueprint: "deployment"` specifies that the path traversal should start from the deployment blueprint (the target), then follow the path backwards through `microservice_rel` to service.
1038
+
1039
+
</TabItem>
1040
+
1041
+
<TabItemvalue="tf">
1042
+
1043
+
<h4> Example 1: Direct Relationship Path</h4>
1044
+
1045
+
Count Jira issues directly related to a Microservice:
The `path = ["microservice_rel", "deployment_rel"]` counts deployments that are connected through the `microservice_rel` relation first, then to the `deployment_rel` relation.
1118
+
1119
+
<h4>Example 3: Starting Path from Specific Blueprint</h4>
1120
+
1121
+
Count deployments by starting path traversal from the target blueprint:
The `from_blueprint = "deployment"` specifies that the path traversal should start from the deployment blueprint (the target), then follow the path backwards through `microservice_rel` to service.
1162
+
1163
+
</TabItem>
1164
+
1165
+
</Tabs>
1166
+
1167
+
:::tip Path Filter Performance
1168
+
Path filters can affect the performance of aggregation calculations. In general, shorter and more direct paths perform better than long or complex multi-hop paths.
0 commit comments