You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "MisterRaindrop (via GitHub)" <gi...@apache.org> on 2026/06/04 12:55:12 UTC

Re: [PR] Observability: Add gp_session_id and gp_command_count to MDC [cloudberry-pxf]

MisterRaindrop commented on code in PR #111:
URL: https://github.com/apache/cloudberry-pxf/pull/111#discussion_r3356111538


##########
server/pxf-service/src/main/java/org/apache/cloudberry/pxf/service/spring/PxfContextMdcLogEnhancerFilter.java:
##########
@@ -21,8 +21,17 @@
 @Component
 public class PxfContextMdcLogEnhancerFilter extends OncePerRequestFilter {
 
+    // sessionId: composite PXF request identifier formed as "<X-GP-XID>:<X-GP-OPTIONS-SERVER>",
+    // where XID is the Greenplum transaction id and the server name defaults to "default".
+    // Groups all log records produced while serving a single PXF request.
     private static final String MDC_SESSION_ID = "sessionId";
+    // segmentId: the Greenplum segment id (X-GP-SEGMENT-ID) that issued the PXF request.
     private static final String MDC_SEGMENT_ID = "segmentId";
+    // ssid: query session identifier from pg_stat_activity system view.
+    private static final String MDC_SSID = "ssid";

Review Comment:
     in `server/pxf-service/src/templates/conf/pxf-log4j2.xml`:
   
     ```xml
     <Property name="LOG_LEVEL_PATTERN">%5p [%X{sessionId}:%-3X{segmentId}]</Property>
     ```
   
   now we add ssid maybe update pxf-log4j2.xml templates is better? 
   ```xml
        <Property name="LOG_LEVEL_PATTERN">%5p [%X{sessionId}:%-3X{segmentId}]
     [ssid=%X{ssid},ccnt=%X{ccnt}]</Property>
        ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org