Add LMI worker and execution max concurrency counter debug log statement. - #2576
Merged
Merged
Conversation
…ed DEBUG log during init reporting the worker count and execution environment max concurrency when the JSON log format is enabled.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified, and focused test coverage is included.
Pull request overview
Adds a one-time structured DEBUG log reporting Lambda worker count and maximum concurrency in JSON multi-concurrency mode.
Changes:
- Adds log-format detection and worker-pool initialization logging.
- Integrates emission into bootstrap setup.
- Adds tests, logging helpers, and a patch changelog entry.
File summaries
| File | Summary |
|---|---|
Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/UtilsTest.cs |
Tests log gating and structured arguments. |
Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/TestMultiConcurrencyRuntimeApiClient.cs |
Supports logger replacement in tests. |
Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/CapturingConsoleLoggerWriter.cs |
Captures log writes for assertions. |
Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LogMessageFormatterTests.cs |
Tests JSON field formatting. |
Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LambdaBootstrapMultiConcurrencyTests.cs |
Tests bootstrap emission behavior. |
Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/Utils.cs |
Implements log-format detection and emission helpers. |
Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs |
Emits the initialization log during worker setup. |
.autover/changes/9efcd50c-f1a0-4b57-90e1-20b54c382f2e.json |
Adds the patch changelog entry. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
GarrettBeatty
approved these changes
Sep 14, 2026
ashishdhingra
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Adds a one-time structured DEBUG log emitted during init that reports how many worker (invoke processing) tasks the runtime started and the execution environment's max concurrency. This gives observability into the worker pool sizing when running in Lambda managed instances (multi-concurrency) mode.
Behavior
AWS_LAMBDA_MAX_CONCURRENCYset), andAWS_LAMBDA_LOG_FORMAT/ the .NET RIC log-format variable resolves toJson).Debuglevel, so it only surfaces when the function log level isDebug/Trace(filtering handled by the console logger writer).runtime_worker_pool_initializing, matching the Java and Python Lambda runtimes so the log is queryable consistently across languages.event,workerCount,executionEnvironmentMaxConcurrency.Changes
Utils.cs: newIsJsonLogFormatandEmitWorkerPoolInitializingLoghelpers, plus the event-name and message-template constants.LambdaBootstrap.cs: calls the emitter once during processing-loop setup, after the worker count is determined.UtilsTest,LogMessageFormatterTests, andLambdaBootstrapMultiConcurrencyTests, plus a newCapturingConsoleLoggerWritertest helper.Amazon.Lambda.RuntimeSupport.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.