Skip to content

Commit

Permalink
simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Dec 17, 2024
1 parent a01fa94 commit fc032cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ abstract class AbstractKtorClientTelemetryBuilder(
}

internal lateinit var openTelemetry: OpenTelemetry
internal lateinit var internalBuilder: DefaultHttpClientInstrumenterBuilder<HttpRequestData, HttpResponse>
protected lateinit var builder: DefaultHttpClientInstrumenterBuilder<HttpRequestData, HttpResponse>

internal fun builder(): DefaultHttpClientInstrumenterBuilder<HttpRequestData, HttpResponse> {
return builder
}

fun setOpenTelemetry(openTelemetry: OpenTelemetry) {
this.openTelemetry = openTelemetry
this.internalBuilder = DefaultHttpClientInstrumenterBuilder.create(
this.builder = DefaultHttpClientInstrumenterBuilder.create(
instrumentationName,
openTelemetry,
KtorHttpClientAttributesGetter
)
this.builder = internalBuilder
}

protected fun getOpenTelemetry(): OpenTelemetry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Experimental private constructor() {

companion object {
fun emitExperimentalTelemetry(builder: AbstractKtorClientTelemetryBuilder) {
builder.internalBuilder.setEmitExperimentalHttpClientMetrics(true)
builder.builder().setEmitExperimentalHttpClientMetrics(true)
}

fun emitExperimentalTelemetry(builder: AbstractKtorServerTelemetryBuilder) {
Expand Down

0 comments on commit fc032cb

Please sign in to comment.