-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Populating AWS Lambda Context.clientObject with contents of the X-Amz-Client-Context header #31676
Comments
/cc @evanchooly (kotlin), @geoand (kotlin), @matejvasek (amazon-lambda), @patriot1burke (amazon-lambda) |
@patriot1burke WDYT about this? Should we be taking |
Looks like it. Should be an easy enough fix. |
Thanks for acknowledging @patriot1burke / @geoand! |
@scrocquesel I was wondering if you would be interested in driving this one home? |
Serverless Lambda is out of my expertise, but it seems there might be some connection with the AWS SDK for context propagation from the LambdaClient. I believe it could be related to the changes made in open-telemetry/opentelemetry-java-instrumentation#11675, which was introduced in version 2.6.0 of |
Describe the bug
According to the AWS Lambda invocation API, a user can pass the
X-Amz-Client-Context
header and add "Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.ClientContext"Some OpenTelemetry AWS clients use this header (e.g. here) to populate tracing information.
An example value would be
which would translate to
and should be populating the Context.clientContext.custom map
Expected behavior
Quarkus should be reading this header and populating the Context object accordingly
Actual behavior
It appears that Quarkus is not reading this header. When populating the Context object, it searches for a different one named "Lambda-Runtime-Client-Context".
Requests that have the header mentioned above result in the Context.clientContext object being null
How to Reproduce?
Using a sample quarkus lambda project, invoke a call by adding a header like
The context.clientContext object in the handler will be null
Output of
uname -a
orver
Darwin K4V32WY17P 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "17.0.4.1" 2022-08-12
OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.15.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.5.1
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.4.1 (Eclipse Adoptium 17.0.4.1+1)
OS: Mac OS X 12.6.3 aarch64
Additional information
originated from this discussion: #31552
The text was updated successfully, but these errors were encountered: