Browse Source

Polish "Add Kotlin samples for tracing"

See gh-46699
pull/46774/head
Stéphane Nicoll 4 months ago
parent
commit
ac73852e87
  1. 3
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/baggage/CreatingBaggage.kt
  2. 3
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/creatingspans/CustomObservation.kt
  3. 4
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/gettingstarted/MyApplication.kt

3
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/baggage/CreatingBaggage.kt

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2022 the original author or authors. * Copyright 2012-present the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,4 +27,5 @@ class CreatingBaggage(private val tracer: Tracer) {
// Business logic // Business logic
} }
} }
} }

3
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/creatingspans/CustomObservation.kt

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2022 the original author or authors. * Copyright 2012-present the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -30,4 +30,5 @@ class CustomObservation(private val observationRegistry: ObservationRegistry) {
// Business logic ... // Business logic ...
} }
} }
} }

4
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/micrometertracing/gettingstarted/MyApplication.kt

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2022 the original author or authors. * Copyright 2012-present the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,12 +29,12 @@ class MyApplication {
private val logger: Log = LogFactory.getLog(MyApplication::class.java) private val logger: Log = LogFactory.getLog(MyApplication::class.java)
@RequestMapping("/") @RequestMapping("/")
fun hello(): String { fun hello(): String {
logger.info("home() has been called") logger.info("home() has been called")
return "Hello, World!" return "Hello, World!"
} }
} }
fun main(args: Array<String>) { fun main(args: Array<String>) {

Loading…
Cancel
Save