You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Susan Hinrichs <sh...@verizonmedia.com.INVALID> on 2020/11/18 20:14:44 UTC

[API] for accessing server session transaction count

I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
addition to the InkAPI.  It returns the number of transactions that have
been performed on the server session currently associated with the txn.
This would be analogous to the TSHttpTxnServerSsnTransactionCount function
which returns the same information for the user agent session.  The
TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
the server transaction/session associated with the HttpSM.

We have a customer that would like to add a "Connection: close" header to
the server request after a certain number of requests have been made on the
connection.  If there is an existing way to do this, I'd be interested to
know that too.

Re: [E] Re: [API] for accessing server session transaction count

Posted by Damian Meden <da...@verizonmedia.com.INVALID>.
Hello guys, this new API is now implemented ->
https://github.com/apache/trafficserver/pull/7387 . Any feedback will be
appreciated. The PR also includes a new header rewrite condition(
SSN-TXN-COUNT) that consumes this new API.


Regards,
Damian.

On Wed, Nov 18, 2020 at 10:59 PM Sudheer Vinukonda
<su...@yahoo.com.invalid> wrote:

>  Yeah, you are right. I got mixed up because we *talked* about supporting
> generic log tags via header-rewrite in the past.
> Looks like that support was never added.
>     On Wednesday, November 18, 2020, 02:51:33 PM PST, Shu Kit Chan <
> chanshukit@gmail.com> wrote:
>
>  I don't think this will work.
>
> Prior to 9.x , header rewrite plugin supports a fixed set of string
> substitutions. e.g. %<port>, %<chi>
> But it is never for generic log tag. And i think this style of string
> substitutions are deprecated after 9.x
>
> In fact, I don't think there are APIs for plugin to get these log tag
> values per request in a generic fashion.
>
> Kit
>
>
>
> On Wed, Nov 18, 2020 at 1:53 PM Susan Hinrichs
> <sh...@verizonmedia.com.invalid> wrote:
> >
> > Hmm, I wasn't aware you could access log tags from header-rewrite.
> >
> > On Wed, Nov 18, 2020 at 3:28 PM Sudheer Vinukonda
> > <su...@yahoo.com.invalid> wrote:
> >
> > >  New API sounds reasonable.
> > > For the use case in question though, it may be possible to use
> > > header-rewrite rules to achieve this using the log tag 'sstc'
> > > Not 100% sure, but something like this might (I haven't tested it)
> work?
> > > cond %{SEND_RESPONSE_HDR_HOOK}
> > > cond %<sstc> =10set-header Connection close
> > >
> > >
> > >    On Wednesday, November 18, 2020, 12:15:02 PM PST, Susan Hinrichs <
> > > shinrich@verizonmedia.com.invalid> wrote:
> > >
> > >  I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > > addition to the InkAPI.  It returns the number of transactions that
> have
> > > been performed on the server session currently associated with the txn.
> > > This would be analogous to the TSHttpTxnServerSsnTransactionCount
> function
> > > which returns the same information for the user agent session.  The
> > > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing
> with
> > > the server transaction/session associated with the HttpSM.
> > >
> > > We have a customer that would like to add a "Connection: close" header
> to
> > > the server request after a certain number of requests have been made
> on the
> > > connection.  If there is an existing way to do this, I'd be interested
> to
> > > know that too.
> > >
>

Re: [E] Re: [API] for accessing server session transaction count

Posted by Sudheer Vinukonda <su...@yahoo.com.INVALID>.
 Yeah, you are right. I got mixed up because we *talked* about supporting generic log tags via header-rewrite in the past. 
Looks like that support was never added.
    On Wednesday, November 18, 2020, 02:51:33 PM PST, Shu Kit Chan <ch...@gmail.com> wrote:  
 
 I don't think this will work.

Prior to 9.x , header rewrite plugin supports a fixed set of string
substitutions. e.g. %<port>, %<chi>
But it is never for generic log tag. And i think this style of string
substitutions are deprecated after 9.x

In fact, I don't think there are APIs for plugin to get these log tag
values per request in a generic fashion.

Kit



On Wed, Nov 18, 2020 at 1:53 PM Susan Hinrichs
<sh...@verizonmedia.com.invalid> wrote:
>
> Hmm, I wasn't aware you could access log tags from header-rewrite.
>
> On Wed, Nov 18, 2020 at 3:28 PM Sudheer Vinukonda
> <su...@yahoo.com.invalid> wrote:
>
> >  New API sounds reasonable.
> > For the use case in question though, it may be possible to use
> > header-rewrite rules to achieve this using the log tag 'sstc'
> > Not 100% sure, but something like this might (I haven't tested it) work?
> > cond %{SEND_RESPONSE_HDR_HOOK}
> > cond %<sstc> =10set-header Connection close
> >
> >
> >    On Wednesday, November 18, 2020, 12:15:02 PM PST, Susan Hinrichs <
> > shinrich@verizonmedia.com.invalid> wrote:
> >
> >  I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > addition to the InkAPI.  It returns the number of transactions that have
> > been performed on the server session currently associated with the txn.
> > This would be analogous to the TSHttpTxnServerSsnTransactionCount function
> > which returns the same information for the user agent session.  The
> > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
> > the server transaction/session associated with the HttpSM.
> >
> > We have a customer that would like to add a "Connection: close" header to
> > the server request after a certain number of requests have been made on the
> > connection.  If there is an existing way to do this, I'd be interested to
> > know that too.
> >
  

Re: [E] Re: [API] for accessing server session transaction count

Posted by Shu Kit Chan <ch...@gmail.com>.
I don't think this will work.

Prior to 9.x , header rewrite plugin supports a fixed set of string
substitutions. e.g. %<port>, %<chi>
But it is never for generic log tag. And i think this style of string
substitutions are deprecated after 9.x

In fact, I don't think there are APIs for plugin to get these log tag
values per request in a generic fashion.

Kit



On Wed, Nov 18, 2020 at 1:53 PM Susan Hinrichs
<sh...@verizonmedia.com.invalid> wrote:
>
> Hmm, I wasn't aware you could access log tags from header-rewrite.
>
> On Wed, Nov 18, 2020 at 3:28 PM Sudheer Vinukonda
> <su...@yahoo.com.invalid> wrote:
>
> >  New API sounds reasonable.
> > For the use case in question though, it may be possible to use
> > header-rewrite rules to achieve this using the log tag 'sstc'
> > Not 100% sure, but something like this might (I haven't tested it) work?
> > cond %{SEND_RESPONSE_HDR_HOOK}
> > cond %<sstc> =10set-header Connection close
> >
> >
> >     On Wednesday, November 18, 2020, 12:15:02 PM PST, Susan Hinrichs <
> > shinrich@verizonmedia.com.invalid> wrote:
> >
> >  I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > addition to the InkAPI.  It returns the number of transactions that have
> > been performed on the server session currently associated with the txn.
> > This would be analogous to the TSHttpTxnServerSsnTransactionCount function
> > which returns the same information for the user agent session.  The
> > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
> > the server transaction/session associated with the HttpSM.
> >
> > We have a customer that would like to add a "Connection: close" header to
> > the server request after a certain number of requests have been made on the
> > connection.  If there is an existing way to do this, I'd be interested to
> > know that too.
> >

Re: [E] Re: [API] for accessing server session transaction count

Posted by Susan Hinrichs <sh...@verizonmedia.com.INVALID>.
Hmm, I wasn't aware you could access log tags from header-rewrite.

On Wed, Nov 18, 2020 at 3:28 PM Sudheer Vinukonda
<su...@yahoo.com.invalid> wrote:

>  New API sounds reasonable.
> For the use case in question though, it may be possible to use
> header-rewrite rules to achieve this using the log tag 'sstc'
> Not 100% sure, but something like this might (I haven't tested it) work?
> cond %{SEND_RESPONSE_HDR_HOOK}
> cond %<sstc> =10set-header Connection close
>
>
>     On Wednesday, November 18, 2020, 12:15:02 PM PST, Susan Hinrichs <
> shinrich@verizonmedia.com.invalid> wrote:
>
>  I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> addition to the InkAPI.  It returns the number of transactions that have
> been performed on the server session currently associated with the txn.
> This would be analogous to the TSHttpTxnServerSsnTransactionCount function
> which returns the same information for the user agent session.  The
> TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
> the server transaction/session associated with the HttpSM.
>
> We have a customer that would like to add a "Connection: close" header to
> the server request after a certain number of requests have been made on the
> connection.  If there is an existing way to do this, I'd be interested to
> know that too.
>

Re: [API] for accessing server session transaction count

Posted by Sudheer Vinukonda <su...@yahoo.com.INVALID>.
 New API sounds reasonable. 
For the use case in question though, it may be possible to use header-rewrite rules to achieve this using the log tag 'sstc'
Not 100% sure, but something like this might (I haven't tested it) work?
cond %{SEND_RESPONSE_HDR_HOOK}
cond %<sstc> =10set-header Connection close


    On Wednesday, November 18, 2020, 12:15:02 PM PST, Susan Hinrichs <sh...@verizonmedia.com.invalid> wrote:  
 
 I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
addition to the InkAPI.  It returns the number of transactions that have
been performed on the server session currently associated with the txn.
This would be analogous to the TSHttpTxnServerSsnTransactionCount function
which returns the same information for the user agent session.  The
TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
the server transaction/session associated with the HttpSM.

We have a customer that would like to add a "Connection: close" header to
the server request after a certain number of requests have been made on the
connection.  If there is an existing way to do this, I'd be interested to
know that too.
  

Re: [E] Re: [API] for accessing server session transaction count

Posted by Susan Hinrichs <sh...@verizonmedia.com.INVALID>.
In this scenario they would set "Connection: close" in the request header.

I am assuming they don't have the control over the origin to make this
change there.  Or it is always easier to hassle the proxy folks to get
these things done :-)

On Wed, Nov 18, 2020 at 2:39 PM Shu Kit Chan <ch...@gmail.com> wrote:

> Actually I was thinking about this question a bit. 2 points to make.
>
> 1) I am Ok with the naming convention
>
> 2) So the origin wants to be the one to set "Connection: close" in the
> response. Wouldn't the origin also has that piece of information
> (transaction count) to make that decision? May be their application
> framework/platform doesn't allow them to easily get that?
>
>
> On Wed, Nov 18, 2020 at 12:31 PM Shu Kit Chan <ch...@gmail.com>
> wrote:
> >
> > I think you mean the existing one is TSHttpSsnTransactionCount . Right ?
> >
> >
> > On Wed, Nov 18, 2020 at 12:15 PM Susan Hinrichs
> > <sh...@verizonmedia.com.invalid> wrote:
> > >
> > > I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > > addition to the InkAPI.  It returns the number of transactions that
> have
> > > been performed on the server session currently associated with the txn.
> > > This would be analogous to the TSHttpTxnServerSsnTransactionCount
> function
> > > which returns the same information for the user agent session.  The
> > > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing
> with
> > > the server transaction/session associated with the HttpSM.
> > >
> > > We have a customer that would like to add a "Connection: close" header
> to
> > > the server request after a certain number of requests have been made
> on the
> > > connection.  If there is an existing way to do this, I'd be interested
> to
> > > know that too.
>

Re: [API] for accessing server session transaction count

Posted by Shu Kit Chan <ch...@gmail.com>.
Actually I was thinking about this question a bit. 2 points to make.

1) I am Ok with the naming convention

2) So the origin wants to be the one to set "Connection: close" in the
response. Wouldn't the origin also has that piece of information
(transaction count) to make that decision? May be their application
framework/platform doesn't allow them to easily get that?


