feat(metrics): Add before_send_metric callback#1064
Merged
Conversation
|
a9398ed to
cf1dd39
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 17, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
cf1dd39 to
cdad82d
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 17, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
cdad82d to
286f469
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 17, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
lcian
reviewed
Apr 17, 2026
|
|
||
| assert_eq!( | ||
| metric.attributes.get("added_by_callback"), | ||
| Some(&LogAttribute(Value::from("yes"))), |
Member
There was a problem hiding this comment.
Did we intend to call this just Attribute (could either be a new type or just a type alias)? I don't remember what was the outcome of that discussion (if any).
Member
Author
There was a problem hiding this comment.
Yeah, I think it makes sense to make that change. Likely we should do it as a type alias (rename LogAttribute to Attribute, and make LogAttribute an alias to Attribute). However, I believe we can also do this later, should be a backwards and forwards-compatible change as far as I am aware
lcian
approved these changes
Apr 17, 2026
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 21, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
286f469 to
816fa87
Compare
948a361 to
aa6f863
Compare
816fa87 to
225d1dd
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 21, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 21, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
aa6f863 to
eece55d
Compare
225d1dd to
bae243c
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 21, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 21, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
eece55d to
787d60a
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 22, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 22, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
bae243c to
d429da8
Compare
787d60a to
807de4c
Compare
aab78c9 to
aeedb59
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 23, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
9d92d41 to
7eb91c1
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 23, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
7eb91c1 to
c4a07ca
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 24, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 24, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
aeedb59 to
1d9898c
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 24, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
c4a07ca to
9f36635
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 24, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
9f36635 to
fb22cb5
Compare
1d9898c to
98f78df
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
fb22cb5 to
b18ca0a
Compare
98f78df to
a628e6f
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
b18ca0a to
927c3ef
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
a628e6f to
3c4abb6
Compare
Base automatically changed from
szokeasaurusrex/user-attributes-metrics
to
master
April 28, 2026 13:50
Run metrics through `ClientOptions::before_send_metric` after scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching. Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Closes #1025 Closes [RUST-170](https://linear.app/getsentry/issue/RUST-170/add-before-send-metric-callback-processing-in-sentry-core)
927c3ef to
a68455f
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Apr 28, 2026
Stacked on #1064 Closes #1011 Closes [RUST-161](https://linear.app/getsentry/issue/RUST-161/add-trace-metric-rate-limiting-behavior-for-transport) Co-Authored-By: Joris Bayer <joris.bayer@sentry.io>
3 tasks
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.
Run metrics through
ClientOptions::before_send_metricafter scope/default attribute enrichment and before enqueue so applications can filter or mutate metrics before batching.Stacked on #1063.
Co-authored-by: Joris Bayer joris.bayer@sentry.io
Closes #1025
Closes RUST-170