-
Notifications
You must be signed in to change notification settings - Fork 0
feat(instrumentation-react-native-redux): Adding new instrumentation library to track changes during Redux operations #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
package.json
Outdated
| ] | ||
| ], | ||
| "dependencies": { | ||
| "react": "^18.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this one be added in the package folder instead? Is it more of a peer dependency as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good catch! probably it was me hitting npm install react in the wrong place. I will fix it, this file shouldn't have changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
| * happening just once, when the store is created | ||
| */ | ||
| if (!provider) { | ||
| console.info('No TracerProvider found. Using global tracer instead.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could make configurable like the other PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you talking about the console messages? if so, yes. to make it configurable it's under my plans. if you talk about the Provider, I think it's configured by the following couple of lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep console messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
| // @ts-expect-error | ||
| const store = createStore( | ||
| rootReducer, | ||
| compose(applyMiddleware(otelLoggerMiddleware)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I think a test we could construct to confirm the behaviour when there's other middleware is:
- add some artificial delay of 50ms or something to the redux action
- confirm the span duration for the action is >= 50ms
- apply other middleware before and after the OTEL one that do a noop
- repeat the test and confirm the span still has that duration
5d2a3ed to
073a192
Compare
f8e801c to
18ec2b0
Compare
…ibrary to track changes during Redux operations
c16a316 to
77204f1
Compare
reducing slowness
77204f1 to
836def0
Compare
jpmunz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good to me, I think the only thing missing is a hook for custom attributes so that we can set emb.type from the Embrace SDK
1f72858 to
e2df6b0
Compare
|
@facostaembrace fyi I ran into package conflicts after getting the latest from main, I found it easiest to move forward by removing these dependencies which meant taking the react components out of the tests but I think they still exercise the same functionality: |
Which problem is this PR solving?
Short description of the changes