On Wed, Nov 18, 2020 at 12:31 PM Shu Kit Chan <ch...@gmail.com> wrote:
>
> I think you mean the existing one is TSHttpSsnTransactionCount . Right ?
>
>
> On Wed, Nov 18, 2020 at 12:15 PM Susan Hinrichs
> <sh...@verizonmedia.com.invalid> wrote:
> >
> > I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > addition to the InkAPI.  It returns the number of transactions that have
> > been performed on the server session currently associated with the txn.
> > This would be analogous to the TSHttpTxnServerSsnTransactionCount function
> > which returns the same information for the user agent session.  The
> > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
> > the server transaction/session associated with the HttpSM.
> >
> > We have a customer that would like to add a "Connection: close" header to
> > the server request after a certain number of requests have been made on the
> > connection.  If there is an existing way to do this, I'd be interested to
> > know that too.

Re: [E] Re: [API] for accessing server session transaction count

Posted by Susan Hinrichs <sh...@verizonmedia.com.INVALID>.
Correct.  Cut-n-paste problems.

On Wed, Nov 18, 2020 at 2:29 PM Shu Kit Chan <ch...@gmail.com> wrote:

> I think you mean the existing one is TSHttpSsnTransactionCount . Right ?
>
>
> On Wed, Nov 18, 2020 at 12:15 PM Susan Hinrichs
> <sh...@verizonmedia.com.invalid> wrote:
> >
> > I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> > addition to the InkAPI.  It returns the number of transactions that have
> > been performed on the server session currently associated with the txn.
> > This would be analogous to the TSHttpTxnServerSsnTransactionCount
> function
> > which returns the same information for the user agent session.  The
> > TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing
> with
> > the server transaction/session associated with the HttpSM.
> >
> > We have a customer that would like to add a "Connection: close" header to
> > the server request after a certain number of requests have been made on
> the
> > connection.  If there is an existing way to do this, I'd be interested to
> > know that too.
>

Re: [API] for accessing server session transaction count

Posted by Shu Kit Chan <ch...@gmail.com>.
I think you mean the existing one is TSHttpSsnTransactionCount . Right ?


On Wed, Nov 18, 2020 at 12:15 PM Susan Hinrichs
<sh...@verizonmedia.com.invalid> wrote:
>
> I propose  int TSHttpTxnServerSsnTransactionCount(TSHttpTxn txn) as an
> addition to the InkAPI.  It returns the number of transactions that have
> been performed on the server session currently associated with the txn.
> This would be analogous to the TSHttpTxnServerSsnTransactionCount function
> which returns the same information for the user agent session.  The
> TSHttpTxnServer prefix seems to be used in other InkAPI calls dealing with
> the server transaction/session associated with the HttpSM.
>
> We have a customer that would like to add a "Connection: close" header to
> the server request after a certain number of requests have been made on the
> connection.  If there is an existing way to do this, I'd be interested to
> know that too.