diff --git a/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/client/AbstractKtorClientTelemetryBuilder.kt b/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/client/AbstractKtorClientTelemetryBuilder.kt index fd5a594cfb75..7eb2f7d21cb0 100644 --- a/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/client/AbstractKtorClientTelemetryBuilder.kt +++ b/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/client/AbstractKtorClientTelemetryBuilder.kt @@ -63,7 +63,7 @@ abstract class AbstractKtorClientTelemetryBuilder( builder.setKnownMethods(methods.toSet()) } - fun attributeExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) { + fun attributesExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) { val builder = ExtractorBuilder().apply(extractorBuilder).build() this.builder.addAttributeExtractor( object : AttributesExtractor { diff --git a/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/server/AbstractKtorServerTelemetryBuilder.kt b/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/server/AbstractKtorServerTelemetryBuilder.kt index 62b1a9633b1f..e8a3754337ab 100644 --- a/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/server/AbstractKtorServerTelemetryBuilder.kt +++ b/instrumentation/ktor/ktor-2-common/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/common/server/AbstractKtorServerTelemetryBuilder.kt @@ -40,15 +40,6 @@ abstract class AbstractKtorServerTelemetryBuilder(private val instrumentationNam ) } - @Deprecated("Please use method `spanStatusExtractor`") - fun setStatusExtractor( - extractor: (SpanStatusExtractor) -> SpanStatusExtractor - ) { - spanStatusExtractor { prevStatusExtractor -> - extractor(prevStatusExtractor).extract(spanStatusBuilder, request, response, error) - } - } - fun spanStatusExtractor(extract: SpanStatusData.(SpanStatusExtractor) -> Unit) { builder.setStatusExtractor { prevExtractor -> SpanStatusExtractor { spanStatusBuilder: SpanStatusBuilder, @@ -70,13 +61,6 @@ abstract class AbstractKtorServerTelemetryBuilder(private val instrumentationNam val error: Throwable? ) - @Deprecated("Please use method `spanKindExtractor`") - fun setSpanKindExtractor(extractor: (SpanKindExtractor) -> SpanKindExtractor) { - spanKindExtractor { prevSpanKindExtractor -> - extractor(prevSpanKindExtractor).extract(this) - } - } - fun spanKindExtractor(extract: ApplicationRequest.(SpanKindExtractor) -> SpanKind) { spanKindExtractor = { prevExtractor -> SpanKindExtractor { request: ApplicationRequest -> @@ -85,19 +69,7 @@ abstract class AbstractKtorServerTelemetryBuilder(private val instrumentationNam } } - @Deprecated("Please use method `attributeExtractor`") - fun addAttributeExtractor(extractor: AttributesExtractor) { - attributeExtractor { - onStart { - extractor.onStart(attributes, parentContext, request) - } - onEnd { - extractor.onEnd(attributes, parentContext, request, response, error) - } - } - } - - fun attributeExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) { + fun attributesExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) { val builder = ExtractorBuilder().apply(extractorBuilder).build() this.builder.addAttributesExtractor( object : AttributesExtractor { @@ -145,36 +117,18 @@ abstract class AbstractKtorServerTelemetryBuilder(private val instrumentationNam val error: Throwable? ) - @Deprecated( - "Please use method `capturedRequestHeaders`", - ReplaceWith("capturedRequestHeaders(headers)") - ) - fun setCapturedRequestHeaders(headers: List) = capturedRequestHeaders(headers) - fun capturedRequestHeaders(vararg headers: String) = capturedRequestHeaders(headers.asIterable()) fun capturedRequestHeaders(headers: Iterable) { builder.setCapturedRequestHeaders(headers.toList()) } - @Deprecated( - "Please use method `capturedResponseHeaders`", - ReplaceWith("capturedResponseHeaders(headers)") - ) - fun setCapturedResponseHeaders(headers: List) = capturedResponseHeaders(headers) - fun capturedResponseHeaders(vararg headers: String) = capturedResponseHeaders(headers.asIterable()) fun capturedResponseHeaders(headers: Iterable) { builder.setCapturedResponseHeaders(headers.toList()) } - @Deprecated( - "Please use method `knownMethods`", - ReplaceWith("knownMethods(knownMethods)") - ) - fun setKnownMethods(knownMethods: Set) = knownMethods(knownMethods) - fun knownMethods(vararg methods: String) = knownMethods(methods.asIterable()) fun knownMethods(vararg methods: HttpMethod) = knownMethods(methods.asIterable())