forked from apache/cassandra-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 38
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
wprzytula
wants to merge
11
commits into
scylladb:scylla-3.x
Choose a base branch
from
wprzytula:scylla-3.x-otel-custom-payload
base: scylla-3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Extend OpenTelemetry tracing with cluster-side gathered data #148
wprzytula
wants to merge
11
commits into
scylladb:scylla-3.x
from
wprzytula:scylla-3.x-otel-custom-payload
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
changed the title
Scylla 3.x otel custom payload
Extend OpenTelemetry tracing with cluster-side gathered data
Jul 26, 2022
avelanarius
force-pushed
the
scylla-3.x
branch
2 times, most recently
from
November 24, 2022 11:53
0d1c3e9
to
f5fc83d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.