Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

7 changes: 7 additions & 0 deletions sentry-spring-boot-jakarta/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,20 @@ testing {
implementation(projects.sentryAsyncProfiler)
implementation(projects.sentryJdbc)
implementation(projects.sentryLogback)
implementation(projects.sentryOkhttp)
implementation(projects.sentryTestSupport)
// Reactor's automatic context propagation needs it to carry the Sentry scope across
// threads.
// The sample only had it because Spring GraphQL pulls it in.
implementation(libs.context.propagation)
implementation(libs.kotlin.test.junit)
implementation(libs.google.truth)
implementation(libs.okhttp)
implementation(libs.springboot3.starter.aop)
implementation(libs.springboot3.starter.jdbc)
implementation(libs.springboot3.starter.test)
implementation(libs.springboot3.starter.web)
implementation(libs.springboot3.starter.webflux)
runtimeOnly(libs.hsqldb)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.sentry.spring.boot.jakarta.integrationtest

import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.client.RestClient

/** Forwards to this app's own Person endpoints, so a trace continues through outgoing requests. */
@RestController
@RequestMapping("/tracing/")
open class DistributedTracingController(private val restClient: RestClient) {
@GetMapping("{id}")
open fun person(@PathVariable("id") id: Long): Person? =
restClient.get().uri(selfUrl("/person/$id")).retrieve().body(Person::class.java)

@PostMapping
open fun create(@RequestBody person: Person): Person? =
restClient.post().uri(selfUrl("/person/")).body(person).retrieve().body(Person::class.java)
}
Loading
Loading