Skip to content

Commit

Permalink
fix spotlessKotlinCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
marychatte committed Mar 27, 2024
1 parent 1afd0e3 commit a2c7ad8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,15 @@ class KtorClientTracingBuilder {
additionalExtractors += extractors
}

fun attributeExtractor(
extractorBuilder: ExtractorBuilder.() -> Unit = {}
) {
fun attributeExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) {
val builder = ExtractorBuilder().apply(extractorBuilder).build()
addAttributesExtractors(
object : AttributesExtractor<HttpRequestData, HttpResponse> {
override fun onStart(
attributes: AttributesBuilder,
parentContext: Context,
request: HttpRequestData
) {
override fun onStart(attributes: AttributesBuilder, parentContext: Context, request: HttpRequestData) {
builder.onStart(OnStartData(attributes, parentContext, request))
}

override fun onEnd(
attributes: AttributesBuilder,
context: Context,
request: HttpRequestData,
response: HttpResponse?,
error: Throwable?
) {
override fun onEnd(attributes: AttributesBuilder, context: Context, request: HttpRequestData, response: HttpResponse?, error: Throwable?) {
builder.onEnd(OnEndData(attributes, context, request, response, error))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,15 @@ class KtorServerTracing private constructor(
additionalExtractors.add(extractor)
}

fun attributeExtractor(
extractorBuilder: ExtractorBuilder.() -> Unit = {}
) {
fun attributeExtractor(extractorBuilder: ExtractorBuilder.() -> Unit = {}) {
val builder = ExtractorBuilder().apply(extractorBuilder).build()
addAttributeExtractor(
object : AttributesExtractor<ApplicationRequest, ApplicationResponse> {
override fun onStart(attributes: AttributesBuilder, parentContext: Context, request: ApplicationRequest) {
builder.onStart(OnStartData(attributes, parentContext, request))
}

override fun onEnd(
attributes: AttributesBuilder,
context: Context,
request: ApplicationRequest,
response: ApplicationResponse?,
error: Throwable?
) {
override fun onEnd(attributes: AttributesBuilder, context: Context, request: ApplicationRequest, response: ApplicationResponse?, error: Throwable?) {
builder.onEnd(OnEndData(attributes, context, request, response, error))
}
}
Expand Down

0 comments on commit a2c7ad8

Please sign in to comment.