[
https://issues.apache.org/jira/browse/CASSGO-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Raj Ummadisetty updated CASSGO-119:
-----------------------------------
Description:
Currently, ObservedQuery and ObservedBatch do not expose the keyspace or table
targeted by a query. Consumers (metrics collectors, loggers, tracers) have to
parse the CQL statement string to extract that information.
Add a nested PreparedMetadata struct (Keyspace, Table) on ObservedQuery and a
parallel []PreparedMetadata on ObservedBatch, populated from prepared statement
metadata returned by Cassandra. Pair these with an IsPrepared bool / []bool so
consumers can distinguish prepared statements (where the metadata is valid)
from statements that take the unprepared path (DDL, etc.), where the metadata
is the zero value.
No additional round-trips or CQL parsing, the metadata is already available
internally via the prepared-statement response used for routing.
was:
Description:
The ObservedQuery and ObservedBatch structs currently do not expose the
target table name, requiring consumers (metrics collectors, loggers, tracers)
to parse the CQL statement string themselves to determine which table a query
targets.
This change adds:
- Table string field to ObservedQuery — populated from prepared statement
metadata returned by Cassandra
- Tables []string field to ObservedBatch — populated per-entry from prepared
statement metadata, where Tables[i] corresponds to Statements[i]
The table information is already available internally via preparedMetadata
(used for routing), so no additional round-trips or CQL parsing are needed.
This change simply exposes it through the observation path.
> Add PreparedMetadata and IsPrepared to ObservedQuery and ObservedBatch
> ----------------------------------------------------------------------
>
> Key: CASSGO-119
> URL: https://issues.apache.org/jira/browse/CASSGO-119
> Project: Apache Cassandra Go driver
> Issue Type: Improvement
> Reporter: Raj Ummadisetty
> Assignee: Raj Ummadisetty
> Priority: Normal
>
> Currently, ObservedQuery and ObservedBatch do not expose the keyspace or
> table targeted by a query. Consumers (metrics collectors, loggers, tracers)
> have to parse the CQL statement string to extract that information.
> Add a nested PreparedMetadata struct (Keyspace, Table) on ObservedQuery and a
> parallel []PreparedMetadata on ObservedBatch, populated from prepared
> statement metadata returned by Cassandra. Pair these with an IsPrepared bool
> / []bool so consumers can distinguish prepared statements (where the metadata
> is valid) from statements that take the unprepared path (DDL, etc.), where
> the metadata is the zero value.
> No additional round-trips or CQL parsing, the metadata is already available
> internally via the prepared-statement response used for routing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]