Skip to content

Add Lambda bundled runtime useragent header#379

Open
nvasiu wants to merge 1 commit intomainfrom
bundled-runtime-useragent
Open

Add Lambda bundled runtime useragent header#379
nvasiu wants to merge 1 commit intomainfrom
bundled-runtime-useragent

Conversation

@nvasiu
Copy link
Copy Markdown
Contributor

@nvasiu nvasiu commented May 5, 2026

  • Add boolean that checks if the SDK is running in a path that matches the path used within the Lambda bundled runtime.
  • Update the useragent header string to include "-bundledruntime" if the above boolean is true.

Issue #, if available:

N/A

Description of changes:

Note: we are waiting to confirm the Lambda bundled runtime SDK path. Do NOT merge this PR until we get confirmation.

Updating the UserAgent header string to indicate whether the SDK is being run within the Lambda bundled runtime.

  • A new boolean checks if the SDK's current path matches the path where it would be installed in the Lambda bundled runtime.
  • If the above boolean is true, the string inserted into the UserAgent header will include "-bundled". Example:
    aws-durable-execution-sdk-python/{version}-bundled

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nvasiu nvasiu force-pushed the bundled-runtime-useragent branch 2 times, most recently from 3fc3f51 to 265a5a1 Compare May 5, 2026 18:30
connect_timeout=5,
read_timeout=50,
user_agent_extra=f"aws-durable-execution-sdk-python/{__version__}",
user_agent_extra=f"aws-durable-execution-sdk-python{'-bundledruntime' if _IS_RUNTIME_BUNDLED else ''}/{__version__}",
Copy link
Copy Markdown
Contributor

@zhongkechen zhongkechen May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this -bundledruntime be part of the sdk name or part of the version?

And -bundledruntime sounds weird like the runtime is bundled in SDK. Why don't we simply used -bundled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense as part of the name, because the bundled runtime doesn't use a special SDK version.

I can make an update to just say "-bundled".

Copy link
Copy Markdown
Contributor

@leandrodamascena leandrodamascena May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to jump into the conversation, but I would add the AWS_EXECUTION_ENV environment variable here - if not set assume "NA" for example. While this SDK is 100% focused on Lambda and only works with the specific payload sent to Lambda, you never know how creatively customers are using it. In Powertools for AWS Lambda, we identified clients using it on a wide variety of platforms other than Lambda.

But of course, it's just an idea, and I don't know if this affects how you consume this string in the backend.

Copy link
Copy Markdown
Contributor

@yaythomas yaythomas May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree re the bundling effectively being a version variant. something like aws-durable-execution-sdk-python/v.1.2.3-bundled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re AWS_EXECUTION_ENV

if exists could be:

# bring your own
aws-durable-execution-sdk-js/1.2.3#nodejs24.x

# bundled
aws-durable-execution-sdk-js/1.2.3-bundled#runtime-nodejs24.x

# no execution env variable, use current interpreter version
aws-durable-execution-sdk-js/1.2.3-bundled#node-v20.19.0

@nvasiu nvasiu force-pushed the bundled-runtime-useragent branch from 265a5a1 to fffdbb5 Compare May 5, 2026 21:57
- Detect whether the SDK is installed under the Lambda
 runtime path. If so, update the UserAgent header string.
@nvasiu nvasiu force-pushed the bundled-runtime-useragent branch from fffdbb5 to c7da73c Compare May 5, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants