Skip to content

Commit 48f3c04

Browse files
committed
feat: add batch check attribute
1 parent b7484e6 commit 48f3c04

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/main/java/dev/openfga/sdk/api/OpenFgaApi.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,15 @@ private Map<Attribute, String> buildTelemetryAttributes(Map<String, Object> attr
11491149
Attributes.FGA_CLIENT_REQUEST_MODEL_ID, writeRequest.getAuthorizationModelId());
11501150
}
11511151
}
1152+
1153+
if (body instanceof BatchCheckRequest) {
1154+
BatchCheckRequest batchCheckRequest = (BatchCheckRequest) body;
1155+
1156+
if (batchCheckRequest.getChecks() != null) {
1157+
telemetryAttributes.put(
1158+
Attributes.FGA_CLIENT_REQUEST_BATCH_CHECK_SIZE, String.valueOf(batchCheckRequest.getChecks().size()));
1159+
}
1160+
}
11521161
}
11531162

11541163
return telemetryAttributes;

src/main/java/dev/openfga/sdk/telemetry/Attributes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class Attributes {
3838
*/
3939
public static final Attribute FGA_CLIENT_REQUEST_STORE_ID = new Attribute("fga-client.request.store_id");
4040

41+
public static final Attribute FGA_CLIENT_REQUEST_BATCH_CHECK_SIZE = new Attribute("fga-client.request.batch_check_size");
42+
4143
/**
4244
* The authorization model ID used by the server when evaluating the request, if applicable.
4345
*/

0 commit comments

Comments
 (0)