Skip to content

Commit

Permalink
Add method/endpoint for additional context
Browse files Browse the repository at this point in the history
Signed-off-by: Mikayla Thompson <thomika@amazon.com>
  • Loading branch information
mikaylathompson committed Nov 15, 2023
1 parent 796b58b commit d152448
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,14 @@ private JSONObject toJSONObject(SourceTargetCaptureTuple tuple) {

if (tuple.targetRequestData != null && tuple.sourcePair.responseData != null) {
String sourceResponseStatus = (String) meta.getJSONObject("sourceResponse").get("Status-Code");
String targetResponseStatus = (String) meta.getJSONObject("targetREsponse").get("Status-Code");
String targetResponseStatus = (String) meta.getJSONObject("targetResponse").get("Status-Code");
String httpMethod = (String) meta.getJSONObject("sourceRequest").get("Method");
String endpoint = (String) meta.getJSONObject("sourceRequest").get("Request-URI");

metricsLogger.atSuccess(MetricsEvent.STATUS_CODE_COMPARISON)
.setAttribute(MetricsAttributeKey.REQUEST_ID, tuple.uniqueRequestKey.toString())
.setAttribute(MetricsAttributeKey.HTTP_METHOD, httpMethod)
.setAttribute(MetricsAttributeKey.HTTP_ENDPOINT, endpoint)
.setAttribute(MetricsAttributeKey.SOURCE_HTTP_STATUS, sourceResponseStatus)
.setAttribute(MetricsAttributeKey.TARGET_HTTP_STATUS, targetResponseStatus)
.setAttribute(MetricsAttributeKey.HTTP_STATUS_MATCH, sourceResponseStatus.equals(targetResponseStatus))
Expand Down

0 comments on commit d152448

Please sign in to comment.