From 8c5e8d265d4d51c827403ab541041d7fa1e0002e Mon Sep 17 00:00:00 2001 From: adamnfish Date: Wed, 20 Dec 2023 14:13:48 +0000 Subject: [PATCH] Add basic trace debugging info --- build.sbt | 1 + lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index b9ff747..4942c40 100644 --- a/build.sbt +++ b/build.sbt @@ -63,6 +63,7 @@ lazy val lambda = (project in file("lambda")) "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5", "com.amazonaws" % "aws-lambda-java-core" % "1.2.2", "com.amazonaws" % "aws-lambda-java-events" % "3.11.1", + "com.amazonaws" % "aws-xray-recorder-sdk-core" % "2.15.0", "software.amazon.awssdk" % "apigatewaymanagementapi" % awsJavaSdkVersion, "software.amazon.awssdk" % "url-connection-client" % awsJavaSdkVersion, ) ++ commonDeps ++ loggingDeps, diff --git a/lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala b/lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala index 4c8b44f..8b1bcea 100644 --- a/lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala +++ b/lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala @@ -3,6 +3,7 @@ package io.adamnfish.pokerdot import com.amazonaws.services.lambda.runtime.events.{APIGatewayV2WebSocketEvent, APIGatewayV2WebSocketResponse} import com.amazonaws.services.lambda.runtime.{Context => AwsContext} +import com.amazonaws.xray.AWSXRay import com.typesafe.scalalogging.LazyLogging import io.adamnfish.pokerdot.models.{AppContext, PlayerAddress} import io.adamnfish.pokerdot.persistence.DynamoDbDatabase @@ -65,6 +66,7 @@ class Lambda extends LazyLogging { // Debugging // logger.info(s"request body: ${event.getBody}") // logger.info(s"connection ID: ${event.getRequestContext.getConnectionId}") + logger.info(s"Trace: ${AWSXRay.currentFormattedId()}") logger.info(s"route: ${event.getRequestContext.getRouteKey}") event.getRequestContext.getRouteKey match {