Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Timestamp Logging Value -1

Hello,

I was looking at the timestamp flow variables available to be used in a messageLogging policy. I wanted to calculate some metrics based on these timestamps in an external tool.

It looks like my client sent.end and sent.start are always empty no matter what.

client.sent.end.timestamp
-1
GET
client.sent.start.timestamp
-1
GET

I created some assign message policy to assign some debug variables and I placed it at all sections of the flow (Request-preflow, request-postflow, response-preflow, response-postflow). No matter what the values are always empty.

mlan01_0-1725899857848.png

The variables with debug.* are my tests. Here is the flow:

mlan01_1-1725899922100.png

What am I missing here?
Thank you to anyone who has ideas. 

 

Solved Solved
0 4 617
1 ACCEPTED SOLUTION

Hello all. Thank you for the comments.

I figured this out. The reason why I was not seeing the timestamps populated is because the logging policy was executed in "PostFlow" flow and not the "PostClientFlow".

When I was reading the documentation I thought that PostClientFlow = PostFlow. I have since discovered this is not the case. This makes me wonder what other flows are hidden?

Also, I am not clear on what the difference between Postflow and PostClientFlow really is.

I added the following to the proxy config:

<PostClientFlow name="PostClientFlow">
    <Request/>
    <Response>
      <Step>
        <Name>FC-logging</Name>
      </Step>
    </Response>
  </PostClientFlow>


mlan01_0-1727098191442.png

 

mlan01_1-1727098375716.png

Thank you all

 

 

View solution in original post

4 REPLIES 4

Hi! Thanks for your question. We're checking into it and will respond as soon as we have details. Apologies for any inconvenience and thank you for waiting.


@mlan01 wrote:

I created some assign message policy to assign some debug variables and I placed it at all sections of the flow (Request-preflow, request-postflow, response-preflow, response-postflow). No matter what the values are always empty.

 


I think you are observing the expected behavior.

The documentation says: 

Note: This property is only available in the ProxyEndpoint response's PostClientFlow. In all other flows, the value of this property is -1.

Screenshot 2024-09-16 at 4.22.09 PM.png

Hello all. Thank you for the comments.

I figured this out. The reason why I was not seeing the timestamps populated is because the logging policy was executed in "PostFlow" flow and not the "PostClientFlow".

When I was reading the documentation I thought that PostClientFlow = PostFlow. I have since discovered this is not the case. This makes me wonder what other flows are hidden?

Also, I am not clear on what the difference between Postflow and PostClientFlow really is.

I added the following to the proxy config:

<PostClientFlow name="PostClientFlow">
    <Request/>
    <Response>
      <Step>
        <Name>FC-logging</Name>
      </Step>
    </Response>
  </PostClientFlow>


mlan01_0-1727098191442.png

 

mlan01_1-1727098375716.png

Thank you all

 

 

Gemini gives a "kind of" good summary of the difference

Screenshot 2024-09-23 at 9.44.35 AM.png

As a non-AI Apigee expert, I would phrase it as: 

PostClientFlow executes after the response has been sent to the client. This is an ideal point to attach logic that would compute the time interval for message handling, or to perform message logging. (The former may be used in the latter).  PostFlow is where you attach logic that should run after any Conditional flows.  PostFlow has Request and Response sub-flows, so you can attach logic that runs in the request flow after any steps in a conditional flow, or in the response flow after any steps in a conditional flow. 

I agree that  the documentation could call this out more clearly. (If the doc was super clear, then Gemini would give a more accurate answer, instead of something like "Apigee PostclientFlow is used to measure the time interval between the start and end of a response message."  #1, that's not really sensible as phrased, and #2, computing elapsed times is not the primary use case for PostClientFlow. 

 

The reference page is here: https://cloud.google.com/apigee/docs/api-platform/reference/flow-configuration-reference#postclientf...