Enable attributes on the session, and send as span attributes on replay#1313
Merged
Conversation
matux
approved these changes
Sep 18, 2025
| return this.#attributes; | ||
| } | ||
|
|
||
| setAttributes(attributes) { |
Contributor
There was a problem hiding this comment.
Nit: I think you can do set attributes here too, instead of making a function.
non-blocking
Contributor
Author
There was a problem hiding this comment.
The semantics are different. This method doesn't replace attributes, so I don't want code that looks like attributes =.
I'm considering updateAttributes.
| expect(mockSpan.setAttribute.calledOnce).to.be.true; | ||
| expect(mockSpan.setAttribute.calledWith('rollbar.replay.id', testReplayId)).to.be.true; | ||
| expect(mockSpan.setAttributes.calledOnce).to.be.true; | ||
| expect(mockSpan.setAttributes.calledWith({'rollbar.replay.id': testReplayId})).to.be.true; |
Contributor
There was a problem hiding this comment.
Oh, but how do you test it if you use the set keyword instead of making a setAttributes function?
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.
Description of the change
Enables attributes on the session instance, and updates the recorder to add session attributes to the replay span as span attributes.
Type of change
Development