-
Notifications
You must be signed in to change notification settings - Fork 113
Generate trace ID in correct format (LocalLambda Server) #139
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
Conversation
Can one of the admins verify this patch? |
3 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
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.
Sure, I can create a test. In which case the function will need to be internal (its defined within private |
@swift-server-bot test this please |
thanks @pokryfka this is great. I think there are also places in the unit tests where we fake the traceID and would be nice to use a more correct one. wondering if we should rename the function to be generateXRayTraceID to clarify the intent. I also always like to add the "internal" modifier to make it super clear |
@tomerd Thank you for the feedback. Please see 2 questions below. I could rename the function or/and create internal enum XRay {
static func generateTraceID() -> String {
// ...
}
} XRay related functions or types would end up there if needed or practical, for example we could also have: internal enum XRay {
static func generateTracingHeader(parent: String? = nil, sampled: Bool? = nil) -> String {
// ...
}
} At the moment
|
@parkera wdyt about adding it to Would be nice to have |
@tomerd made both changes, please let me know if you have more comments |
@swift-server-bot test this please |
@pokryfka looks great, one question |
@swift-server-bot test this please |
thank you @pokryfka <3 |
Generate (X-Ray) Trace ID in correct format.
Motivation:
Generate (X-Ray) Trace ID in correct format. Helpful when testing X-Ray tracing.
References
Modifications:
LocalLambda Server
with:Result:
Example value of
Lambda-Runtime-Trace-Id
header:before (root and parent values used to be signed integers):