Skip to content

Conversation

bneradt
Copy link
Contributor

@bneradt bneradt commented Sep 6, 2025

In complex setups where there are multiple plugins that can be setting
an error response, it can be non-trival to determine which component
intervened for any given transaction. This adds the prscs log field,
proxy response status code setter, which provides an identifying string
for the component (a plugin name, or ip_allow, for instance) that set
the transaction's response status.

@bneradt bneradt added this to the 10.2.0 milestone Sep 6, 2025
@bneradt bneradt self-assigned this Sep 6, 2025
@bneradt bneradt added the Logging label Sep 6, 2025
@bryancall bryancall requested a review from Copilot September 8, 2025 22:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a plugin status setter (plss) feature to help identify which plugin or component set a transaction's HTTP response status. This is valuable for debugging complex setups with multiple plugins that may modify response status codes.

  • Adds a new logging field 'plss' (Plugin Last Set Status) to track which entity set the transaction's status
  • Enhances TSHttpTxnStatusSet and TSHttpHdrStatusSet APIs with optional setter parameter
  • Updates all plugins and internal components to use the new setter tracking functionality

Reviewed Changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
include/ts/ts.h Adds new API functions with setter parameters and documentation
src/api/InkAPI.cc Implements the core setter tracking functionality
include/proxy/http/HttpTransact.h Adds status setter name field to transaction state
src/proxy/logging/Log.cc, LogAccess.cc Implements plss log field for status setter tracking
src/proxy/http/*.cc Updates core components to set "ip_allow" as setter
plugins/*/**.cc Updates all plugins to pass their names as setter parameters
tests/gold_tests/* Adds tests to verify the new logging functionality
doc/* Adds comprehensive documentation for new API functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bryancall bryancall requested a review from cmcfarlen September 8, 2025 22:14
@bneradt bneradt force-pushed the plss branch 2 times, most recently from 213f3fd to 275aa4e Compare September 10, 2025 18:14
@bneradt bneradt changed the title plss: Plugin Status Setter prscs: proxy response status code setter Sep 10, 2025
Copy link
Contributor

@cmcfarlen cmcfarlen left a comment

Choose a reason for hiding this comment

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

Setting the new setter field in TSHttpTxnStatusSet makes sense, but setting it in TSHttpHdrStatusSet seems strange to me. Also, wasn't there some discussion about removing proxy from the log field name?

@bneradt
Copy link
Contributor Author

bneradt commented Sep 16, 2025

Thanks for the review. A quick answer to this question:

Also, wasn't there some discussion about removing proxy from the log field name?

The concern was not with "proxy" but with my previous "plugin" terminology. "plugin" is wrong because aspects of ATS core can set the response, not just plugins. This now uses "proxy". I think that's better. "proxy" in prscs fits well with the other p* log fields which are also proxy related.

@bneradt bneradt force-pushed the plss branch 2 times, most recently from 07e02a8 to da67920 Compare September 17, 2025 16:42
In complex setups where there are multiple plugins that can be setting
an error response, it can be non-trival to determine which component
intervened for any given transaction. This adds the prscs log field,
proxy response status code setter, which provides an identifying string
for the component (a plugin name, or ip_allow, for instance) that set
the transaction's response status.
@bneradt bneradt merged commit 48dbca7 into apache:master Oct 8, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants