ApmTraceUtils

Collection of utility methods to help with performance tracing.

Properties

Link copied to clipboard
const val TAG_FORMAT: String

String format for the name of tags added to spans.

Link copied to clipboard
const val TAG_PREFIX: String

Standard prefix for tags added to spans.

Functions

Link copied to clipboard

Adds an exception to the currently active span, if one exists.

fun addExceptionToTrace(span: Span?, t: Throwable?)

Adds an exception to the provided span, if one exists.

Link copied to clipboard

Adds all the provided tags to the root span.

Link copied to clipboard
fun addTagsToTrace(tags: Map<String?, Any>, tagPrefix: String? = TAG_PREFIX)

Adds all provided tags to the currently active span, if one exists, under the provided tag name namespace.

fun addTagsToTrace(span: Span?, tags: Map<String?, Any>, tagPrefix: String?)

Adds all the provided tags to the provided span, if one exists.

Link copied to clipboard
fun formatTag(tagKey: String?, tagPrefix: String? = TAG_PREFIX): String

Formats the tag key using .TAG_FORMAT provided by this utility with the provided tag prefix.

Link copied to clipboard

Adds an exception to the root span, if an active one exists.