You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Abe Ratnofsky (Jira)" <ji...@apache.org> on 2025/07/07 17:20:00 UTC

[jira] [Updated] (CASSJAVA-97) Let users inject an ID for each request and write to the custom payload

     [ https://issues.apache.org/jira/browse/CASSJAVA-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Abe Ratnofsky updated CASSJAVA-97:
----------------------------------
    Change Category: Operability
         Complexity: Normal
        Component/s: Core
          Reviewers: Abe Ratnofsky, Bret McGuire
             Status: Open  (was: Triage Needed)

> Let users inject an ID for each request and write to the custom payload 
> ------------------------------------------------------------------------
>
>                 Key: CASSJAVA-97
>                 URL: https://issues.apache.org/jira/browse/CASSJAVA-97
>             Project: Apache Cassandra Java driver
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jane He
>            Assignee: Jane He
>            Priority: Normal
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Currently `CqlRequestHandler` creates `logPrefix` to identify each request, but this logPrefix generation logic is fixed and built-in. We should expose an interface to let the users generate and inject whatever ID they want. We should also enable an option to write such ID to the custom payload, so that this ID can be propagated to the server side for better traceability. This feature will be specifically useful for Astra.  
> I propose the following interface
> {code:java}
> public interface DistributedTraceIdGenerator {
>   String getSessionRequestId(@NonNull Request statement);
>   String getNodeRequestId(@NonNull Request statement, @NonNull String sessionRequestId);
> }
>  {code}
> And the following options in application.conf
> {code:java}
> advanced.distributed-tracing{
>   id-generator{
>     # The component that generates unique identifiers for distributed tracing.
>     class = NoopDistributedTraceIdGenerator
>   }
>   # add the trace-id to the custom payload with the given key
>   # if empty, the trace-id will not be added to the custom payload
>   custom-payload-with-key = ""
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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