Skip to content
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

feat: Add missing properties to SpanContext and Transaction #919

Merged

Conversation

brustolin
Copy link
Contributor

@brustolin brustolin commented Jan 29, 2021

📜 Description

Adding missing properties to SentrySpanContext, and SentryTransaction properties related to the spanContext.

💡 Motivation and Context

We are aiming to complete the Performance API

💚 How did you test it?

Unit Test

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the CHANGELOG if needed
  • I updated the docs if needed
  • Review from the native team if needed
  • No breaking changes

🔮

Transaction span childs

brustolin and others added 25 commits January 18, 2021 18:31
…to feature/performance

# Conflicts:
#	Sentry.xcodeproj/project.pbxproj
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
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>
@codecov-io
Copy link

Codecov Report

Merging #919 (56917e8) into feat/performance-monitoring (436c1b7) will decrease coverage by 0.12%.
The diff coverage is 74.56%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           feat/performance-monitoring     #919      +/-   ##
===============================================================
- Coverage                        94.16%   94.03%   -0.13%     
===============================================================
  Files                               80       80              
  Lines                             3582     3607      +25     
===============================================================
+ Hits                              3373     3392      +19     
- Misses                             209      215       +6     
Impacted Files Coverage Δ
Sources/Sentry/SentrySDK.m 93.18% <0.00%> (ø)
Sources/Sentry/SentryHub.m 91.50% <16.66%> (ø)
Sources/Sentry/SentrySpanId.m 52.38% <52.38%> (+9.52%) ⬆️
Sources/Sentry/SentryTransactionContext.m 55.55% <55.55%> (ø)
Sources/Sentry/SentryTransaction.m 78.37% <78.37%> (-15.18%) ⬇️
Sources/Sentry/SentryClient.m 93.43% <100.00%> (ø)
Sources/Sentry/SentryEnvelope.m 92.61% <100.00%> (ø)
Sources/Sentry/SentrySpanContext.m 100.00% <100.00%> (ø)
Sources/Sentry/SentryInstallation.m 86.36% <0.00%> (-9.10%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 436c1b7...ddbb588. Read the comment docs.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Awesome seeing performance going forward. I added a few comments.

Sources/Sentry/Public/SentrySpanContext.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanContext.h Show resolved Hide resolved
Tests/SentryTests/SentrySpanContextTests.swift Outdated Show resolved Hide resolved
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
@brustolin brustolin changed the title Completing SentrySpanContext properties feat: adding some missing properties to spancontext and transaction Jan 29, 2021
@brustolin brustolin changed the title feat: adding some missing properties to spancontext and transaction feat: adding missing properties to spancontext and transaction Jan 29, 2021
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks for including all the feedback. This is getting better and better. Can we add more tests so the coverage doesn't go down, please? Keep up the improvements. 👏🏼

Sources/Sentry/Public/SentrySpanContext.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanContext.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanStatus.h Show resolved Hide resolved
Sources/Sentry/Public/SentryTransaction.h Outdated Show resolved Hide resolved
Sources/Sentry/SentryTransaction.m Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanContext.h Outdated Show resolved Hide resolved
brustolin and others added 3 commits February 1, 2021 10:24
@philipphofmann philipphofmann changed the title feat: adding missing properties to spancontext and transaction feat: Add missing properties to SpanContext and Transaction Feb 2, 2021
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Please update the Changelog and decide which comments you still want to resolve. The most important ones are resolved. Thanks for including all the feedback. From my point of with LGTM.

{
NSMutableDictionary<NSString *, id> *serializedData =
[[NSMutableDictionary alloc] initWithDictionary:[super serialize]];
serializedData[@"spans"] = @[];
Copy link
Member

Choose a reason for hiding this comment

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

l: I guess this is still empty because we still need to add spans? If so, please add a comment, so I don't wonder why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. Spans coming soon.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

nice!

@bruno-garcia bruno-garcia merged commit 1195ec0 into feat/performance-monitoring Feb 2, 2021
@bruno-garcia bruno-garcia deleted the feat/transaction-spancontext branch February 2, 2021 23:51
Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

already merged but just wanted to say thanks to @brustolin to work on our reviews and being resilient pointing out improvements we could do further.

bruno-garcia added a commit that referenced this pull request Mar 11, 2021
* 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>
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.

5 participants