- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.6k
feat(develop): Add SDK spec for database transactions #15194
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
          
     Merged
      
      
    
  
     Merged
                    Changes from 4 commits
      Commits
    
    
            Show all changes
          
          
            16 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      bb53eff
              
                feat(develop): Add SDK spec for SQL transaction
              
              
                alexander-alderman-webb b29aec9
              
                .
              
              
                alexander-alderman-webb 791629a
              
                .
              
              
                alexander-alderman-webb a12fcba
              
                rename file
              
              
                alexander-alderman-webb f7daffa
              
                change title and other review changes
              
              
                alexander-alderman-webb addd216
              
                .
              
              
                alexander-alderman-webb 496f9d4
              
                move sql transactions page
              
              
                alexander-alderman-webb 3fddaf0
              
                Clarify which statements should be instrumented
              
              
                alexander-alderman-webb 4665a85
              
                plural
              
              
                alexander-alderman-webb f3f2cc0
              
                .
              
              
                alexander-alderman-webb 91feab4
              
                consistent use of statement
              
              
                alexander-alderman-webb f7f8e22
              
                more clarifications
              
              
                alexander-alderman-webb 33c6a21
              
                add paragraph
              
              
                alexander-alderman-webb 9281051
              
                language
              
              
                alexander-alderman-webb f2789da
              
                language
              
              
                alexander-alderman-webb 5a751d1
              
                add alert about modals
              
              
                alexander-alderman-webb File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
          
            23 changes: 23 additions & 0 deletions
          
          23 
        
  develop-docs/sdk/telemetry/traces/modules/db-transactions.mdx
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| title: Query Injection Detection Module | ||
| --- | ||
|  | ||
| The SDK SHOULD auto-instrument all transactions for SQL databases like PostgreSQL and MySQL, as well as for MongoDB. | ||
| Each BEGIN, COMMIT, and ROLLBACK, or equivalent instruction in the database system MUST result in an individual span. | ||
| Transaction instructions SHOULD produce spans whether they are issued through a database driver or through an ORM. | ||
|  | ||
| ### Span Data | ||
|  | ||
| Each database transaction instruction MUST have a `data` attribute. | ||
| `data` is itself a key-value lookup of attributes. | ||
|         
                  alexander-alderman-webb marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| Refer to <Link to="https://getsentry.github.io/sentry-conventions/generated/attributes/code.html">Database Span Data Conventions</Link> for a full list of attributes that database spans should have. | ||
|         
                  alexander-alderman-webb marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| The SDK SHOULD set the | ||
|  | ||
| - db.system.name | ||
| - db.operation.name | ||
|  | ||
| attributes for transaction instruction spans. | ||
| Equivalent deprecated attributes MAY be used for backward compatibility, but they SHOULD be marked for deprecation. | ||
|  | ||
| The operation names for BEGIN, COMMIT and ROLLBACK instructions MUST be "BEGIN", "COMMIT", and "ROLLBACK", respectively. | ||
| For other transaction-level instructions like MySQL's START TRANSACTION, the SDK SHOULD represent the literal statement as closely as possible, omitting control-flow characters like semicolons. | ||
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.