Commit ee611d9
feat(samples): [Global Attributes 6] Showcase scope attributes in all sample modules (#5149)
* feat(core): Add scope-level attributes API
Add setAttribute, setAttributes, removeAttribute, and getAttributes
to IScope/IScopes/Sentry so users can set attributes on the scope
that are automatically included in logs and metrics events.
Also refactor type inference logic into SentryAttributeType.inferFrom
and add SentryLogEventAttributeValue.fromAttribute factory method,
removing duplicate getType helpers from LoggerApi and MetricsApi.
Co-Authored-By: Claude <noreply@anthropic.com>
* changelog
* ref: Split out LoggerApi/MetricsApi changes for stacked PR
Move factory method extractions (SentryAttributeType.inferFrom,
SentryLogEventAttributeValue.fromAttribute) and LoggerApi/MetricsApi
scope attribute integration to a separate stacked PR.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(core): Wire scope attributes into LoggerApi and MetricsApi
Extract factory methods SentryAttributeType.inferFrom and
SentryLogEventAttributeValue.fromAttribute to reduce duplication.
Apply scope attributes to log and metric events automatically.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* changelog
* feat(samples): Showcase scope attributes in Spring Boot 4 samples
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>
* changelog
* Revert "changelog"
This reverts commit 7189bdc.
* ref: Remove redundant comments from variant controllers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ref: Limit scope attributes sample to base Spring Boot 4 variant
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: Detect integer attribute type correctly for all integer Number subtypes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* changelog
* feat: Support collections and arrays in log attribute type inference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* changelog
* test: Add coverage for arrayAttribute factory method
Add arrayAttribute and named array attribute usage to the four
attribute tests in ScopesTest (log, count metric, distribution metric,
gauge metric) to verify the factory method works end-to-end.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(samples): Showcase scope attributes in all sample modules
Add Sentry.setAttribute() calls to all sample source files and
corresponding attribute assertions to all system tests. This extends
the scope attributes showcase from sentry-samples-spring-boot-4 to
all 19 remaining sample modules with system tests.
Co-Authored-By: Claude <noreply@anthropic.com>
* Format code
* ci: trigger CI re-run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: retrigger CI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* remove duplicate changelog
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>1 parent b1045ed commit ee611d9
File tree
66 files changed
+369
-33
lines changed- sentry-samples
- sentry-samples-console-opentelemetry-noagent/src
- main/java/io/sentry/samples/console
- test/kotlin/sentry/systemtest
- sentry-samples-console/src
- main/java/io/sentry/samples/console
- test/kotlin/io/sentry/systemtest
- sentry-samples-jul/src
- main/java/io/sentry/samples/jul
- test/kotlin/io/sentry/systemtest
- sentry-samples-log4j2/src
- main/java/io/sentry/samples/log4j2
- test/kotlin/io/sentry/systemtest
- sentry-samples-logback/src
- main/java/io/sentry/samples/logback
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-7/src
- main/java/io/sentry/samples/spring7/web
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-4-opentelemetry-noagent/src
- main/java/io/sentry/samples/spring/boot4
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-4-opentelemetry/src
- main/java/io/sentry/samples/spring/boot4
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-4-webflux/src
- main/java/io/sentry/samples/spring/boot4
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src
- main/java/io/sentry/samples/spring/boot/jakarta
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-jakarta-opentelemetry/src
- main/java/io/sentry/samples/spring/boot/jakarta
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-jakarta/src
- main/java/io/sentry/samples/spring/boot/jakarta
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-opentelemetry-noagent/src
- main/java/io/sentry/samples/spring/boot
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-opentelemetry/src
- main/java/io/sentry/samples/spring/boot
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-webflux-jakarta/src
- main/java/io/sentry/samples/spring/boot/jakarta
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot-webflux/src
- main/java/io/sentry/samples/spring/boot
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-boot/src
- main/java/io/sentry/samples/spring/boot
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring-jakarta/src
- main/java/io/sentry/samples/spring/jakarta/web
- test/kotlin/io/sentry/systemtest
- sentry-samples-spring/src
- main/java/io/sentry/samples/spring/web
- test/kotlin/io/sentry/systemtest
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
66 files changed
+369
-33
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
0 commit comments