mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
LME-759: fix telemetry (langfuse) in AI Diff - 3
GitOrigin-RevId: 9f1ea1c58a0463f2b7abf9438049371985b3cf8c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
725ac0dfc0
commit
c83d711af5
@@ -59,6 +59,19 @@ suspend inline fun <T> SpanBuilder.useWithScope(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method if telemetry is optional and turned on/off based on registry keys or options
|
||||
* Usage example:
|
||||
* telemetryTracer?.spanBuilder(...).useOrRun {
|
||||
* // some code that must be executed in any case, telemetry or not
|
||||
* }
|
||||
*
|
||||
* Executes the given operation with a span builder, if it's not null, and returns the result.
|
||||
* If the span builder is null, the operation is executed with a null span.
|
||||
*
|
||||
* @param operation The operation to execute with the span builder.
|
||||
* @return The result of the operation.
|
||||
*/
|
||||
@Internal
|
||||
suspend inline fun <T> SpanBuilder?.useOrRun(
|
||||
crossinline operation: suspend (Span?) -> T,
|
||||
|
||||
Reference in New Issue
Block a user