Skip to content

Commit

Permalink
move constant for cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
a10zn8 committed Aug 21, 2023
1 parent fd6f617 commit 80a8996
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const val SPAN_REQUEST_API_TYPE = "request.api.type"
const val SPAN_REQUEST_UPSTREAM_ID = "request.upstreamId"
const val SPAN_REQUEST_ID = "request.id"
const val SPAN_NO_RESPONSE_MESSAGE = "no-response.message"
const val SPAN_REQUEST_CANCELLED = "cancelled"

const val LOCAL_READER = "localReader"
const val RPC_READER = "rpcReader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.emeraldpay.dshackle.reader
import io.emeraldpay.dshackle.commons.SPAN_ERROR
import io.emeraldpay.dshackle.commons.SPAN_READER_NAME
import io.emeraldpay.dshackle.commons.SPAN_READER_RESULT
import io.emeraldpay.dshackle.commons.SPAN_REQUEST_CANCELLED
import io.emeraldpay.dshackle.commons.SPAN_REQUEST_INFO
import io.emeraldpay.dshackle.commons.SPAN_STATUS_MESSAGE
import io.emeraldpay.dshackle.data.HashId
Expand Down Expand Up @@ -39,7 +40,7 @@ class SpannedReader<K, D>(
}
.doOnNext { newSpan.end() }
.doOnCancel {
newSpan.tag(SPAN_STATUS_MESSAGE, "cancelled").end()
newSpan.tag(SPAN_STATUS_MESSAGE, SPAN_REQUEST_CANCELLED).end()
}
.switchIfEmpty {
newSpan.tag(SPAN_READER_RESULT, "empty result").end()
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import io.emeraldpay.dshackle.SilentException
import io.emeraldpay.dshackle.commons.LOCAL_READER
import io.emeraldpay.dshackle.commons.RPC_READER
import io.emeraldpay.dshackle.commons.SPAN_ERROR
import io.emeraldpay.dshackle.commons.SPAN_REQUEST_CANCELLED
import io.emeraldpay.dshackle.commons.SPAN_REQUEST_ID
import io.emeraldpay.dshackle.commons.SPAN_STATUS_MESSAGE
import io.emeraldpay.dshackle.config.MainConfig
Expand Down Expand Up @@ -125,7 +126,7 @@ open class NativeCall(
}
.doOnNext { callRes -> completeSpan(callRes, requestCount) }
.doOnCancel {
tracer.currentSpan()?.tag(SPAN_STATUS_MESSAGE, "cancel")?.end()
tracer.currentSpan()?.tag(SPAN_STATUS_MESSAGE, SPAN_REQUEST_CANCELLED)?.end()
}
.contextWrite { ctx -> createTracingReactorContext(ctx, requestCount, requestId, requestSpan) }
}
Expand Down

0 comments on commit 80a8996

Please sign in to comment.