feat: Adding SentrySpan to performance monitoring.#932
Conversation
…-cocoa into feat/sentryspan
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
philipphofmann
left a comment
There was a problem hiding this comment.
A first glance. I didn't have enough time to look at all of it. I will do that tomorrow.
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
Codecov Report
@@ Coverage Diff @@
## feat/performance-monitoring #932 +/- ##
===============================================================
- Coverage 94.43% 93.36% -1.08%
===============================================================
Files 80 81 +1
Lines 3612 3660 +48
===============================================================
+ Hits 3411 3417 +6
- Misses 201 243 +42
Continue to review full report at Codecov.
|
philipphofmann
left a comment
There was a problem hiding this comment.
The code looks already good. I addressed many things and also took a closer look at the tests this time. There are many minor comments.
| NSMutableArray *spans = [[NSMutableArray alloc] init]; | ||
| for (SentrySpan *span in self.spans) { | ||
| [spans addObject:[span serialize]]; | ||
| } | ||
| serializedData[@"spans"] = spans; |
There was a problem hiding this comment.
h: We need to make that thread-safe as well.
There was a problem hiding this comment.
It's true that this needs to be thread safe but it comes back to the fact that Transaction is an event, which isn't (and will never be) thread-safe. So we need to discuss what we do with this.
Lets discuss this Friday please, @mitsuhiko will be there
| span.operation = operation; | ||
| span.spanDescription = description; | ||
| span.sampled = self.isSampled; | ||
| @synchronized(self.spans) { |
There was a problem hiding this comment.
m: Can we please add a test to make sure this is thread-safe?
There was a problem hiding this comment.
One might argue "make sure it's thread-safe" isn't possible to achieve :P
There was a problem hiding this comment.
One might argue "make sure it's thread-safe" isn't possible to achieve :P
Indeed. Neither for positive, nor for negative outcome.
There was a problem hiding this comment.
time has shown that this answer will come, soon or later, if it was or not :D
but I agree, at least trivial thread-safe problems could be avoided with tests, so a test would be indeed, nice.
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
bruno-garcia
left a comment
There was a problem hiding this comment.
All open comments were closed except tests for thread-safety but given SentryTransaction isn't even expected to be thread safe (It won't be bound to the scope anymore as we agreed today) it isn't relevant.
|
A reminder that we're merging this into a branch and not into master and we can iterate, specially after our meeting today. |
|
Thanks, @bruno-garcia, for helping out on this one. I was swamped yesterday with other stuff, so I didn't take the time for another review. |
* feat: performance monitoring * build: Setup CI for performance monitoring branch * feat: Performance API: Transaction (#908) Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Clang Robot <clang-robot@sentry.io> Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> * test: Add captureTransaction to sample apps (#922) * docs: Improve code comments on transactions (#921) Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> * feat: Add missing properties to SpanContext and Transaction (#919) Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> * feat: Adding SentrySpan to performance monitoring. (#932) Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Clang Robot <clang-robot@sentry.io> * ref: Remove SentryTransaction from public API. (#950) Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> * feat: Add transaction sampling properties to SentryOptions (#961) * Transaction sampling * Update CHANGELOG.md * Format code * Apply suggestions from code review Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> * Testing and fixes * Using NSNumber for sampler return * Update CHANGELOG.md Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> * Comment Update * Using NSNumber for tracesSampleRate Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> * feat: Transaction in Sample App (#971) * Some UI Sample * Format code * Apply suggestions from code review Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> * removing button to download image * Adding status and fixing operation value * Fixed Tests Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> * merge fix * feat: Add sampling rules to SentryHub startTransaction. (#977) * Changing sampled from bool to enum, using TracesSampler * removing name from span * SamplingTests * changelog and code format * Lint Fix * Fix tests * Update Samples/iOS-Swift/iOS-Swift/TraceTestViewController.swift Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> * Random generator for sampling * missing comment * remove sampler from SentryHub+TestInit.h * Apply suggestions from code review Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> * meta: Add missing breaking change to Changelog * performance changelog Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io> Co-authored-by: Dhiogo Brustolin <dhiogorb@gmail.com> Co-authored-by: Clang Robot <clang-robot@sentry.io> Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
📜 Description
Creating the SentrySpan class and allowing transactions to create child.
💡 Motivation and Context
Requisite to the Performance API.
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps
TBD