scylladb / scylladb/cpp-rs-driver

Span tracing data isn't passed to the C logging callback

Open
#502 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
26
Forks
19
Avg merge
1d 21h
Merged PRs (30d)
7

Description

Finding: CustomLayer discards all span data.

CustomLayer (scylla-rust-wrapper/src/logging.rs:129) implements only on_event. There is no on_new_span, on_record, on_enter or on_close, so no span ever reaches the C log callback.

Consequences
  1. Everything the Rust driver records on RequestSpan — partition key, token, replicas, shard, request/result size, result rows, speculative execution count — is invisible to a C/C++ application, at any log level. The cpp-driver's CassLogMessage has no notion of spans, so exposing this needs a deliberate design decision (flatten span fields into the event message? emit synthetic events on span open/close?).
  2. Worse, it is not merely invisible but actively costly: with CASS_LOG_TRACE set, trace_span!("Request", ...) becomes enabled, which makes session.rs:1826 take its branch and compute get_cluster_state() + get_token_endpoints_iter() + format every replica as "{ip}-shard{n}" into a span field — all of which CustomLayer then throws away.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CustomLayer in scylla-rust-wrapper/src/logging.rs:129 and the RequestSpan setup at session.rs:1826, then compare the available data with the C/C++ CassLogMessage callback. Decide how span fields should be exposed and how to avoid computing data that the callback discards. Done means the chosen span behavior is documented and consistently reaches the C callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, rust
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.