feat(samples): [Global Attributes 3] Showcase scope attributes in Spring Boot 4 sample#5121
Open
adinauer wants to merge 5 commits intofeat/scope-attributes-logger-metricsfrom
Open
Conversation
Add Sentry.setAttribute() calls to PersonController and MetricController across all Spring Boot 4 sample variants to demonstrate scope attributes being auto-attached to logs and metrics. Add e2e test assertions and TestHelper methods to verify scope attributes appear on captured log and metric events. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Contributor
|
This reverts commit 7189bdc.
Contributor
Performance metrics 🚀
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8 tasks
Member
Author
|
PR Stack (Global Attributes):
|
This was referenced Feb 26, 2026
Member
Author
|
@sentry review |
Member
Author
|
cursor review |
...try-samples-spring-boot-4/src/main/java/io/sentry/samples/spring/boot4/PersonController.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Showcase the new scope attributes API (
Sentry.setAttribute()) in all Spring Boot 4 sample variants and add e2e test assertions to verify scope attributes are automatically attached to logs and metrics.Sample code changes:
PersonController: Setsuser.type,feature.version, anddebug.enabledscope attributes before logger callsMetricController: Setsuser.typeandfeature.versionscope attributes before counting metricsTest changes:
TestHelper: AddsdoesLogWithBodyHaveAttribute()anddoesMetricHaveAttribute()helpers for asserting attribute presence on log/metric eventsPersonSystemTest: Asserts scope attributes appear on captured log eventsMetricsSystemTest: Asserts scope attributes appear on captured metric eventsApplied consistently across all four Spring Boot 4 variants: base, opentelemetry, opentelemetry-noagent, and webflux.
Stacked on #5120
#skip-changelog