-
Notifications
You must be signed in to change notification settings - Fork 202
Add tracing handling #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tracing handling #405
Conversation
* Retrieve message should not return empty string if trace ID is empty * SendMessageBatch should retrieve trace ID from request headers * Overall code improvements * Tests for tracing handling
* Removing unused code * Renaming test names
|
|
||
| import scala.collection.JavaConverters.{iterableAsScalaIterableConverter, mapAsScalaMapConverter, seqAsJavaListConverter} | ||
|
|
||
| class TracingTests extends SqsClientServerCommunication with Matchers with OptionValues { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good idea to finally split this monster class with tests
| } | ||
|
|
||
| private def extractAwsXRayTracingHeader(request: HttpRequest): Map[String, String] = { | ||
| request.headers.find(_.name() == "X-Amzn-Trace-Id").map(header => header.name() -> header.value()).toMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be .equalsIgnoreCase as headers are case-insensitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed :)
|
|
||
| import java.util.Base64 | ||
|
|
||
| sealed trait MessageSystemAttribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be defined in the rest module, as that's the only place where it's used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, moved to rest module
* Moving MessageSystemAttribute to rest as it is used only in this module
Fixes #376
TraceID is stored now as a part of message data. It can be received via request header (
X-Amzn-Trace-Id) or MessageSystemAttributes (AWSTraceHeader). I have added handling of MessageSystemAttributes toSendMessageDirectivesas it was missing.