Fix missing HTTP access logs when api-server omits the core app - #72026
Open
manish1337 wants to merge 4 commits into
Open
Fix missing HTTP access logs when api-server omits the core app#72026manish1337 wants to merge 4 commits into
manish1337 wants to merge 4 commits into
Conversation
An api-server started without the core app -- for example `--apps execution`, the shape used to run the Task Execution API as its own deployment -- served requests but recorded none of them. That leaves the component every running task depends on for heartbeats, state transitions and XComs with no per-request telemetry, which is the primary signal for diagnosing heartbeat stalls. Both server backends disable their own access logger, and the built-in access loggers are muted in the logging config, all on the premise that HttpAccessLogMiddleware handles access logging. That premise only held while the middleware was installed by the core app branch, so no configuration could recover the records. Installing it for every apps selection makes the premise true again instead of adding a fourth conditional that would give execution-only deployments a different log format from every other deployment.
manish1337
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
August 24, 2026 12:27
ColtenOuO
approved these changes
Aug 24, 2026
ColtenOuO
left a comment
Contributor
There was a problem hiding this comment.
LGTM overall.
Just a small suggestion: If you want to update your branch with the latest main, consider using rebase instead of merge.
This helps keep the commit history cleaner and easier to follow.
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.
An
api-serverstarted without the core app — for example--apps execution, the shape used to runthe Task Execution API as its own deployment — serves requests normally but emits no access log
lines at all.
Three separate places disable the built-in access loggers, all resting on the premise that
HttpAccessLogMiddlewarehandles access logging:AirflowUvicornWorker.CONFIG_KWARGS—access_log: Falseapi_server_commanduvicorn.access/gunicorn.accessmuted (handlers: [],propagate: False) inlogging_configThat premise only held while the middleware was installed inside the
"core" in apps_listbranch ofcreate_app, so an--appsselection withoutcorehad no access-log producer at all — and becausethe loggers are muted at the logging-config level too, no configuration could bring the records back.
This installs the middleware for every
appsselection, which makes the premise true again ratherthan adding a fourth conditional. The alternative — enabling uvicorn's own access log when
coreisabsent — needs three coordinated conditionals across three files and would give execution-only
deployments a different log format from every other deployment.
For anyone running the Task Execution API as its own deployment, this restores per-request telemetry
(latency, status codes, endpoint counts) for the component every running task depends on for
heartbeats, state transitions and XComs.
Verification
Started a real
api-serverand issued a marked request, before and after the change:--appsexecutioncoreallcore/allis unchanged:[HttpAccessLogMiddleware, GZipMiddleware, JWTRefreshMiddleware].[execution]without the fix and passes with it.airflow-core/tests/unit/api_fastapi(3750),providers/fab(536) andproviders/common/compat(197) pass. The
test_hitl.pyand example-Dag failures seen locally also fail on unmodifiedmain, so they are unrelated.Note for reviewers: #64523 (open) also edits
init_middlewaresto add a metrics middleware, so thetwo may conflict textually.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines