Skip to content
Merged
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
15 changes: 5 additions & 10 deletions .cursor/rules/new_module.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@ the release that first ships it. All of the following have to be merged **before

2. Add the module to the include list in `settings.gradle.kts`

If adding a `sentry-samples` module, also add it to the `ignoredProjects` list in the root `build.gradle.kts`:

```kotlin
ignoredProjects.addAll(
listOf(
// ... existing projects ...
"sentry-samples-{module-name}"
)
)
```
If adding a sample, add an `include("…")` line for it to `sentry-samples/settings.gradle.kts`
instead, and apply `id("io.sentry.spotless")` and `id("io.sentry.jdk-target")` in its `plugins`
block. The samples are a separate Gradle build that includes the SDK build, so a sample depends on
`"io.sentry:sentry-{module-name}:$sentryVersion"` (with `val sentryVersion =
libs.versions.sentry.get()`), and Gradle substitutes the SDK's project for it.

3. Add a `SENTRY_{MODULE}_SDK_NAME` constant to the `Config.Sentry` block in
`buildSrc/src/main/java/Config.kt`:
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ updates:
- "/"
- "/sentry-samples/sentry-samples-android"
- "/sentry-android-integration-tests"
- "/sentry-samples"
registries:
- gradle-plugin-portal
schedule:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
path: sentry-samples/sentry-samples-android
- name: sentry-android-integration-tests
path: sentry-android-integration-tests
- name: sentry-samples
path: sentry-samples

steps:
- name: Checkout Repo
Expand Down
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ resolves the per-module test task, including integration test suites, for you.

# Build the Android sample, a separate Gradle build that includes this one
./gradlew -p sentry-samples/sentry-samples-android assembleDebug

# Build the JVM samples, another separate Gradle build that includes this one
./gradlew -p sentry-samples assemble
```

## Development Workflow Rules
Expand Down Expand Up @@ -113,7 +116,7 @@ The repository is organized into multiple modules:

### Utility Modules
- **`sentry-test-support`** - Shared test utilities, including `MockSentryServer` and envelope matchers
- **`sentry-samples`** - Example applications. `sentry-samples-android` is a separate Gradle build that includes this one, so root tasks such as `check` and `spotlessApply` don't reach it
- **`sentry-samples`** - Example applications, in two separate Gradle builds that include this one: `sentry-samples` (JVM) and `sentry-samples/sentry-samples-android`. Root tasks such as `check` and `spotlessApply` don't reach them, and `sentry-android-integration-tests` is a separate build too
- **`sentry-bom`** - Bill of Materials for dependency management

### Key Architectural Patterns
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ update:
# Spotless formats the code. The root spotlessApply doesn't reach the separate builds.
format:
./gradlew spotlessApply
./gradlew -p sentry-samples spotlessApply
./gradlew -p sentry-samples/sentry-samples-android spotlessApply
./gradlew -p sentry-android-integration-tests spotlessApply

# Spotless check's code
checkFormat:
./gradlew spotlessJavaCheck spotlessKotlinCheck
./gradlew -p sentry-samples spotlessJavaCheck spotlessKotlinCheck
./gradlew -p sentry-samples/sentry-samples-android spotlessJavaCheck spotlessKotlinCheck
./gradlew -p sentry-android-integration-tests spotlessJavaCheck spotlessKotlinCheck

Expand Down
5 changes: 1 addition & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ plugins {
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.errorprone) apply false
alias(libs.plugins.gradle.versions) apply false
alias(libs.plugins.spring.dependency.management) apply false
id("io.sentry.javadoc.aggregate")
alias(libs.plugins.android.application) apply false
}
Expand Down Expand Up @@ -51,9 +50,7 @@ allprojects {
tasks.register("buildForCodeQL") {
subprojects
.filter {
!it.displayName.contains("sample") &&
!it.displayName.contains("integration-tests") &&
!it.displayName.contains("bom") &&
!it.displayName.contains("bom") &&
it.name != "sentry-opentelemetry"
}
.forEach { proj ->
Expand Down
8 changes: 8 additions & 0 deletions sentry-samples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.spring) apply false
alias(libs.plugins.spring.dependency.management) apply false
alias(libs.plugins.gradle.versions) apply false
id("io.sentry.spotless") apply false
id("io.sentry.jdk-target") apply false
}
1 change: 1 addition & 0 deletions sentry-samples/gradle.properties
1 change: 1 addition & 0 deletions sentry-samples/gradle/gradle-daemon-jvm.properties
1 change: 1 addition & 0 deletions sentry-samples/gradle/wrapper
1 change: 1 addition & 0 deletions sentry-samples/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.console.Main") }

dependencies {
implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentless)
implementation(projects.sentryAsyncProfiler)
implementation("io.sentry:sentry-opentelemetry-agentless:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")
}

// Configure the Shadow JAR (executable JAR with all dependencies)
Expand Down
6 changes: 4 additions & 2 deletions sentry-samples/sentry-samples-console-otlp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.console.Main") }

dependencies {
implementation(projects.sentryOpentelemetry.sentryOpentelemetryOtlp)
implementation(projects.sentryAsyncProfiler)
implementation("io.sentry:sentry-opentelemetry-otlp:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")
implementation(libs.otel.semconv)
implementation(libs.otel.semconv.incubating)
implementation(libs.otel.exporter.logging)
Expand Down
10 changes: 6 additions & 4 deletions sentry-samples/sentry-samples-console/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.console.Main") }

dependencies {
implementation(projects.sentry)
implementation(projects.sentryAsyncProfiler)
implementation(projects.sentryJcache)
implementation(projects.sentryKafka)
implementation("io.sentry:sentry:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")
implementation("io.sentry:sentry-jcache:$sentryVersion")
implementation("io.sentry:sentry-kafka:$sentryVersion")
implementation(libs.jcache)
implementation(libs.caffeine.jcache)
implementation(libs.kafka.clients)
Expand Down
4 changes: 3 additions & 1 deletion sentry-samples/sentry-samples-jul/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.jul.Main") }

dependencies {
implementation(projects.sentryJul)
implementation("io.sentry:sentry-jul:$sentryVersion")
implementation(libs.slf4j.jdk14)
}

Expand Down
6 changes: 4 additions & 2 deletions sentry-samples/sentry-samples-ktor-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.ktorClient.Main") }

configure<JavaPluginExtension> {
Expand All @@ -21,8 +23,8 @@ dependencies {
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.java)
implementation(libs.kotlinx.coroutines)
implementation(projects.sentry)
implementation(projects.sentryKtorClient)
implementation("io.sentry:sentry:$sentryVersion")
implementation("io.sentry:sentry-ktor-client:$sentryVersion")
}

tasks.test { useJUnitPlatform() }
4 changes: 3 additions & 1 deletion sentry-samples/sentry-samples-log4j2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.log4j2.Main") }

dependencies {
implementation(projects.sentryLog4j2)
implementation("io.sentry:sentry-log4j2:$sentryVersion")
implementation(libs.log4j.api)
implementation(libs.log4j.core)
}
Expand Down
4 changes: 3 additions & 1 deletion sentry-samples/sentry-samples-logback/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.logback.Main") }

dependencies {
implementation(projects.sentryLogback)
implementation("io.sentry:sentry-logback:$sentryVersion")
implementation(libs.logback.classic)
}

Expand Down
6 changes: 4 additions & 2 deletions sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.netflix.dgs.NetlixDgsApplication") }

group = "io.sentry.sample.spring-boot"
Expand All @@ -27,8 +29,8 @@ dependencies {
implementation(libs.springboot.starter.web)
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion()))
implementation(projects.sentrySpringBootStarter)
implementation(projects.sentryGraphql)
implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion")
implementation("io.sentry:sentry-graphql:$sentryVersion")
implementation(platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:4.9.2"))
implementation("com.netflix.graphql.dgs:graphql-dgs-subscriptions-websockets-autoconfigure:4.9.2")
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter")
Expand Down
6 changes: 4 additions & 2 deletions sentry-samples/sentry-samples-openfeign/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.openfeign.Main") }

configure<JavaPluginExtension> {
Expand All @@ -14,8 +16,8 @@ configure<JavaPluginExtension> {
}

dependencies {
implementation(projects.sentry)
implementation(projects.sentryOpenfeign)
implementation("io.sentry:sentry:$sentryVersion")
implementation("io.sentry:sentry-openfeign:$sentryVersion")
implementation(libs.feign.core)
implementation(libs.feign.gson)
}
4 changes: 3 additions & 1 deletion sentry-samples/sentry-samples-servlet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

group = "io.sentry.sample.servlet"

version = "0.0.1-SNAPSHOT"
Expand All @@ -13,7 +15,7 @@ java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation(projects.sentryServlet)
implementation("io.sentry:sentry-servlet:$sentryVersion")
implementation("javax.servlet:javax.servlet-api:4.0.1")
}

Expand Down
8 changes: 5 additions & 3 deletions sentry-samples/sentry-samples-spring-7/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

application { mainClass.set("io.sentry.samples.spring7.Main") }

// Ensure WAR is up to date before run task
Expand All @@ -38,9 +40,9 @@ dependencies {
implementation("org.springframework.security:spring-security-config")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion()))
implementation(projects.sentrySpring7)
implementation(projects.sentryLogback)
implementation(projects.sentryAsyncProfiler)
implementation("io.sentry:sentry-spring-7:$sentryVersion")
implementation("io.sentry:sentry-logback:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")
implementation(libs.jackson.databind)
implementation(libs.logback.classic)
implementation(libs.servlet.jakarta.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

group = "io.sentry.sample.spring-boot-4-log4j2"

version = "0.0.1-SNAPSHOT"
Expand Down Expand Up @@ -41,12 +43,12 @@ dependencies {
implementation("org.aspectj:aspectjweaver")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion()))
implementation(projects.sentrySpringBoot4Starter)
implementation(projects.sentryGraphql22)
implementation(projects.sentryQuartz)
implementation(projects.sentryAsyncProfiler)
implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion")
implementation("io.sentry:sentry-graphql-22:$sentryVersion")
implementation("io.sentry:sentry-quartz:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")

implementation(projects.sentryLog4j2)
implementation("io.sentry:sentry-log4j2:$sentryVersion")
implementation("org.springframework.boot:spring-boot-starter-log4j2")
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
Expand All @@ -63,9 +65,9 @@ dependencies {

// kafka
implementation(libs.springboot4.starter.kafka)
implementation(projects.sentryKafka)
implementation("io.sentry:sentry-kafka:$sentryVersion")

// database query tracing
implementation(projects.sentryJdbc)
implementation("io.sentry:sentry-jdbc:$sentryVersion")
runtimeOnly(libs.hsqldb)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ plugins {
id("io.sentry.jdk-target")
}

val sentryVersion = libs.versions.sentry.get()

group = "io.sentry.sample.spring-boot-4"

version = "0.0.1-SNAPSHOT"
Expand Down Expand Up @@ -41,19 +43,19 @@ dependencies {
implementation("org.aspectj:aspectjweaver")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion()))
implementation(projects.sentrySpringBoot4Starter)
implementation(projects.sentryLogback)
implementation(projects.sentryGraphql22)
implementation(projects.sentryQuartz)
implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring)
implementation(projects.sentryAsyncProfiler)
implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion")
implementation("io.sentry:sentry-logback:$sentryVersion")
implementation("io.sentry:sentry-graphql-22:$sentryVersion")
implementation("io.sentry:sentry-quartz:$sentryVersion")
implementation("io.sentry:sentry-opentelemetry-agentless-spring:$sentryVersion")
implementation("io.sentry:sentry-async-profiler:$sentryVersion")

// kafka
implementation(libs.springboot4.starter.kafka)
implementation(projects.sentryKafka)
implementation("io.sentry:sentry-kafka:$sentryVersion")

// database query tracing
implementation(projects.sentryJdbc)
implementation("io.sentry:sentry-jdbc:$sentryVersion")
runtimeOnly(libs.hsqldb)
}

Expand Down
Loading
Loading