@@ -62,7 +62,7 @@ public JSONObject insert(JSONObject records, InsertOptions insertOptions) throws
6262
6363 Map <String , String > headers = new HashMap <>();
6464 headers .put ("Authorization" , "Bearer " + TokenUtils .getBearerToken (configuration .getTokenProvider ()));
65-
65+ headers . put ( Constants . SDK_METRICS_HEADER_KEY , Helpers . getMetrics (). toJSONString ());
6666 String response = HttpUtility .sendRequest ("POST" , new URL (url ), requestBody , headers );
6767 insertResponse = (JSONObject ) new JSONParser ().parse (response );
6868 LogUtil .printInfoLog (InfoLogs .ConstructInsertResponse .getLog ());
@@ -93,10 +93,10 @@ public JSONObject detokenize(JSONObject records) throws SkyflowException {
9393 if (inputRecords == null || inputRecords .length == 0 ) {
9494 throw new SkyflowException (ErrorCode .EmptyRecords );
9595 }
96-
9796 String apiEndpointURL = this .configuration .getVaultURL () + "/v1/vaults/" + this .configuration .getVaultID () + "/detokenize" ;
9897 Map <String , String > headers = new HashMap <>();
9998 headers .put ("Authorization" , "Bearer " + TokenUtils .getBearerToken (configuration .getTokenProvider ()));
99+ headers .put (Constants .SDK_METRICS_HEADER_KEY , Helpers .getMetrics ().toJSONString ());
100100
101101 FutureTask [] futureTasks = new FutureTask [inputRecords .length ];
102102 for (int index = 0 ; index < inputRecords .length ; index ++) {
@@ -159,6 +159,7 @@ public JSONObject getById(JSONObject getByIdInput) throws SkyflowException {
159159
160160 Map <String , String > headers = new HashMap <>();
161161 headers .put ("Authorization" , "Bearer " + TokenUtils .getBearerToken (configuration .getTokenProvider ()));
162+ headers .put (Constants .SDK_METRICS_HEADER_KEY , Helpers .getMetrics ().toJSONString ());
162163
163164 FutureTask [] futureTasks = new FutureTask [recordInputs .length ];
164165 for (int i = 0 ; i < recordInputs .length ; i ++) {
@@ -227,6 +228,7 @@ public JSONObject get(JSONObject getInput) throws SkyflowException {
227228
228229 Map <String , String > headers = new HashMap <>();
229230 headers .put ("Authorization" , "Bearer " + TokenUtils .getBearerToken (configuration .getTokenProvider ()));
231+ headers .put (Constants .SDK_METRICS_HEADER_KEY , Helpers .getMetrics ().toJSONString ());
230232
231233 FutureTask [] futureTasks = new FutureTask [recordInputs .length ];
232234 for (int i = 0 ; i < recordInputs .length ; i ++) {
@@ -296,6 +298,7 @@ public JSONObject update(JSONObject records, UpdateOptions updateOptions) throws
296298
297299 Map <String , String > headers = new HashMap <>();
298300 headers .put ("Authorization" , "Bearer " + TokenUtils .getBearerToken (configuration .getTokenProvider ()));
301+ headers .put (Constants .SDK_METRICS_HEADER_KEY , Helpers .getMetrics ().toJSONString ());
299302
300303 FutureTask [] futureTasks = new FutureTask [recordInputs .length ];
301304 for (int i = 0 ; i < recordInputs .length ; i ++) {
@@ -356,7 +359,7 @@ public JSONObject invokeConnection(JSONObject connectionConfig) throws SkyflowEx
356359 if (!headers .containsKey ("x-skyflow-authorization" )) {
357360 headers .put ("x-skyflow-authorization" , TokenUtils .getBearerToken (configuration .getTokenProvider ()));
358361 }
359-
362+ headers . put ( Constants . SDK_METRICS_HEADER_KEY , Helpers . getMetrics (). toJSONString ());
360363 String requestMethod = connectionConfig .get ("methodName" ).toString ();
361364 JSONObject requestBody = null ;
362365 if (connectionConfig .containsKey ("requestBody" )) {
0 commit comments