Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend OpenTelemetry tracing with cluster-side gathered data #148

Draft
wants to merge 11 commits into
base: scylla-3.x
Choose a base branch
from

Conversation

wprzytula
Copy link

This is an extension of OTel tracing in the driver that implements a proof-of-concept of gathering additional tracing metadata from the cluster via CQL custom payload.

wprzytula added 11 commits July 25, 2022 11:03
In order to be generic and to still stick to Java 6 requirement for
driver-core, abstract classes: TracingInfo and TracingInfoFactory are
introduced. Further implementations of tracing are expected to be placed apart from
driver-core and hence keep Java 8 (or higher) requirements away.
While building a Cluster object, one can pass a TracingInfo class implementation
and it will be used for tracing in all sessions with this cluster from
now on.
Every request is covered by one "request" span, and every speculative
execution has its own "speculative_execution.n" span, where n is number
of that (possibly speculative) execution. Retries are performed in the
same execution and therefore do not increase that number, whereas
speculative executions do. Each retry is covered by "query" span,
effectively yielding a tree of form:
"request" -1--many-> "speculative_execution.n" -1--many-> "query"
After a request is completed, its status code (OK or ERROR) is added to
trace data, as well as exception information (if one occured).
All data that constitute added tags are collected offline,
i.e. not fetched from the cluster, but known instantly by the driver.
These tests verify that the span tree structure is valid and that spans are filled with tags of proper content,
by providing a mock implementation of TracingInfo.
Added TracingInfo and TracingInfoFactory implementations in separate
driver-opentelemetry module.
Added OpenTelemetry and Zipkin connection configuration classes, along
with docker-compose file, example run script and related changes in README.
The test verifies that span tree structure and status code are valid.
Disclaimer: please keep in mind that it is a proof-of-concept rather
than a polished proposal.
Added custom payload -based reception of tracing metadata from cluster.
When a custom TracingInfoFactory is set by the user in Cluster, with every
request the driver asks for custom payload (in a CQL flag), and this is
interpreted by a compatible Scylla instance (NB: ignored by
a noncompatible one / Cassandra instance) as request for tracing
metadata, which then are sent with the response in the custom payload as
a ByteMap under the key "opentelemetry".
@wprzytula wprzytula changed the title Scylla 3.x otel custom payload Extend OpenTelemetry tracing with cluster-side gathered data Jul 26, 2022
@avelanarius avelanarius force-pushed the scylla-3.x branch 2 times, most recently from 0d1c3e9 to f5fc83d Compare November 24, 2022 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant