Package com.activeviam.database.internal
Class ObservabilityUtil
java.lang.Object
com.activeviam.database.internal.ObservabilityUtil
Observability utilities.
- Author:
- ActiveViam
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Spans.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Tag the local name of the Aggregate Table when one is used to optimize the query.static final String
static final String
static final String
static final String
static final String
static final String
static final String
Tag keys (kebab case).static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Query types corresponding to the tagObservability.QUERY_TYPE_ATTRIBUTE
fordatabase queries
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.api.trace.SpanBuilder
buildSpanNotStarted
(io.opentelemetry.api.trace.Span parentSpan, String name) Creates a new span without starting it.static io.opentelemetry.api.trace.SpanBuilder
buildSpanNotStarted
(io.opentelemetry.api.trace.Span parentSpan, String name, Map<String, String> tags) Creates a new span without starting it.static io.opentelemetry.api.trace.SpanBuilder
buildSpanNotStarted
(String name) Creates a new span without starting it.static IEpoch
createDatabaseEpochWithObservability
(IEpochCreator epochCreator, String branchName, boolean isShadow, DatabaseId databaseId) Creates a database epoch and updates the associated sum metric.propagateTraceInTags
(Map<String, String> queryTags) Propagates trace tags in query tags if it exists.static void
Runs in a span.static void
sendQueryMetrics
(long startTime, boolean success, String subtype, String tableName) Sends query metrics.static <T> T
supplyInSpan
(io.opentelemetry.api.trace.SpanBuilder span, Supplier<T> supplier) Supplies the value in a span.static void
tagCurrentSpan
(String key, Supplier<String> valueSupplier) Tags current span if there is one.static void
tagCurrentSpan
(Supplier<Map<String, String>> tagSupplier) Tags current span if there is one.
-
Field Details
-
SPAN_DATA_CONTRIBUTION
Spans.- See Also:
-
SPAN_TIME_TRAVEL_FETCHING
- See Also:
-
SPAN_DATABASE_QUERY
- See Also:
-
SPAN_BIGQUERY_QUERY_TASK
- See Also:
-
SPAN_BIGQUERY_JOB_INIT
- See Also:
-
SPAN_BIGQUERY_JOB_EXEC
- See Also:
-
SPAN_BIGQUERY_RESULT_PROCESSING
- See Also:
-
SPAN_BIGQUERY_ARROW_STREAM_READING
- See Also:
-
SPAN_CLICKHOUSE_QUERY_COMPUTATION
- See Also:
-
SPAN_CLICKHOUSE_QUERY_PREPARATION
- See Also:
-
SPAN_CLICKHOUSE_QUERY_TASK
- See Also:
-
SPAN_CLICKHOUSE_RESULT_PROCESSING
- See Also:
-
SPAN_JDBC_QUERY_COMPUTATION
- See Also:
-
SPAN_JDBC_QUERY_PREPARATION
- See Also:
-
SPAN_JDBC_QUERY_EXECUTION_TASK
- See Also:
-
SPAN_JDBC_QUERY_RESULT_PROCESSING
- See Also:
-
SPAN_JDBC_QUERY_RESULT_READING
- See Also:
-
SPAN_DATASTORE_MAINTENANCE_OPERATION
- See Also:
-
SPAN_DATASTORE_TRANSACTION
- See Also:
-
TAG_DATABASE
Tag keys (kebab case).- See Also:
-
COMMIT_TRANSACTION
- See Also:
-
EXCEPTION_RECORDED
- See Also:
-
IS_NOT_SHADOW
- See Also:
-
IS_SHADOW
- See Also:
-
MAINTENANCE_OPERATION
- See Also:
-
ROLLBACK_TRANSACTION
- See Also:
-
TAG_EPOCH_ID
- See Also:
-
TAG_INTENDED_ACTION
- See Also:
-
TAG_SHADOW_TRANSACTION
- See Also:
-
TAG_STORES_LOCKED_BY_TRANSACTION
- See Also:
-
TAG_TRANSACTION_BRANCH
- See Also:
-
TAG_TRANSACTION_OUTCOME
- See Also:
-
TAG_WRITABLE_STORES
- See Also:
-
TAG_AGGREGATE_TABLE
Tag the local name of the Aggregate Table when one is used to optimize the query.- See Also:
-
TAG_SQL_QUERY_TEXT
- See Also:
-
TAG_SQL_QUERY_PARAMETERS
- See Also:
-
TAG_SQL_AGG_QUERY_PROCESSING_STATS
- See Also:
-
TAG_BIGQUERY_JOB_ID
- See Also:
-
TAG_BIGQUERY_JOB_STATUS
- See Also:
-
TAG_BIGQUERY_JOB_STATS
- See Also:
-
TAG_BIGQUERY_STREAM_STATS
- See Also:
-
TAG_CLICKHOUSE_QUERY_ID
- See Also:
-
TAG_CLICKHOUSE_STATS
- See Also:
-
TAG_SNOWFLAKE_QUERY_ID
- See Also:
-
TAG_SNOWFLAKE_RESULTSET_COUNT
- See Also:
-
TAG_SNOWFLAKE_RESULTSET_STATS
- See Also:
-
TYPE_LIST
Query types corresponding to the tagObservability.QUERY_TYPE_ATTRIBUTE
fordatabase queries
.- See Also:
-
TYPE_DISTINCT
- See Also:
-
TYPE_GET_BY_KEY
- See Also:
-
TYPE_AGGREGATE
- See Also:
-
TYPE_MULTI_STEP_AGGREGATE
- See Also:
-
-
Method Details
-
propagateTraceInTags
Propagates trace tags in query tags if it exists. -
buildSpanNotStarted
public static io.opentelemetry.api.trace.SpanBuilder buildSpanNotStarted(@Nullable io.opentelemetry.api.trace.Span parentSpan, String name) Creates a new span without starting it.- Parameters:
parentSpan
- the parent spanname
- the span name
-
buildSpanNotStarted
Creates a new span without starting it.- Parameters:
name
- the span name
-
buildSpanNotStarted
public static io.opentelemetry.api.trace.SpanBuilder buildSpanNotStarted(@Nullable io.opentelemetry.api.trace.Span parentSpan, String name, Map<String, String> tags) Creates a new span without starting it.- Parameters:
parentSpan
- the parent spanname
- the span nametags
- tags that will be added to the newly created span
-
tagCurrentSpan
Tags current span if there is one. -
tagCurrentSpan
Tags current span if there is one. -
supplyInSpan
Supplies the value in a span. -
runInSpan
Runs in a span. -
sendQueryMetrics
public static void sendQueryMetrics(long startTime, boolean success, String subtype, String tableName) Sends query metrics.- Parameters:
startTime
- the start time in nanosecondssuccess
- the success flagsubtype
- the subtype of the querytableName
- the table name
-
createDatabaseEpochWithObservability
public static IEpoch createDatabaseEpochWithObservability(IEpochCreator epochCreator, String branchName, boolean isShadow, DatabaseId databaseId) Creates a database epoch and updates the associated sum metric.
-