Skip to content

feat(core): [Global Attributes 4] Detect integer attribute type correctly for all integer Number subtypes#5122

Merged
adinauer merged 3 commits intofeat/global-attributes-apifrom
fix/attribute-integer-type-detection
Mar 3, 2026
Merged

feat(core): [Global Attributes 4] Detect integer attribute type correctly for all integer Number subtypes#5122
adinauer merged 3 commits intofeat/global-attributes-apifrom
fix/attribute-integer-type-detection

Conversation

@adinauer
Copy link
Member

📜 Description

SentryAttributeType.inferFrom() only checked for Integer when detecting the INTEGER type. All other integer-like Number subtypes (Long, Short, Byte, BigInteger, AtomicInteger, AtomicLong) fell through to the Number catch-all and were incorrectly classified as DOUBLE.

Extended the INTEGER check to cover all integer-like Number subtypes. Floating-point types (Float, Double, BigDecimal) still correctly map to DOUBLE.

💡 Motivation and Context

💚 How did you test it?

Added SentryAttributeTypeTest with tests for all Number subtypes (Integer, Long, Short, Byte, BigInteger, AtomicInteger, AtomicLong, Double, Float, BigDecimal) as well as Boolean, String, and null.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

…ubtypes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear
Copy link

linear bot commented Feb 26, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Core

  • [Global Attributes 4] Detect integer attribute type correctly for all integer Number subtypes by adinauer in #5122
  • [Global Attributes 1] Add scope-level attributes API by adinauer in #5118
  • [Global Attributes 2] Wire scope attributes into LoggerApi and MetricsApi by adinauer in #5120

Other

  • (otel) Create sentry-opentelemetry-otlp module for combining OpenTelemetry SDK OTLP export with Sentry SDK by adinauer in #5100
  • (screenshot) Add screenshot masking using view hierarchy by romtsn in #5077

Bug Fixes 🐛

  • (android) Remove AndroidRuntimeManager to prevent ANRs during SDK init by romtsn in #5127
  • (gestures) Use peekDecorView to not force view hierarchy construction by romtsn in #5134
  • (init) Reduce allocations and bytecode instructions during Sentry.init by romtsn in #5135
  • (transport) Handle HTTP 413 with actionable log and use send_error for HTTP errors by adinauer in #5115
  • Trim DSN string before URI parsing by adinauer in #5113
  • Safe unregister SystemEventsBroadcastReceiver by kollesnica1337 in #5106

Internal Changes 🔧

Deps

  • Bump getsentry/craft from 2.21.7 to 2.23.1 by dependabot in #5129
  • Update Native SDK to v0.13.1 by github-actions in #5104
  • Bump actions/upload-artifact from 6 to 7 by dependabot in #5130
  • Bump actions/download-artifact from 7 to 8 by dependabot in #5132
  • Bump gradle/actions from 5.0.1 to 5.0.2 by dependabot in #5131
  • Bump github/codeql-action from 4.32.2 to 4.32.4 by dependabot in #5109
  • Bump getsentry/craft from 2.21.2 to 2.21.7 by dependabot in #5110

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 363.88 ms 428.33 ms 64.45 ms
Size 1.58 MiB 2.29 MiB 722.93 KiB

@adinauer adinauer changed the title fix: Detect integer attribute type correctly for all integer Number subtypes feat(core): [Global Attributes 4] Detect integer attribute type correctly for all integer Number subtypes Feb 26, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e077d0d

@adinauer
Copy link
Member Author

PR Stack (Global Attributes):

  1. #5118 — Add scope-level attributes API
  2. #5120 — Wire scope attributes into LoggerApi and MetricsApi
  3. #5121 — Showcase scope attributes in Spring Boot 4 samples
  4. #5122 — Detect integer attribute type correctly for all integer Number subtypes
  5. #5124 — Support collections and arrays in log attribute type inference

@adinauer
Copy link
Member Author

@sentry review

@adinauer
Copy link
Member Author

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Base automatically changed from feat/scope-attributes-sample-e2e to feat/global-attributes-api March 3, 2026 14:41
@adinauer adinauer merged commit e15272c into feat/global-attributes-api Mar 3, 2026
57 checks passed
@adinauer adinauer deleted the fix/attribute-integer-type-detection branch March 3, 2026 14:51
@adinauer adinauer mentioned this pull request Mar 4, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants