Skip to content

Commit 8da36b5

Browse files
committed
Update OtelBase.kt
1 parent 06181dd commit 8da36b5

File tree

1 file changed

+21
-0
lines changed
  • plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel

1 file changed

+21
-0
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ abstract class AbstractBaseSpan<SpanType : AbstractBaseSpan<SpanType>>(internal
211211
return this as SpanType
212212
}
213213

214+
override fun recordException(exception: Throwable): SpanType {
215+
delegate.recordException(exception)
216+
return this as SpanType
217+
}
218+
214219
override fun end() {
215220
validateRequiredAttributes()
216221
delegate.end()
@@ -221,6 +226,22 @@ abstract class AbstractBaseSpan<SpanType : AbstractBaseSpan<SpanType>>(internal
221226
delegate.end()
222227
}
223228

229+
fun passive(passive: Boolean): SpanType {
230+
this._passive = passive
231+
return this as SpanType
232+
}
233+
234+
fun unit(unit: MetricUnit): SpanType {
235+
this._unit = unit
236+
return this as SpanType
237+
238+
}
239+
240+
fun value(value: Number): SpanType {
241+
this._value = value.toDouble()
242+
return this as SpanType
243+
}
244+
224245
private fun validateRequiredAttributes() {
225246
val missingFields = requiredFields.filter { delegate.getAttribute(AttributeKey.stringKey(it)) == null }
226247
val message = { "${delegate.name} is missing required fields: ${missingFields.joinToString(", ")}" }

0 commit comments

Comments
 (0)