Skip to content

Name of the method appears mangled when result is kotlin.Result #573

@maxkomarychev

Description

@maxkomarychev

Related links:

Expected Behavior

Name of the method should appear in the trace as is or as specified in the first arg of @NewSpan.

Actual Behaviour

The name appears with extra characters, given this code:

@Singleton
open class OneService {
    @NewSpan
    open fun hello(): Result<String> {
        return Result.success("hello")
    }
}

the name of the method in the trace appears like this:

name1

and when doing

@NewSpan("helloworld")

it appears like this:

name2

Steps To Reproduce

Set up a dummy service and a controller:

@Singleton
open class OneService {
    @NewSpan("helloworld")
    open fun hello(): Result<String> {
        return Result.success("hello")
    }
}

@Controller("/probes")
class Healthcheck(val oneService: OneService) {
    @Get("/health")
    fun health(): String {
        return "health" + oneService.hello().getOrThrow()
    }
}

Run jaeger:

docker run --name jaeger \
  -e COLLECTOR_OTLP_ENABLED=true \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  jaegertracing/all-in-one

Call the method: curl http://localhost:8080/probes/health

Observe wrong names in the trace.

Environment Information

  • macos 14.5 (23F79)
  • jdk 17

Example Application

No response

Version

4.4.2, 4.50

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions