- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 225
Add StartSpan and GetTransaction methods to the SentrySdk #4303
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
Changes from all commits
49c43ae
              67c80cf
              a466ccf
              d366fa7
              2bf3d33
              a98db40
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|  | @@ -634,6 +634,12 @@ public static SentryId CaptureCheckIn(string monitorSlug, | |||||||||||||||||||||||||
| scope, | ||||||||||||||||||||||||||
| configureMonitorOptions); | ||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||
| /// Starts a transaction if there is not already one active on the scope, otherwise starts a new child span on the | ||||||||||||||||||||||||||
| /// currently active transaction. | ||||||||||||||||||||||||||
| /// </summary> | ||||||||||||||||||||||||||
| public static ISpan StartSpan(string operation, string description) => CurrentHub.StartSpan(operation, description); | ||||||||||||||||||||||||||
| 
      Comment on lines
    
      +637
     to 
      +641
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML documentation for the  
        Suggested change
       
 | ||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||
| /// Starts a transaction. | ||||||||||||||||||||||||||
| /// </summary> | ||||||||||||||||||||||||||
|  | @@ -692,7 +698,13 @@ public static void BindException(Exception exception, ISpan span) | |||||||||||||||||||||||||
| => CurrentHub.BindException(exception, span); | ||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||
| /// Gets the last active span. | ||||||||||||||||||||||||||
| /// Gets the currently active transaction. | ||||||||||||||||||||||||||
| /// </summary> | ||||||||||||||||||||||||||
| [DebuggerStepThrough] | ||||||||||||||||||||||||||
| public static ITransactionTracer? GetTransaction() => CurrentHub.GetTransaction(); | ||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||
| /// Gets the last active span | ||||||||||||||||||||||||||
| /// </summary> | ||||||||||||||||||||||||||
| 
      Comment on lines
    
      +706
     to 
      708
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML documentation for  
        Suggested change
       
 | ||||||||||||||||||||||||||
| [DebuggerStepThrough] | ||||||||||||||||||||||||||
| public static ISpan? GetSpan() | ||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||
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.
Consider adding parameter validation for the
StartSpanmethod. Theoperationanddescriptionparameters should be validated for null or empty values to provide better error messages and prevent potential issues downstream. Consider addingArgumentNullExceptionchecks or at least XML documentation specifying the expected behavior with null parameters.