Class OpenTelemetryRequestTracker
OpenTelemetry request tracker implementation that includes tracing capabilities and follow the Trace Semantic Conventions v1.27.0. https://opentelemetry.io/docs/specs/semconv/database/database-spans/ https://opentelemetry.io/docs/specs/semconv/database/cassandra/
Implements
Inherited Members
Namespace: Cassandra.OpenTelemetry
Assembly: Cassandra.OpenTelemetry.dll
Syntax
public class OpenTelemetryRequestTracker : IRequestTracker
Constructors
OpenTelemetryRequestTracker(CassandraInstrumentationOptions)
Request Tracker implementation that implements OpenTelemetry instrumentation.
Declaration
public OpenTelemetryRequestTracker(CassandraInstrumentationOptions instrumentationOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| CassandraInstrumentationOptions | instrumentationOptions |
Methods
OnErrorAsync(SessionRequestInfo, Exception)
Closes the Activity when the session request is unsuccessful. Includes an ActivityEvent containing information from the specified exception.
Declaration
public virtual Task OnErrorAsync(SessionRequestInfo sessionRequest, Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | Request contextual information. |
| Exception | ex | Exception information. |
Returns
| Type | Description |
|---|---|
| Task | Completed task. |
OnNodeAborted(SessionRequestInfo, NodeRequestInfo)
Closes the Activity when the node request is aborted (e.g. pending speculative execution).
Declaration
public Task OnNodeAborted(SessionRequestInfo sessionRequest, NodeRequestInfo nodeRequestInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | Request contextual information. |
| NodeRequestInfo | nodeRequestInfo | Struct with host contextual information. |
Returns
| Type | Description |
|---|---|
| Task | Completed task. |
OnNodeErrorAsync(SessionRequestInfo, NodeRequestInfo, Exception)
Closes the Activity when the node request level request is unsuccessful. Includes an ActivityEvent containing information from the specified exception.
Declaration
public virtual Task OnNodeErrorAsync(SessionRequestInfo sessionRequest, NodeRequestInfo nodeRequestInfo, Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | SessionRequestInfo object with contextual information. |
| NodeRequestInfo | nodeRequestInfo | Struct with host contextual information. |
| Exception | ex | Exception information. |
Returns
| Type | Description |
|---|---|
| Task | Completed task. |
OnNodeStartAsync(SessionRequestInfo, NodeRequestInfo)
Starts an Activity when node request starts and includes the following Cassandra specific tags:
- db.system that has a harcoded value of `cassandra`.
- db.operation.name that has a harcoded value of `Node Request`.
- db.namespace that has the Keyspace value, if set.
- db.query.text that has the database query if included in CassandraInstrumentationOptions.
- server.address that has the host address value.
- server.port that has the host port value.
Declaration
public virtual Task OnNodeStartAsync(SessionRequestInfo sessionRequest, NodeRequestInfo nodeRequestInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | |
| NodeRequestInfo | nodeRequestInfo |
Returns
| Type | Description |
|---|---|
| Task | Activity task. |
OnNodeSuccessAsync(SessionRequestInfo, NodeRequestInfo)
Closes the Activity when the node request is successful.
Declaration
public virtual Task OnNodeSuccessAsync(SessionRequestInfo sessionRequest, NodeRequestInfo nodeRequestInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | Request contextual information. |
| NodeRequestInfo | nodeRequestInfo | Struct with host contextual information. |
Returns
| Type | Description |
|---|---|
| Task | Completed task. |
OnStartAsync(SessionRequestInfo)
Starts an Activity when request starts and includes the following Cassandra specific tags:
- db.system that has a harcoded value of `cassandra`.
- db.operation.name that has a harcoded value of `Session Request`.
- db.namespace that has the Keyspace value, if set.
- db.query.text that has the database query if included in CassandraInstrumentationOptions.
Declaration
public virtual Task OnStartAsync(SessionRequestInfo sessionRequest)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | Request contextual information. |
Returns
| Type | Description |
|---|---|
| Task | Activity task. |
OnSuccessAsync(SessionRequestInfo)
Closes the Activity when the session request is successful.
Declaration
public virtual Task OnSuccessAsync(SessionRequestInfo sessionRequest)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionRequestInfo | sessionRequest | Request contextual information. |
Returns
| Type | Description |
|---|---|
| Task | Completed task. |