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
+216Lines changed: 216 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -902,6 +902,222 @@ 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.
910
+
911
+
-**Forwards path →**
912
+
Following relations forwards, from the source of a relation to its target (e.g., from a repository to its services).
913
+
-**Backwards path ←**
914
+
Following relations backwards, from the target of a relation to its source (e.g., from a service back to its repository).
|`pathFilter.path`| An array containing the full path of relation identifiers to traverse. |
921
+
|`pathFilter.fromBlueprint`|*(Optional)* The blueprint to start the path traversal from. Can be the target blueprint or omitted. If omitted, traversal starts from the source blueprint. |
**Example 1: Standard Path Filter - forwards path**
965
+
966
+
Count how many deployments are directly related to a cluster:
967
+
968
+
```json
969
+
{
970
+
"identifier": "cluster",
971
+
"title": "Cluster",
972
+
"aggregationProperties": {
973
+
"deploymentCount": {
974
+
"title": "Deployment Count",
975
+
"target": "deployment",
976
+
"pathFilter": [
977
+
{
978
+
"path": ["deployments_relation"]
979
+
}
980
+
],
981
+
"calculationSpec": {
982
+
"calculationBy": "entities",
983
+
"func": "count"
984
+
}
985
+
}
986
+
}
987
+
}
988
+
```
989
+
990
+
The `pathFilter` with `"path": ["deployments_relation"]` counts deployments that are directly related to the cluster through the `deployments_relation` relation.
991
+
992
+
**Example 2: Using fromBlueprint - backwards path**
993
+
994
+
Count how many clusters are related to a deployment:
995
+
996
+
```json
997
+
{
998
+
"identifier": "deployment",
999
+
"title": "Deployment",
1000
+
"aggregationProperties": {
1001
+
"clusterCount": {
1002
+
"title": "Cluster Count",
1003
+
"target": "cluster",
1004
+
"pathFilter": [
1005
+
{
1006
+
"path": ["deployments_relation"],
1007
+
"fromBlueprint": "cluster"
1008
+
}
1009
+
],
1010
+
"calculationSpec": {
1011
+
"calculationBy": "entities",
1012
+
"func": "count"
1013
+
}
1014
+
}
1015
+
}
1016
+
}
1017
+
```
1018
+
1019
+
The `fromBlueprint: "cluster"` specifies that the path traversal should start from the cluster blueprint (the target), then follow the path backwards through `deployments_relation` to deployment.
1020
+
1021
+
</TabItem>
1022
+
1023
+
<TabItemvalue="tf">
1024
+
1025
+
**Example 1: Standard Path Filter - forwards path**
1026
+
1027
+
Count how many deployments are directly related to a cluster:
The `from_blueprint = "cluster"` specifies that the path traversal should start from the cluster blueprint (the target), then follow the path backwards through `deployments_relation` to deployment.
1113
+
1114
+
</TabItem>
1115
+
1116
+
</Tabs>
1117
+
1118
+
:::tip Path Filter Performance
1119
+
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